RFR: 8292695: SIGQUIT and jcmd attaching mechanism does not work with signal chaining library
Thomas Stuefe
stuefe at openjdk.org
Tue Aug 23 20:09:33 UTC 2022
On Mon, 22 Aug 2022 08:29:36 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Hi all,
>>
>> Could anyone review this bug fix? See https://bugs.openjdk.org/browse/JDK-8292695 for details.
>>
>> I changed the temporary handler for SIGQUIT to use a dummy function, and use `os::signal()` to set it up, just as `os::initialize_jdk_signal_support()` does.
>> It is possible that just moving the `set_signal_handler(BREAK_SIGNAL, false);` in `install_signal_handlers()` outside of the window bounded by `JVM_{begin|end}_signal_setting()` could also fix this bug. However, `set_signal_handler()` and `JVM_HANDLE_XXX_SIGNAL()` are currently used for signals that support chaining and periodically check, which do not apply to SIGQUIT. I think it is cleaner to use different functions for SIGQUIT.
>>
>> I also added a test to check that sending SIGQUIT should produce a thread dump on stdout, with and without using libjsig.so.
>>
>> -Man
>
> @caoman I'm interested in what your launcher does, or is, since I have almost never encountered signal chaining in the field. Would you mind sharing what product the launcher belongs to, and why you enable signal chaining?
> @tstuefe Our launcher is equipped with almost all our Java applications. It basically does what bin/java does, but with several additional features. One main motivation to have our own launcher, is to static link all user-defined JNI dependency libraries with the launcher, so the applications do not need to use `System.loadLibrary()` to load `.so` files dynamically. Using static linking instead of dynamically loading `.so` files is core characteristic of our deployment environment for almost all languages (C, C++, Java, Python, Go). @jianglizhou is actually working on a project that also statically links HotSpot (`libjvm.so` and other `.so` files) with the our launcher as well.
That is interesting. Do you link statically to improve startup speed, or for some other reason?
-------------
PR: https://git.openjdk.org/jdk/pull/9955
More information about the hotspot-runtime-dev
mailing list