diff options
Diffstat (limited to 'linux/arch.c')
-rw-r--r-- | linux/arch.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/linux/arch.c b/linux/arch.c index cda074f1..d3fd0cc3 100644 --- a/linux/arch.c +++ b/linux/arch.c @@ -62,8 +62,10 @@ static __thread jmp_buf env; HF_ATTR_NO_SANITIZE_ADDRESS HF_ATTR_NO_SANITIZE_MEMORY -__attribute__((noreturn)) static int arch_cloneFunc(void* arg HF_ATTR_UNUSED) { +static int arch_cloneFunc(void* arg HF_ATTR_UNUSED) { longjmp(env, 1); + abort(); + return 0; } /* Avoid problem with caching of PID/TID in glibc */ @@ -205,7 +207,6 @@ void arch_prepareParentAfterFork(run_t* run) { } } - arch_perfClose(run); if (!arch_perfOpen(run)) { LOG_F("Couldn't open perf event for pid=%d", (int)run->pid); } @@ -298,6 +299,9 @@ void arch_reapChild(run_t* run) { } } + if (run->pid == 0) { + arch_perfClose(run); + } arch_perfAnalyze(run); } |