Skip to content

Avoid segfault when executing tests with JDK < 11.0.4#1272

Merged
felixbarny merged 1 commit intoelastic:masterfrom
felixbarny:avoid-stackwalker-segfault
Jul 17, 2020
Merged

Avoid segfault when executing tests with JDK < 11.0.4#1272
felixbarny merged 1 commit intoelastic:masterfrom
felixbarny:avoid-stackwalker-segfault

Conversation

@felixbarny
Copy link
Member

@felixbarny felixbarny commented Jul 6, 2020

What does this PR do?

#1230 required us to update to the latest JDK in order to avoid crashes when executing tests.

I've investigated a little more. While I can't say which parts of the PR triggered the segfault, I can rule out a few options:

  • Adding invokedynamic instructions
  • Usage of PostProcessor/@AssignTo

The segfault even triggers when only the testLegacyDefaultDisabledInstrumentation test is active in InstrumentationTest and when using @Advice.Return(readOnly = false) instead of @AssignTo.Return.

As described in the JDK tracker https://bugs.openjdk.java.net/browse/JDK-8210457, the issue occurs when there's a retransformation happening concurrently to the StackWalker traversing the stack.

The workaround is to only create the logger once.

Checklist

  • This is an enhancement of existing features, or a new feature in existing plugins
    • I have updated CHANGELOG.asciidoc
    • I have added tests that prove my fix is effective or that my feature works
    • Added an API method or config option? Document in which version this will be introduced
    • I have made corresponding changes to the documentation
  • This is a bugfix
  • This is a new plugin
    • I have updated CHANGELOG.asciidoc
    • My code follows the style guidelines of this project
    • I have made corresponding changes to the documentation
    • I have added tests that prove my fix is effective or that my feature works
    • New and existing unit tests pass locally with my changes
    • I have updated CHANGELOG.asciidoc
    • I have updated supported-technologies.asciidoc
    • Added an API method or config option? Document in which version this will be introduced
    • Added an instrumentation plugin? Describe how you made sure that old, non-supported versions are not instrumented by accident.
  • This is something else

@ghost
Copy link

ghost commented Jul 6, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Branch indexing]

  • Start Time: 2020-07-16T11:39:09.545+0000

  • Duration: 41 min 26 sec

Test stats 🧪

Test Results
Failed 0
Passed 1459
Skipped 11
Total 1470

@felixbarny felixbarny merged commit 9546511 into elastic:master Jul 17, 2020
@felixbarny felixbarny deleted the avoid-stackwalker-segfault branch July 17, 2020 09:12
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.

1 participant