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

Eating/ignoring SIGTRAP? #3888

Open
Manouchehri opened this issue Dec 3, 2024 · 1 comment
Open

Eating/ignoring SIGTRAP? #3888

Manouchehri opened this issue Dec 3, 2024 · 1 comment

Comments

@Manouchehri
Copy link
Contributor

I could have sworn there used to be a way to have rr record eat/ignore/handle SIGTRAPs from the target program, so that they wouldn't be sent to the target application's handler.

I tried --ignore-signal=5 and --continue-through-signal=SIGTRAP, but neither seems to stop my target from halting itself. =(

@rocallahan
Copy link
Collaborator

rocallahan commented Dec 14, 2024

Works for me.

#include <unistd.h>
#include <signal.h>
#include <stdio.h>

static volatile int did_run = 0;

static void handle(int sig) {
  did_run = 1;
}

int main(int argc, char** argv)
{
  signal(SIGTRAP, handle);
  kill(getpid(), SIGTRAP);
  printf("did_run = %d\n", did_run);
  return 0;
}

and

$ gcc -o ~/tmp/test ~/tmp/test.c && rr record --ignore-signal=5 ~/tmp/test
rr: Saving execution to trace directory `/home/roc/.local/share/rr/test-1'.
did_run = 0

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

No branches or pull requests

2 participants