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

BlockHound integration #1821

Merged
merged 15 commits into from
Mar 16, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve handling of stacktrace tests on JDK 8
Before, the tests only knew that the `park` native method was moved
to `jdk.internal.misc.Unsafe` from `sun.misc.Unsafe`. However, in
JDK 11, there is no `sun.misc.Unsafe` at all, it seems that it
has been moved completely.

This change is beneficial for this feature set because BlockHound
puts its `$$BlockHound$$_park` method to `sun.misc.Unsafe` or to
`jdk.internal.misc.Unsafe` depending on the JDK version. Also,
judging by BlockHound's code
https://github.com/reactor/BlockHound/blob/091d7b139479b1c41eea59baa23389d673fdf73b/agent/src/main/java/reactor/blockhound/BlockHound.java#L177-L187,
`forkAndExec` had been moved, too, but it is not used in tests.
  • Loading branch information
dkhalanskyjb committed Mar 13, 2020
commit 5058081623ee3c087fe31a5cbe76b14df462f34d
2 changes: 1 addition & 1 deletion kotlinx-coroutines-debug/test/StracktraceUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public fun String.trimStackTrace(): String =
.replace(Regex("#[0-9]+"), "")
.replace(Regex("(?<=\tat )[^\n]*/"), "")
.replace(Regex("\t"), "")
.replace("sun.misc.Unsafe.park", "jdk.internal.misc.Unsafe.park") // JDK8->JDK11
.replace("sun.misc.Unsafe.", "jdk.internal.misc.Unsafe.") // JDK8->JDK11
.applyBackspace()

public fun String.applyBackspace(): String {
Expand Down