Created attachment 110072 [details]
Test this exception with this JAVA Class
On Windows when you start a java-uno-connection via pipe then on some machines you can get the following exception/segfault in the jpipe.dll.
Detailed Description (sorry for the German UI language settings):
Zusatzinformation 1: 022d
Zusatzinformation 2: 022d20d2f136501747c7b284fa79af41
Zusatzinformation 3: 171f
Zusatzinformation 4: 171fb495ef00f99cffbb09f85224e710
The problem is reprocible with LO 4.2.5 and current master.
How to reproduce:
- Download http://wollmux.googlecode.com/files/wollmux-config-de-utf8-11.11a.tar.gz and extracting in your home-dir e.g. C:\Users\<user-name>
- Copy the WollMuxBar.jar in your preferred directory
- Start with:
"c:\Program Files (x86)\Java\jdk1.7.0_67/bin\java.exe" -cp "WollMuxBar.jar;<Your-Path>\lo-core\instdir\URE\java\juh.jar;<Your-Path>\lo-core\instdir\program\classes\unoil.jar" de.muenchen.allg.itd51.wollmux.dialog.WollMuxBar
- Sometimes now the segfault appears
When the bar appears you are a lucky guy, but you were not able to reproduce the bug - it is a sporadic bug.
Analysis result / solution:
In the jpipe.dll DLLMain there's a call to the WinApi's LoadLibraryExW function and that is not allowed. Please see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682583(v=vs.85).aspx in the Remarks section. It is clearly mentioned there, that the behaviour for such usage is not defined and risky.
Here's some code pointer I suppose:
Stephan: one for you?
Yes, I faintly remember that the DllMain restrictions were well known when the code was originally written, but it was considered "appears to work anyway."
But should be possible to move the code from DllMain into getFunction. Jürgen, do you want to work on that?
- Remove the LoadLibrary from DLLMain (from windows not recommended)
- Set function-ptr variable (faster)
- Improve the comment why we need two dll's (jpipe.dll and jpipx.dll)
In Patch set 2
i have remove the function pointer
gerrit: see Comment 2
Juergen Funk committed a patch related to this issue.
It has been pushed to "master":
fdo#86745 - Possible exception/segfault in jurt jpipe.dll under Windows ...
It will be available in 4.5.0.
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
Created attachment 112816 [details]
a new jpipe.dll for Windows - replace the buggy one by this
Juergen: I'm not sure, may we consider this tracker as FIXED or is there some work to do here?
this can set to be fixed, it works.
Thank you Juergen for your feedback.