-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix signal handler registration in the JVM #2965
Fix signal handler registration in the JVM #2965
Conversation
Are there any other places/signals with a similar problem? jenkins test extended zlinux jdk8 |
@babsingh does this place also need to be fixed? |
yes, it passes.
yes, this place would also need to be fixed since |
ad25680
to
ae18496
Compare
ae18496
to
2de4098
Compare
@pshipton I have updated two other places where |
omrsig.cpp::omrsig_primary_sigaction/omrsig_primary_signal doesn't support registration with SIG_DFL/SIG_IGN/NULL as the signal handler. 1) SIG_IGN is passed as the signal handler for SIGPIPE. 2) NULL is passed as the new signal handler for SIGILL. In the above cases, omrsig_primary_sigaction/omrsig_primary_signal shouldn't be used for registering a signal handler. Now onwards, only <signal.h>::sigaction/signal will used in the above cases. SIGPIPE needs to be ignored for the Java Attach API to work properly. Fixes eclipse-openj9#2871 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
2de4098
to
88f2110
Compare
The port library code wasn't affected by #2631 as I understand it. Plus the code just seems wrong. I think we should leave this one for further investigation and a different PR. |
Waiting for https://ci.eclipse.org/openj9/job/PullRequest-Extended-JDK8-linux_390-64_cmprssptrs-OpenJ9/72/ to complete and pass. jenkins compile xlinux jdk8 |
Removed changes related to Opened #2967 to resolve the issue related to |
@pshipton https://ci.eclipse.org/openj9/job/PullRequest-Extended-JDK8-linux_390-64_cmprssptrs-OpenJ9/72/ has passed. I have verified that |
I think we want to revisit this and the original PR #2631 The extra rules on the use of signal vs omr_* apis increases the likelihood of future bugs when these rules are missed by developers & reviewers. |
Agreed, we should revisit this. right approach: |
I'm not sure this actually works. There is a difference between user code calling sigaction, and the VM calling sigaction. If the VM has registered a signal we don't want user code to then set it to ignore or default. |
@babsingh Can you open an issue and outline the changes that have been made so far, why they were made, and what you think the right path forward is? Let's have the discussion in a top-level issue rather than in the comments on an already merged PR. Too easy to lose this discussion :) |
omrsig.cpp::
omrsig_primary_sigaction
/omrsig_primary_signal
doesn'tsupport registration with SIG_DFL/SIG_IGN/NULL as the signal handler.
SIG_IGN
is passed as the signal handler forSIGPIPE
.NULL
is passed as the new signal handler forSIGILL
.In the above cases,
omrsig_primary_sigaction
/omrsig_primary_signal
shouldn't be used for registering a signal handler.
Now onwards, only <signal.h>::
sigaction
/signal
will used in the abovecases.
SIGPIPE
needs to be ignored for the Java Attach API to work properly.Fixes #2871
Signed-off-by: Babneet Singh sbabneet@ca.ibm.com