about summary refs log tree commit diff stats
path: root/src/libtools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-04-04 10:19:47 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-04-04 10:19:47 +0200
commit29f65bb6beff6457db6f00315c1395f944ec93ed (patch)
tree814655902322d3ef9b614bf9267bd9fcc0bcdf97 /src/libtools
parentcce929341312896c0e03ee0380d14aa3cc473964 (diff)
downloadbox64-29f65bb6beff6457db6f00315c1395f944ec93ed.tar.gz
box64-29f65bb6beff6457db6f00315c1395f944ec93ed.zip
More work on mmap and the MAP_32BIT flag
Diffstat (limited to 'src/libtools')
-rwxr-xr-xsrc/libtools/signals.c4
-rwxr-xr-xsrc/libtools/threads.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/libtools/signals.c b/src/libtools/signals.c
index eb533b0d..d6014c19 100755
--- a/src/libtools/signals.c
+++ b/src/libtools/signals.c
@@ -700,8 +700,8 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
     void * pc = NULL;    // unknow arch...
     #warning Unhandled architecture
 #endif
-#ifdef DYNAREC
     uint32_t prot = getProtection((uintptr_t)addr);
+#ifdef DYNAREC
     dynablock_t* db = NULL;
     int db_searched = 0;
     if ((sig==SIGSEGV) && (addr) && (info->si_code == SEGV_ACCERR) && (prot&PROT_DYNAREC)) {
@@ -834,6 +834,8 @@ exit(-1);
         else
             printf_log(log_minimum, "\n");
     }
+    if(sig==SIGSEGV && info->si_code==2 && ((prot&~PROT_CUSTOM)==5 || (prot&~PROT_CUSTOM)==7))
+        return; // that's probably just a multi-task glitch, like seen in terraria
     if(my_context->signals[sig] && my_context->signals[sig]!=1) {
         if(my_context->is_sigaction[sig])
             my_sigactionhandler_oldcode(sig, info, ucntx, &old_code, db);
diff --git a/src/libtools/threads.c b/src/libtools/threads.c
index ed37ca2c..567fb76f 100755
--- a/src/libtools/threads.c
+++ b/src/libtools/threads.c
@@ -306,7 +306,7 @@ EXPORT int my_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_rou
 	et->fnc = (uintptr_t)start_routine;
 	et->arg = arg;
 	#ifdef DYNAREC
-	if(box64_dynarec) {
+	if(0 && box64_dynarec) {	// disable for now
 		// pre-creation of the JIT code for the entry point of the thread
 		dynablock_t *current = NULL;
 		DBGetBlock(emu, (uintptr_t)start_routine, 1, &current);