#include <stdio.h>
#include <stdlib.h>
void cleanup1(void) {
printf("cleanup1 \n");
}
int main(void) {
printf("main in \n");
atexit(cleanup1);
return 0;
}
diff --git a/src/tools/cleanup.c b/src/tools/cleanup.c
index 79ac34518..cf0518ccb 100644
--- a/src/tools/cleanup.c
+++ b/src/tools/cleanup.c
@@ -28,8 +28,11 @@ void AddCleanup(x64emu_t *emu, void *p)
void AddCleanup1Arg(x64emu_t *emu, void *p, void* a, elfheader_t* h)
{
(void)emu;
- if(!h)
+ if (!h) {
+ printf_log(LOG_DEBUG, "%s:%d p=%p a=%p\n", __func__, __LINE__, p, a);
+ AddCleanup(emu, p);
return;
+ }
if(h->clean_sz == h->clean_cap) {
h->clean_cap += 32;
Hi,
Testcase failed to handle atexit to be called at normal process termination: debug.log
Reduced Testcase:
Actual:
Expected:
debug patch:
debug.log
Thanks,
Leslie Zhai