Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8130375

add OSX-specific explanation to signal chaining documentation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 7-pool, 8-pool, 9
    • docs
    • 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

            ashenoy Anjana Shenoy (Inactive)
            dbuck David Buck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: