New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansicon not working on Windows 7 x64 #28

Closed
jasonkarns opened this Issue Mar 28, 2012 · 7 comments

Comments

Projects
None yet
2 participants
@jasonkarns

jasonkarns commented Mar 28, 2012

I'm not sure what's going on with ansicon. I've been using it for months successfully at work (32-bit XP) with no problem. I've installed it on my home machine (Win7, x64) but no dice. When running rspec with color output, it spits out the actual ansi color codes with the regular output.

I installed it 'permanently' using the -i option. I've tried versions 1.32, 1.40, 1.50 and 1.51. Same output with each of them. I've tried running rspec from mingw-bash (my preferred shell), as well as standard command prompt. Same output in each. I've also tried uninstalling and running manually with -p. Still, same output.

I enabled logging and tried setting ANSICON_EXC to various combinations of the hooked DLLs, still got the same output.

Any thoughts? It's frustrating to have the use of this awesome utility on one machine, and not have the ability to run it on another.

@adoxa

This comment has been minimized.

Show comment
Hide comment
@adoxa

adoxa Mar 30, 2012

Owner

If you're seeing a log, it should be working. Could you log the 32-bit system and do a comparison?

Owner

adoxa commented Mar 30, 2012

If you're seeing a log, it should be working. Could you log the 32-bit system and do a comparison?

@jasonkarns

This comment has been minimized.

Show comment
Hide comment
@jasonkarns

jasonkarns Apr 1, 2012

x86

Log for x86/ansicon.exe -p with ANSICON_LOG=3.

Logging started 2012-04-01 17:46:36
ansicon (6184): cmd.exe
ansicon (6184): Ignoring unsupported machine (0x8664)

x64

Log for x64/ansicon.exe -p with ANSICON_LOG=3.

Logging started 2012-04-01 17:54:29
ansicon (5236): cmd.exe
ansicon (5236): 64-bit console (base = 000000004A990000)
cmd (2516): hDllInstance = 000000006C200000
cmd (2516): Hooking cmd.exe
snip
cmd (2516): Hooking completed
cmd (2516): Hooking USER32.dll (LoadLibraryExA)
cmd (2516): CreateProcessW: "D:\jruby-1.6.5\bin\jruby.exe", "jruby -S rspec -c D:\dev\colortest\spec.rb"
cmd (2516): 32-bit console (base = 0000000000400000)
jruby (6012): hDllInstance = 6F980000
jruby (6012): Hooking jruby.exe
snip
jruby (6012): CreateProcessA: "", ""D:\jruby-1.6.5\jre\bin\java.exe" "-Djdk.home=D:\jruby-1.6.5\jre" "-Djruby.home=D:\jruby-1.6.5" "-Djruby.script=jruby" "-Djruby.shell=cmd.exe" "-Djffi.boot.library.path=D:\jruby-1.6.5\lib\native\i386-Windows;D:\jruby-1.6.5\lib\native\x86_64-Windows" "-Xmx500m" "-Xss2048k" "-Djruby.memory.max=500m" "-Djruby.stack.max=2048k" "-Dsun.java.command=org.jruby.Main" "-Djava.class.path=" "-Xbootclasspath/a:D:\jruby-1.6.5\lib\jruby.jar" org/jruby/Main "-S" "rspec" "-c" "D:\dev\colortest\spec.rb""
jruby (6012): Ignoring unsupported machine (0x8664)
jruby (6012): Terminating

jasonkarns commented Apr 1, 2012

x86

Log for x86/ansicon.exe -p with ANSICON_LOG=3.

Logging started 2012-04-01 17:46:36
ansicon (6184): cmd.exe
ansicon (6184): Ignoring unsupported machine (0x8664)

x64

Log for x64/ansicon.exe -p with ANSICON_LOG=3.

Logging started 2012-04-01 17:54:29
ansicon (5236): cmd.exe
ansicon (5236): 64-bit console (base = 000000004A990000)
cmd (2516): hDllInstance = 000000006C200000
cmd (2516): Hooking cmd.exe
snip
cmd (2516): Hooking completed
cmd (2516): Hooking USER32.dll (LoadLibraryExA)
cmd (2516): CreateProcessW: "D:\jruby-1.6.5\bin\jruby.exe", "jruby -S rspec -c D:\dev\colortest\spec.rb"
cmd (2516): 32-bit console (base = 0000000000400000)
jruby (6012): hDllInstance = 6F980000
jruby (6012): Hooking jruby.exe
snip
jruby (6012): CreateProcessA: "", ""D:\jruby-1.6.5\jre\bin\java.exe" "-Djdk.home=D:\jruby-1.6.5\jre" "-Djruby.home=D:\jruby-1.6.5" "-Djruby.script=jruby" "-Djruby.shell=cmd.exe" "-Djffi.boot.library.path=D:\jruby-1.6.5\lib\native\i386-Windows;D:\jruby-1.6.5\lib\native\x86_64-Windows" "-Xmx500m" "-Xss2048k" "-Djruby.memory.max=500m" "-Djruby.stack.max=2048k" "-Dsun.java.command=org.jruby.Main" "-Djava.class.path=" "-Xbootclasspath/a:D:\jruby-1.6.5\lib\jruby.jar" org/jruby/Main "-S" "rspec" "-c" "D:\dev\colortest\spec.rb""
jruby (6012): Ignoring unsupported machine (0x8664)
jruby (6012): Terminating

@adoxa

This comment has been minimized.

Show comment
Hide comment
@adoxa

adoxa Apr 5, 2012

Owner

Ah, you've hit one of the limitations:

The 64-bit version can inject into a 32-bit process, but the 32-bit
version will not inject into a 64-bit process.

It injects fine into the 64-bit cmd.exe, which has no problem injecting into the 32-bit jruby.exe, but that cannot then inject into the 64-bit java.exe. I think I do have a way of addressing that, but I'm afraid you might have to wait a week or two until I'm online again. A workaround is to take the java command line you see above and run it directly, bypassing jruby (assuming that's possible).

Owner

adoxa commented Apr 5, 2012

Ah, you've hit one of the limitations:

The 64-bit version can inject into a 32-bit process, but the 32-bit
version will not inject into a 64-bit process.

It injects fine into the 64-bit cmd.exe, which has no problem injecting into the 32-bit jruby.exe, but that cannot then inject into the 64-bit java.exe. I think I do have a way of addressing that, but I'm afraid you might have to wait a week or two until I'm online again. A workaround is to take the java command line you see above and run it directly, bypassing jruby (assuming that's possible).

@jasonkarns

This comment has been minimized.

Show comment
Hide comment
@jasonkarns

jasonkarns Apr 7, 2012

Okay, thanks for the update. I think it will probably be easier to make jruby use a 32-bit JVM. I'll give that a shot.

jasonkarns commented Apr 7, 2012

Okay, thanks for the update. I think it will probably be easier to make jruby use a 32-bit JVM. I'll give that a shot.

@jasonkarns

This comment has been minimized.

Show comment
Hide comment
@jasonkarns

jasonkarns Apr 9, 2012

I've confirmed that this issue is due to the x64 -> x86 -> x64 jump. I re-ran my test spec with a 32-bit JVM and the color works great. On a somewhat related note, I've created a feature request with JRuby to ship the 64-bit version with a 64-bit exe (as opposed to a 32-bit launcher for 64-bit JVM). http://jira.codehaus.org/browse/JRUBY-6586

jasonkarns commented Apr 9, 2012

I've confirmed that this issue is due to the x64 -> x86 -> x64 jump. I re-ran my test spec with a 32-bit JVM and the color works great. On a somewhat related note, I've created a feature request with JRuby to ship the 64-bit version with a 64-bit exe (as opposed to a 32-bit launcher for 64-bit JVM). http://jira.codehaus.org/browse/JRUBY-6586

@adoxa

This comment has been minimized.

Show comment
Hide comment
@adoxa

adoxa Apr 12, 2012

Owner

New binaries are available in the downloads. Seemed to work fine in 32-bit testing, so I hope I got everything right for 64-bit.

Owner

adoxa commented Apr 12, 2012

New binaries are available in the downloads. Seemed to work fine in 32-bit testing, so I hope I got everything right for 64-bit.

@jasonkarns

This comment has been minimized.

Show comment
Hide comment
@jasonkarns

jasonkarns Apr 17, 2012

Excellent! I updated to the latest binaries and voila! Color!

jasonkarns commented Apr 17, 2012

Excellent! I updated to the latest binaries and voila! Color!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment