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

Fix segfaults in NDK instrumentation tests #1321

Merged
merged 7 commits into from
Jul 15, 2021

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Jul 14, 2021

Goal

Fixes segfaults in the NDK instrumentation tests and runs them automatically on CI.

Changeset

  • Adds the NDK instrumentation tests to CI so that they automatically run
  • Replaced malloc with calloc so that tests always use consistent data that has been wiped to 0
  • Inlined the generate_basic_report function. This was resulting in unpredictable segfaults when running the migration tests as test code was attempting to fit old structs into bugsnag_event
  • Split test cases into smaller test suites to make debugging which has failed easier

Additionally, tests such as BreadcrumbStateSerializationTest which verify the native layer serializes JSON correctly have been altered. The C layer is now only responsible for serializing the JSON, and passes the result to the JUnit test. This makes the result easier to identify, and circumvents segfaults which were happening in the test assertions.

@fractalwrench fractalwrench marked this pull request as ready for review July 14, 2021 16:54
Base automatically changed from PLAT-7000/prefer-calloc-to-malloc to next July 15, 2021 09:21
@fractalwrench fractalwrench merged commit 62f2fb3 into next Jul 15, 2021
@fractalwrench fractalwrench deleted the PLAT-7000/fix-ndk-test-crash branch July 15, 2021 09:47
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