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

Extend integration tests for coredump, backtrace #1317

Closed
jrcheli opened this issue Feb 6, 2023 · 1 comment
Closed

Extend integration tests for coredump, backtrace #1317

jrcheli opened this issue Feb 6, 2023 · 1 comment
Assignees

Comments

@jrcheli
Copy link
Contributor

jrcheli commented Feb 6, 2023

Extending the work in #1307...

Verify that an application's signal handlers are still called after appscope is done handling them.
The signals of interest are the abnormal termination ones appscope registers for:
SIGILL
SIGBUS
SIGFPE
SIGSEGV

The two scenarios of interest are when:

  1. the appscope library is preloaded and
  2. the appscope attaches to a running process.
@jrcheli
Copy link
Contributor Author

jrcheli commented Feb 14, 2023

When this new integration test was created, we saw three issues which we're resolving in this issue:

  1. On aarch64 specifically, the new SIGILL tests were failing (we were not calling the test app's SIGILL handler as we expected). This turned out to be due to our own crypto library. On aarch64, it registered SIGILL, issued a set of opcodes to determine which type of arm processor we're running on, then restored the original SIGILL. This aarch64 code is in contribl/openssl/crypto/armcap.c in a function called OPENSSL_cpuid_setup(). To resolve the failing tests, we added a function transportInit() and called it from our constructor so OPENSSL_init_ssl() is run before our own enableSnapshot() function.
  2. We had failing tests for SIGUSR2. (We were not calling the test apps's SIGUSR2 handler as we expected). This was due to our early return when we processed SIGUSR2 in sigaction().
  3. The last step of our new test app was to sleep or nanosleep so our bash scope-test script has time to attach/send test signals to the test app. While debugging the issues above, we observed that when we attached, it was causing our test app to return before the sleep or nanosleep should have expired. To resolve this issue, in the constructor of libscope.so, we call threadNow(0) if we're attaching, otherwise we call threadInit(). In this way we've stopped setting an alarm when we attach.

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

No branches or pull requests

2 participants