-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Corrupted error messages on Linux #392
Comments
Looks like a legit bug, Would appreciate a PR with a fix + test. |
IIRC this was forced by defining _XOPEN_SOURCE 600; perhaps this is no longer sufificient?
|
Observations:
So, it looks like this may be due to the build environment somehow. What glibc version was dist/jna.jar built with? I am using glibc 2.20. |
Closing - this is fixed by #669. |
Motivation: windows-2016 was removed so we need to use the next lowest which is 2019 Modifications: - Use windows-2019 - Use v142 Result: Builds on windows work again
Error message in LastErrorException is corrupted on Linux. I think this is a reoccurrence/regression of issue #215. I am using jna-4.1.0.jar from Maven central, with Oracle JDK 1.7.0_71 64-bit, Fedora 21 x86 64-bit (kernel 3.17.7-300.fc21.x86_64), glibc-2.20-5.fc21.x86_64
Here is my sample code:
i.e. trying to read from a file descriptor that should not exist, we expect a bad file descriptor error.
On Mac OS X 10.9.5, I get the results I expect:
Exception in thread "main" com.sun.jna.LastErrorException: [9] Bad file descriptor
But on Linux the error message is corrupted:
Exception in thread "main" com.sun.jna.LastErrorException: [9] h
I think I know the problem. If I extract jna-4.1.0.jar into a working directory, then run the following:
Note it is importing the GNU strerror_r, not the XSI strerror_r. The XSI strerror_r is not called strerror_r, it is called _xpg_strerror_r. I think if you used the XSI version instead, the problem would go away. Check output of:
you can see the XSI version (__xpg_strerror_r) is exported separately.
The text was updated successfully, but these errors were encountered: