Skip to content

Commit

Permalink
Added BOX86_NOCRASHHANDLER to ignore crashhandler.so (for #1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Nov 9, 2024
1 parent 4caece4 commit 1e749be
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ Disables the load of vulkan libraries.
* 0 : Load vulkan libraries if found.
* 1 : Disables the load of vulkan libraries, both the native and the i386 version (can be useful on Pi4, where the vulkan driver is not quite there yet.)

#### BOX86_NOCRASHHANDLER *
Diables crashhandler.so
* 0 : Regular process for crashhandler.so (Default)
* 1 : Do not load crashhandler.so, even if present

#### BOX86_FUTEX_WAITV *
Use of the new fuext_waitc syscall
* 0 : Do not try to use it, return unsupported (Default for BAD_SIGNAL build)
Expand Down
1 change: 1 addition & 0 deletions src/include/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ extern int box86_musl;
extern int box86_nopulse; // disabling the use of wrapped pulseaudio
extern int box86_nogtk; // disabling the use of wrapped gtk
extern int box86_novulkan; // disabling the use of wrapped vulkan
extern int box86_nocrashhandler;
extern int box86_futex_waitv;
extern int box86_mapclean;
extern int box86_showsegv;
Expand Down
9 changes: 9 additions & 0 deletions src/librarian/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,15 @@ library_t *NewLibrary(const char* path, box86context_t* context, elfheader_t* ve
return NULL;
}
}
if(box86_nocrashhandler) {
if(strstr(lib->name, "crashhandler.so")==lib->name) {
box_free(lib->name);
box_free(lib->path);
initDummyLib(lib);
//box_free(lib);
return NULL;
}
}
int notwrapped = FindInCollection(lib->name, &context->box86_emulated_libs);
int essential = isEssentialLib(lib->name);
if(!notwrapped && box86_prefer_emulated && !essential)
Expand Down
10 changes: 10 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ int box86_musl = 0;
int box86_nopulse = 0;
int box86_nogtk = 0;
int box86_novulkan = 0;
int box86_nocrashhandler = 0;
#ifdef BAD_SIGNAL
int box86_futex_waitv = 0;
#else
Expand Down Expand Up @@ -573,6 +574,15 @@ void LoadLogEnv()
if(!box86_libcef)
printf_log(LOG_INFO, "Dynarec will not detect libcef\n");
}
p = getenv("BOX86_NOCRASHHANDLER");
if(p) {
if(strlen(p)==1) {
if(p[0]>='0' && p[0]<='1')
box86_nocrashhandler = p[0]-'0';
}
if(box86_nocrashhandler)
printf_log(LOG_INFO, "Box86 will consider crashhnadler.so to not be present\n");
}
p = getenv("BOX86_SDL2_JGUID");
if(p) {
if(strlen(p)==1) {
Expand Down
1 change: 1 addition & 0 deletions src/tools/rcfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ ENTRYSTRING_(BOX86_BOX64, box64) \
ENTRYSTRING_(BOX86_LD_PRELOAD, ld_preload) \
ENTRYBOOL(BOX86_NOSANDBOX, box86_nosandbox) \
ENTRYBOOL(BOX86_LIBCEF, box86_libcef) \
ENTRYBOOL(BOX86_NOCRASHHANDLER, box86_nocrashhandler) \
ENTRYBOOL(BOX86_SDL2_JGUID, box86_sdl2_jguid) \
ENTRYBOOL(BOX86_MUTEX_ALIGNED, box86_mutex_aligned) \
ENTRYINT(BOX86_MALLOC_HACK, box86_malloc_hack, 0, 2, 2) \
Expand Down
1 change: 1 addition & 0 deletions system/box86.box86rc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ BOX86_NOGTK=1
BOX86_DYNAREC_STRONGMEM=1
BOX86_X11COLOR16=1
BOX86_DYNAREC_CALLRET=0 #it seems to be unstable in some cases, so disabling (for #920)
#BOX86_NOCRASHHANDLER=1

[streaming_client]
BOX86_EMULATED_LIBS=libSDL2-2.0.so.0:libSDL2_ttf-2.0.so.0
Expand Down

0 comments on commit 1e749be

Please sign in to comment.