Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tasks.withType<JavaExec> {
jvmArgs("--add-opens", "java.base/java.io=ALL-UNNAMED")
jvmArgs("--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED")
jvmArgs("--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED")
jvmArgs("-Dfray.recordSchedule=true")
// jvmArgs("-Dfray.recordSchedule=true")
doFirst {
// Printing the full command
println("Executing command: ${executable} ${jvmArgs!!.joinToString(" ")} -cp ${classpath.asPath} ${mainClass.get()} ${args!!.joinToString(" ")}")
Expand Down
8 changes: 7 additions & 1 deletion core/src/main/kotlin/org/pastalab/fray/core/RunContext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.pastalab.fray.core.concurrency.locks.ReferencedContextManager
import org.pastalab.fray.core.concurrency.locks.SemaphoreManager
import org.pastalab.fray.core.concurrency.operations.*
import org.pastalab.fray.instrumentation.base.memory.VolatileManager
import org.pastalab.fray.runtime.LivenessException

@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
class RunContext(val config: Configuration) {
Expand Down Expand Up @@ -64,6 +65,10 @@ class RunContext(val config: Configuration) {
}

fun reportError(e: Throwable) {
if (e is LivenessException) {
// Let's do not report liveness exceptions.
return
}
if (bugFound == null && !config.executionInfo.ignoreUnhandledExceptions) {
bugFound = e
val sw = StringWriter()
Expand All @@ -89,6 +94,7 @@ class RunContext(val config: Configuration) {
config.frayLogger.error(
"Error found, the recording is saved to ${config.report}/recording_0/")
println("Error found, you may find the error report in ${config.report}")
config.frayLogger.error("Error found with step: $step")
config.saveToReportFolder(0)
}
exitProcess(0)
Expand Down Expand Up @@ -963,7 +969,7 @@ class RunContext(val config: Configuration) {
Thread.currentThread() !is HelperThread &&
!(mainExiting && currentThreadId == mainThreadId)) {
currentThread.state = ThreadState.Running
val e = org.pastalab.fray.runtime.LivenessException()
val e = LivenessException()
reportError(e)
throw e
}
Expand Down