Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

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 <smcv@collabora.com>
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants