RFR: 8257572: Deprecate the archaic signal-chaining interfaces: sigset and signal

David Holmes david.holmes at oracle.com
Sat Dec 5 05:22:10 UTC 2020


Hi Erik,

On 4/12/2020 12:07 am, Erik Joelsson wrote:
> On Thu, 3 Dec 2020 04:34:52 GMT, David Holmes <dholmes at openjdk.org> wrote:
> 
>> The signal-chaining facility was introduced in JDK 1.4 nearly 20 years ago and supported three different Linux signal API's: sigset, signal and sigaction:
>>
>> https://docs.oracle.com/javase/8/docs/technotes/guides/vm/signal-chaining.html
>>
>> Only sigaction is a Posix supported API for multi-threaded processes, that we can use cross-platform. Both signal and sigset are obsolete and have undefined behaviour in a multi-threaded process. From the Linux man pages:
>>
>> sigset: This API is obsolete: new applications should use the POSIX signal API (sigaction(2), sigprocmask(2), etc.)
>>
>> signal: The behavior of signal() varies across UNIX versions, and has also varied historically across different versions of Linux. Avoid its use: use sigaction(2) instead.
>>
>> We should deprecate the use of signal and sigset in JDK 16 with a view to their removal in JDK 17.
>>
>> A CSR request has been filed.
>>
>> Testing: hotspot/jtreg/runtime/signal tests
>>
>> Thanks,
>> David
> 
> make/modules/java.base/Lib.gmk line 131:
> 
>> 129: ifeq ($(call isTargetOsType, unix), true)
>> 130:   ifeq ($(STATIC_BUILD), false)
>> 131:     LIBJSIG_CFLAGS += -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"'
> 
> In general, I would prefer if a flag like this was just inlined in the SetupJdkLibrary call, as there are no complex conditionals for setting it. Looking a bit further, the variable LIBJSIG_CFLAGS is dead and not set anywhere in the build, so could also just be removed and replaced with your new -D flag.

I thought about just inlining it but it seemed "obvious" that 
LIBJSIG_CFLAGS existed exactly for this purpose, so I simply set it 
there - taking care to expand it in case it was set directly on the 
command-line. It also followed what is done for LIBJLI_CFLAGS.

I can change it if you insist but this code will be very short-lived as 
I can remove it again in 17 once I no longer need the deprecation warning.

Thanks,
David

> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/1587
> 



More information about the build-dev mailing list