-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactor signal handling and replace signal handlers with thread-safe functions #134
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
Conversation
|
@zzxuanyuan 5. Note that for the test you made for #84, we had to apply a few fixes to the CMakeLists.txt to make it more general. |
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.
Update to your name and current month
|
@zzxuanyuan 2. I think the new Signal class should focus in the signal handling itself and delegate the auxiliary functoin (getenv, etc, to gSystem). |
|
@zzxuanyuan Other signals are still using default StackTrace functions. What made you make this choice? @zzxuanyuan kSigAlarm and kSigChild are ignored for my current implementation. What made you make this choice? Thanks. |
|
@pcanal I ignore kSigAlarm is because it will trigger the function DispatchTimers(). This function is implemented in TUnixSystem but not defined in TSystem. I can't use gSystem to call this function. Same issue for kSigChild, it tries to call CheckChilds(). I could either duplicate these two functions in TSigHandling or add those functions in TSystem. But I don't think it makes sense if we define them in TSystem. Update: |
What is the stack trace? |
|
Here is the stack trace of the error. Now I just simply use type casting gSystem to TUnixSystem to get rid of defining DispatchTimers() in TSystem. |
|
No idea how you managed to get there :-) but that crash should now be protected against in the master by f0e5295. You forgot to set ROOTSYS (and somehow ROOT didn't manage to determine it itself...) |
|
Hi Zhe, Just sent a pull request to your branch that merges master into this branch (makes things a bit easier to review) and does a small touchup (add a timeout when waiting for GDB to protect against potential issues). Everything looks good to me - this is probably ready to go forward (do please continue to work on the unit test in parallel). Brian |
|
@pcanal - I'm starting to poke at this one now. I'd like to get this closed out. |
|
@zzxuanyuan - I only found a small issue, from using newer versions of CMake. Can you cherry-pick this patch: Merges cleanly back into master; everything seems to work well. |
|
@bbockelm I had started working on the merge but got distracted. The branch as it was then did not build on MacOS (i have a fix for that). I am also still uncomfortable with
which zxuanyuan explain to some extent and found odd failure when attempting to improve the situation, so I wanted to take a closer look (too see what the problem was and/or there was a better way). |
|
Can you send the fix to @zzxuanyuan so he can also cherry-pick it along with the comment I left above? |
|
See pcanal@0108ec6 |
…edicated to handling signals of the system
…) and CheckChilds() from TUnixSystem.cxx
| #pragma link C++ class TStringToken; | ||
| #pragma link C++ class TSubString; | ||
| #pragma link C++ class TSysEvtHandler; | ||
| #pragma link C++ class TSigHandling+; |
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.
Is there a reason you preferred TSigHandling over TSigHandler?
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.
There exists TSignalHandler (https://github.com/root-project/root/blob/8f66431755137822f726c4594b680997324439b5/core/base/inc/TSysEvtHandler.h). I feel TSigHandler is so close to TSignalHandler that it could be difficult to distinguish.
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.
I personally find this very confusing. What is the difference between the two?
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.
What is the reason which brought you to create a dictionary for the class(es)?
|
@zzxuanyuan - can you resolve conflicts noted above? |
|
Can one of the admins verify this patch? |
|
Don't worry about this .. for better or worse this patch request is on my desk in half merge/half more upgrade state and need a bit more help on my side. I am keeping this pull request open until I am done. |
|
closing while being reworked. |
|
Sorry for the naive question, but what would be the difference between TSignalHandler and TSigHandling? Aren't they the same? Why a new class (and a new global)? |
|
TSignalHandler is the name of original implementation in ROOT. TSigHandling is the new implementation which supports thread-safe functions. Zhe |
|
See #1053 |
@bbockelm I am submitting a new pull request for signal handling:
Fix issue ROOT-7588. #84
Could you take a look at it and I will write test case this patch also.