RFR: 8251438: Issues with our POSIX set_signal_handler()
Gerard Ziemski
gziemski at openjdk.java.net
Fri Dec 11 19:35:56 UTC 2020
On Fri, 11 Dec 2020 06:26:21 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> This is a fix for a potential issue involving "The storage occupied by sa_handler and sa_sigaction may overlap, and a conforming application shall not use both simultaneously." https://pubs.opengroup.org/onlinepubs/009695399/functions/sigaction.html, when we in fact do assume different storages.
>
> src/hotspot/os/posix/signals_posix.cpp line 743:
>
>> 741: // Implementation may use the same storage for both the sa_sigaction field and the sa_handler field,
>> 742: // so check for "sigAct.sa_flags == SA_SIGINFO"
>> 743: static address get_signal_handler(struct sigaction action) {
>
> This copies the structure by value. While the compiler will probably optimize this out, I'd still not do it. Please use
> static address get_signal_handler(const struct sigaction*)
>
> instead.
Thank you Thomas for the review.
How about:
`static address get_signal_handler(struct sigaction &action)`
?
-------------
PR: https://git.openjdk.java.net/jdk/pull/1680
More information about the hotspot-runtime-dev
mailing list