pete icon indicating copy to clipboard operation
pete copied to clipboard

Special case SIGINT

Open s1341 opened this issue 4 years ago • 5 comments

Without this, SIGINTs get swallowed. Not sure why.

s1341 avatar Aug 19 '21 07:08 s1341

Thanks for the PR, @s1341.

Do you have a small repro case that exhibits the original bug? How did you test this change, and in what system configurations/versions?

ranweiler avatar Aug 20 '21 22:08 ranweiler

I don't... I guess I could work one up. What I did was kill(SIGINT) and then ptracer.wait(), expecting to get a fresh tracee and a siginfo with the correct signal. This wasn't working correctly before.

s1341 avatar Aug 23 '21 04:08 s1341

@s1341 no worries, I can put together a test. My main question is more standard "bug report" stuff: repro steps (now answered), observed OS/target/version, etc.

ranweiler avatar Aug 25 '21 15:08 ranweiler

OS was android 11 aarch64. Target was a random app, but this is reproducible even on a stupid while true { println("here\n"); } executable.

s1341 avatar Aug 25 '21 17:08 s1341

@s1341, sorry for the holdup. I wanted to repro this bug before taking the change, but I'm unable to. I tried both x86-64 and aarch64 Linux, which makes me think it is Android-specific. To accept this change, I'd probably want to make it Android-conditional, which will be a first (for the internal event loop), and require building some testing infra on my side.

For the sake of easier tracking, could you please open an issue for what you're seeing? Also, I've hardly done any Android work, so I'll probably ask you for tips on the easiest way to set up an emulator environment that matches yours.

FYI, I tried to repro by using the basic example's binary and running it like:

./basic /usr/bin/sleep 30

Then, in another shell session, I ran:

kill -INT $(pgrep sleep)

And the output I get from the tracer is:

pid = 2247, pc = ffffa82a40c0: SyscallExit
pid = 2247, pc = ffffa81c2fe8: SignalDelivery { signal: SIGINT }
pid = 2247, pc = ffffa81c2fe8: Signaling { signal: SIGINT, core_dumped: false }

Which is what I'd expect. This is with the latest main branch.

ranweiler avatar Sep 06 '21 23:09 ranweiler