Skip to content
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

JNAerated libraries crash or hang in printf on win32 #39

Open
ochafik opened this issue Mar 18, 2015 · 2 comments
Open

JNAerated libraries crash or hang in printf on win32 #39

ochafik opened this issue Mar 18, 2015 · 2 comments

Comments

@ochafik
Copy link
Member

ochafik commented Mar 18, 2015

From @leahxschmidt on December 27, 2012 16:37

To reproduce, do the following, on a 32-bit Windows XP system (I am using a 32-bit VM on a 64-bit host, if that matters).

Install cygwin, including gcc, and make.

git clone https://github.com/leahxschmidt/testjnaerator.git
cd testjnaerator
make
cd java
javac -cp test_linux.jar:. JavaTest.java
java -cp test_linux.jar:. -Djna.nosys=true JavaTest

now, manually extract the jar -- see #351

jar xf test_win32.jar
java -cp . -Djna.library.path=lib/win32/ JavaTest

For me, this hangs. But I have tried a bunch of variants on the C code and some also make the JVM crash in cygwin's aclcheck function (I think inet_addr typically does this). On 64-bit Windows XP, this code runs correctly (well, the printf stuff gets printed after the Java println but I assume this is due to buffering; that doesn't bother me).

Copied from original issue: nativelibs4java/nativelibs4java#352

@ochafik
Copy link
Member Author

ochafik commented Mar 18, 2015

Hi @leahxschmidt ,

Thanks for your detailed report!

GCC on Windows is not currently officially supported (not tested at all, actually), but have you tried using the -gccLong option of JNAerator?

Cheers

@ochafik
Copy link
Member Author

ochafik commented Mar 18, 2015

From @leahxschmidt on January 8, 2013 17:45

I decided to just switch to mingw (and JNI, since the library I was using only had like four functions).

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

No branches or pull requests

1 participant