-
Bug
-
Resolution: Fixed
-
P2
-
7-pool, 8-pool, 9
-
x86
-
os_x
OSX does not use LD_PRELOAD to preload libraries. On OSX, the equivalent environmental variables is DYLD_INSERT_LIBRARIES. However, because of OSX's two-level namespace (a symbol's fully qualified name includes it's library), DYLD_FORCE_FLAT_NAMESPACE also needs to be defined to allow functions in libjsig to replace the OS implementations. Note the value chosen for DYLD_FORCE_FLAT_NAMESPACE is irrelevant, as long as the variable is defined to be *some* value.
For example, the line below will enable signal chaining by preloading libjsig:
===
$ DYLD_FORCE_FLAT_NAMESPACE=0 DYLD_INSERT_LIBRARIES="<JAVA_HOME>/lib/libjsig.dylib" java MySpiffyJavaApp
===
Without both of these environmental variables set, signal-chaining will not work.
Also, the library file name on OSX is libjsig.dylib, not libjsig.so as it is on Solaris/Linux. The documents should also reflect that.
I have found the following docs that require updating. There may be others.
https://docs.oracle.com/javase/8/docs/technotes/guides/vm/signal-chaining.html
https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/signals003.html
https://docs.oracle.com/javase/7/docs/technotes/guides/vm/signal-chaining.html
https://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/signals.html
For example, the line below will enable signal chaining by preloading libjsig:
===
$ DYLD_FORCE_FLAT_NAMESPACE=0 DYLD_INSERT_LIBRARIES="<JAVA_HOME>/lib/libjsig.dylib" java MySpiffyJavaApp
===
Without both of these environmental variables set, signal-chaining will not work.
Also, the library file name on OSX is libjsig.dylib, not libjsig.so as it is on Solaris/Linux. The documents should also reflect that.
I have found the following docs that require updating. There may be others.
https://docs.oracle.com/javase/8/docs/technotes/guides/vm/signal-chaining.html
https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/signals003.html
https://docs.oracle.com/javase/7/docs/technotes/guides/vm/signal-chaining.html
https://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/signals.html