Bug #1341

SIGBUS clang

Added by namtsui 7 months ago. Updated 7 months ago.

Status:New% Done:


Target version:2.77
OS:*BSD Arch:


I am trying to write an OpenBSD port for etlegacy. It receive a SIGBUS when compiling with clang 8.0.0, without debug symbols. I am able to run the game successfully with gcc (debug/no debug) and clang (debug). Only clang without debug symbols exhibits this behavior.

my_configure_debug: make configure in OpenBSD ports with debug flags turned on
my_configure_reg: " with debug flags off
my_build_debug: make update-plist in OpenBSD ports with debug flags turned on
my_build_reg: " with debug flags off
my_log_debug: game startup with debug flags on (OK)
my_log_reg: game startup with debug flags off (fails)

I notice that when the game is starting without an ~/.etlegacy folder, it takes two or three restarts during normal operation. However, the regular clang build will go from
Initializing Legacy ui
directly to:
—– CL_Shutdown —–
as shown in my_log_reg.

I sprinkled in COM_Printf’s and saw that in client/cl_ui.c in CL_InitUI(void), the last call to

VM_Call(uivm, UI_INIT, (cls.state >= CA_AUTHORIZING x%x%x%x% cls.state < CA_ACTIVE), qtrue, ETLEGACY_VERSION_INT);

fails to get past this point.

in qcommon/vm.c:

intptr_t QDECL VM_CallFunc(vm_t *vm, int callNum, ...)

This call
r = vm->entryPoint(callNum, args[0], args[1], args[2], args[3],

fails to get past this point.

In sys/sys_main.c I printed out the signal in Sys_SigHandler(int signal) and noticed that it was 10, which is a SIGBUS.

my_build_debug (362 KB) namtsui, 27.08.2019 03:39

my_build_reg (363 KB) namtsui, 27.08.2019 03:40

my_configure_debug (5.32 KB) namtsui, 27.08.2019 03:40

my_configure_reg (5.32 KB) namtsui, 27.08.2019 03:40

my_log_debug (13.4 KB) namtsui, 27.08.2019 03:40

my_log_reg (6.26 KB) namtsui, 27.08.2019 03:40


#1 Updated by Spyhawk 7 months ago

  • Category set to General
  • Target version set to 2.77

#2 Updated by Spyhawk 7 months ago

The fact the issue appears in release only makes me believe this is closely related to our shameful 64bit issue. See #1211, #1089.

#3 Updated by RaFaL 7 months ago

Had similiar issue on Android port
This is how I solved it: https://github.com/etlegacy/etlegacy/commit/6fe7815339812e001aded92cef425da7ae992e18

After that I could run App and was inside Main Menu.

Also available in: Atom PDF