Skip to content
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

intercept: Abort via the equivalent of raise(SIGABRT) #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smcv
Copy link

@smcv smcv commented May 29, 2019

If we're crashing, raise(SIGABRT) is more debugging-friendly than _exit(1) - that way we'll leave a core dump behind.


This change is Reviewable

If we're crashing, raise(SIGABRT) is more debugging-friendly than
_exit(1) - that way we'll leave a core dump behind.

Signed-off-by: Simon McVittie <[email protected]>
@smcv
Copy link
Author

smcv commented May 29, 2019

Hmm, this makes the tests fail, because some of the tests expect it to be possible to fail to patch a function. Sorry, I'm not sure I understand how those tests ever passed - wouldn't they kill the host process with exit_group()?

/* abort(), but without using glibc */
tid = syscall_no_intercept(SYS_gettid);
pid = syscall_no_intercept(SYS_getpid);
syscall(SYS_tgkill, pid, tid, SIGABRT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, why is it syscall here, and why not syscall_no_intercept?
Your comment says "without glibc", but syscall is a function in libc, which is going to be intercepted actually...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants