RFR: 8253742: POSIX signal code cleanup

Gerard Ziemski gziemski at openjdk.java.net
Mon Nov 2 19:31:06 UTC 2020


hi all,

Please review this followup to [JDK-8252324 Signal related code should be shared among POSIX platforms](https://bugs.openjdk.java.net/browse/JDK-8252324), where several issues were identified for a cleanup. This change addresses them all:

#1 David's feedback - removed non POSIX SIGNIFICANT_SIGNAL_MASK code

#2 David's feedback - used unblock_program_error_signals() on all platforms (this change is superseeded by JDK-8252533, will need to merge)

#3 David's feedback - used single JVM_handle_posix_signal API for all POSIX platforms

#4 Coleen's feedback - cleanup header files in src/hotspot/os/posix/signals_posix.hpp

#5 Coleen's feedback - hid SR_signum assignment in src/hotspot/os/posix/signals_posix.hpp to avoid having to include <signal.h>

#6 Coleen's feedback - factored out print_signal_handlers()

#7 Thomas' feedback - factored out common POSIX os::SuspendedThreadTask::internal_do_task()

#8 Thomas's feedback - factored out common POSIX signal initialization code

#9 YaSuenag's feedback - used JVM_handle_posix_signal for the common API

#10 YaSuenag's feedback - unified logging out of the scope for this fix

#11 YaSuenag's feedback - memset usage in PosixSignals::jdk_misc_signal_init() correct?

-------------

Commit messages:
 - Factor out common POSIX signal initialization code
 - Factor out do_task into PosixSignals
 - factor out print_signal_handlers
 - Coleen's feedback integrated
 - merge
 - Use JVM_handle_posix_signal for all POSIX platforms
 - factor out ucontext_get_pc and ucontext_set_pc into their respective platform code
 - Use JVM_handle_posix_signal for all POSIX platforms
 - Use unblock_program_error_signals() on all platforms
 - Remove non POSIX SIGNIFICANT_SIGNAL_MASK code

Changes: https://git.openjdk.java.net/jdk/pull/636/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=636&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8253742
  Stats: 326 lines in 20 files changed: 91 ins; 157 del; 78 mod
  Patch: https://git.openjdk.java.net/jdk/pull/636.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/636/head:pull/636

PR: https://git.openjdk.java.net/jdk/pull/636


More information about the hotspot-dev mailing list