Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


As part of writing my book on LibreOffice internals, I’m trying to understand why we special case 
signalling for the JVM. 

We seem to be concerned about wiping out the JVM signal handlers, but any JVM used after v1.4 has 
the -Xrs switch that allows for signal chaining (see 
http://docs.oracle.com/javase/7/docs/technotes/guides/vm/signal-chaining.html 
<http://docs.oracle.com/javase/7/docs/technotes/guides/vm/signal-chaining.html>).

According to the Java documentation:
The signal-chaining facility offers the following:

Support for pre-installed signal handlers when the HotSpot VM is created.
Support for signal handler installation after the HotSpot VM is created, inside JNI code or from 
another native thread.
Pre-installed signal handlers (A) are supported by means of saving existing signal handlers, for 
signals that are used by the VM, when the VM is first created. Later, when any of these signals 
are raised and found not to be targeted at the Java HotSpot VM, the pre-installed handlers are 
invoked. In other words, pre-installed handlers are "chained" behind the VM handlers for these 
signals.

The signal-chaining facility also allows an application to link and load a shared library 
libjsig.so before libc/libthread/libpthread. This library ensures that calls such as signal(), 
sigset(), andsigaction() are intercepted so that they do not actually replace the Java HotSpot 
VM's signal handlers if the handlers conflict with those already installed by the Java HotSpot VM 
(B). Instead, these calls save the new signal handlers, or "chain" them behind the VM-installed 
handlers. Later, when any of these signals are raised and found not to be targeted at the Java 
HotSpot VM, the pre-installed handlers are invoked. libjsig.so is not needed if (B) is not 
required.

We seem to jump through all sorts of hoops to implement this functionality, but given the JVM 
already caters for this, why are we doing this?

The issue seems to be in regards to adding crash handling code. 

Great to get some feedback on this. I’ve tried a few things, but I must be missing something 
crucial due to my own lack of experience. I thought I’d take this to the ML rather than constantly 
harass poor sberg :-)

My Gerrit attempts can be found here:

Attempt 1:

https://gerrit.libreoffice.org/#/c/38916/3 <https://gerrit.libreoffice.org/#/c/38916/3>

Last attempt:

https://gerrit.libreoffice.org/#/c/38916/ <https://gerrit.libreoffice.org/#/c/38916/>

Chris

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.