Skip to content

[SUREFIRE-3459] Allow opting out of StackWalker stack capture - #3493

Merged
olamy merged 1 commit into
apache:masterfrom
goutamadwant:surefire-3459-stackwalker-fallback
Oct 3, 2026
Merged

olamy merged 1 commit into
apache:masterfrom
goutamadwant:surefire-3459-stackwalker-fallback

Conversation

@goutamadwant

@goutamadwant goutamadwant commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Surefire 3.6.0 uses StackWalker for stack capture on Java 9+. Issue #3459 reports that three RocksDB FFM callback test classes terminate their forked JVMs on Windows x64 with JDK 25. The downstream workaround sets stackTraceMaxFrames to 0, which also removes stack capture.

This change adds the JVM property surefire.stackTrace.disableStackWalker=true to select the existing Thread.getStackTrace() path while retaining stack capture. StackWalker remains the default. For forked tests, the property can be appended to argLine; the documentation includes an example. Regression tests cover the default and opt-out paths.

Related to #3459.

Validation

Contribution checklist

  • The commit has a meaningful subject and body.
  • This description explains the change and its purpose.
  • mvn clean install passed.
  • mvn -Prun-its clean install passed.
  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004.
  • If required, I have filed an Apache Individual Contributor License Agreement.

Use the existing Thread.getStackTrace fallback when the test JVM sets surefire.stackTrace.disableStackWalker=true. Keep stack capture enabled and StackWalker as the default, including when a security manager denies property access. Document the argLine setting and cover both capture paths.

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
@olamy

olamy commented Oct 3, 2026

Copy link
Copy Markdown
Member

sure we can add some workaround but the root cause seems to be a JDK bug though

@olamy
olamy merged commit 18bed35 into apache:master Oct 3, 2026
15 checks passed
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

@olamy Please assign appropriate label to PR according to the type of change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3.6.0 regression: forked JVM silently vanishes on Windows for tests using FFM upcalls from background threads

2 participants