Skip to content

Commit

Permalink
fix StackOverflowError when processing JLookupStmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nkbai committed Jan 12, 2024
1 parent cf5831c commit bc6a8ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ class TaintPathModeHtmlWriter(
if (gotoTgtLabelMap.containsKey(stmt)) {
+"${gotoTgtLabelMap[stmt]}:\n"
}
+"$index: $stmt\n"
try {
+"$index: $stmt\n"
} catch (ex: StackOverflowError) {
+"$index: StackOverflowError: ${stmt.javaClass.canonicalName}"
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/net/bytedance/security/app/util/TaskQueue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ val oomHandler = CoroutineExceptionHandler { ctx, exception ->
Log.logErr("${coroutineName} CoroutineException because of oom")
exitProcess(37)
}
if (exception is StackOverflowError) {
val coroutineName = ctx[CoroutineName]?.name
Log.logErr("${coroutineName} CoroutineException because of oom")
exitProcess(38)
}
throw exception
}

Expand Down

0 comments on commit bc6a8ae

Please sign in to comment.