-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8254824: SignalHandlerMark have no purpose #677
8254824: SignalHandlerMark have no purpose #677
Conversation
👋 Welcome back rehn! A progress list of the required criteria for merging this PR into |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Seems like a leftover from Solaris.
@robehn This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 17 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me.
As much as I like seeing old code removed, wouldn't this be something that would be useful? Should Mutex::lock with safepoint check for instance check for this? |
Mailing list message from David Holmes on hotspot-runtime-dev: On 15/10/2020 7:08 pm, Thomas Stuefe wrote:
Yes (for os::fork_and_exec), and also the old Thread::current() code: inline Thread* Thread::current() { Arguably we should be checking that a lot of code is never executed in a David |
Maybe. But as it is, beside being unused it is pretty inconsistent: only the main signal hndler uses this, not the SR_handler nor the secondary error handler. So, Thread::_num_nested_signal would only ever be >1 if a second signal happened right inside the signal handling but before fatal error handling kicks in, which as its first step installs the secondary error handler. BTW one thing I wondered about is that all the JVM_handle_xxx_signal() functions return an int; but we return anything out of {true, false, 0, 1.} And the return value is then ignored at the caller. For example, the "abort_if_unrecognized" option does not seem to do anything - can probably be removed. |
So the code I was worried about is the code between JVM_handle_x_signal and calling report_and_die. There's a lot of duplicated code in JVM_handle_x_signal. I moved some of it but if we move more of it far away, it would be nice to know we aren't calling Thread::current() or some Mutex inside of the signal handler. That said, I'm ok with its deletion. |
I see your point now, I agree with you that it could be useful information. But its very easy to re-introduce if we want. We don't even need a RAII object, we could just increase the signal nesting level in javaSignalHandler() directly. |
If you execute any code which takes a Mutex you risk deadlocking, since they are not recursive and pthread_mutex is not signal safe. (if they were you risk that the data they are protecting are inconsistent when reading it from signal handler any ways) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Thanks.
/integrate |
@robehn Since your change was applied there have been 26 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 011dd0d. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
SignalHandlerMark increase and decrease _num_nested_signal, but it is never read.
We have no caller to is_inside_signal_handler().
Testing T1.
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/677/head:pull/677
$ git checkout pull/677