-
Notifications
You must be signed in to change notification settings - Fork 59
hijack: roll back signal before func_exit_handler #977
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
if any function inside func_exit_handle calls exit indirectly, it will lead to infinity recursive calls. Roll back the signal in the beginning of the handler to avoid such cases. Signed-off-by: Yong-an Lu <yongan.lu@intel.com>
marc-hb
left a comment
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.
No, bash is not that stupid. Type this:
bash
func_exit_handler() { printf 'in exit handler\n'; exit ; }
trap func_exit_handler EXIT
exit
=> no infinite loopAre you trying to call the handler directly? Don't do that. If you need to call the handler's code then insert one layer of indirection.
|
@marc-hb Maybe my understanding is incorrect, but in https://sof-ci.sh.intel.com/#/result/planresultdetail/17476?model=TGLU_RVP_NOCODEC_IPC4ZPH&testcase=check-playback-all-formats It looks like a recursive call on https://github.com/thesofproject/sof-test/pull/973/files#diff-bc7925bc6dfddedfd138183aeea9aafd0010bde80cb9d55b12701a2c0d0fc32fR697 |
|
BTW, in sh-tglu-rvp-nocodec-ci-02 the journal seems lost, @marc-hb do you have any solution? |
|
Maybe it was called twice because of our weird SubTest thing. Anyway https://sof-ci.sh.intel.com/#/result/planresultdetail/17476?model=TGLU_RVP_NOCODEC_IPC4ZPH&testcase=check-playback-all-formats does not look like an infinite loop at all. |
|
Can you reproduce a problem that is fixed by this PR? |
No, I'm still trying. |
|
I understand where the TIMEOUT came from: it's just because there is no "Test Result: FAIL!" at the end of the log. But there are still 2 mysteries:
|
|
This looks like a double reservation: It could also be the previous test that just crashed. |
this function is called in many places. |
This is worrying and not the first time. I recently found that Ubuntu 22 still uses |
if any function inside func_exit_handle calls exit indirectly, it will lead
to infinity recursive calls. Roll back the signal in the beginning of the
handler to avoid such cases.
Signed-off-by: Yong-an Lu yongan.lu@intel.com