Serious-Engine icon indicating copy to clipboard operation
Serious-Engine copied to clipboard

undefined symbol "_nss_cache_cycle_prevention_function" on FreeBSD 13

Open PaddyMac opened this issue 3 years ago • 1 comments

It's been a while since I've used your source port, but I figured I'd break it out again. I've successfully built and run it on FreeBSD before, but maybe something has changed in the latest FreeBSD 13-RELEASE. I'm currently trying TFE, and I can start the program with no trouble. But when I choose the option to start a new game and choose my difficulty level, I get the following error at the top of the screen:

network is off CUnixDynamicLoader error: Undefine symbol "_nss_cache_cycle_prevention_function" Cannot load DLL file '/usr/home/patrick/Serious-Engine/Bin/libEntities.so': Undefined symbol "_nss_cache_cycle_prevention_function"

If I try to start a new game a second time, the program crashes with a segfault. Though now that I look a little closer, the undefined reference error might be a red herring. Yes it's an error, but it might not be causing the segfault. I ran the game through gdb, and this is what caused the segfault:

Thread 1 received signal SIGSEGV, Segmentation fault. CFogMarker::GetFog (this=0x0, fpFog=...) at /usr/home/patrick/Serious-Engine/Sources/Entities/FogMarker.es:64 64 fpFog.fp_vFogDir(1) = m(1,2);

PaddyMac avatar Apr 17 '21 03:04 PaddyMac

I'm eventually hitting the same SIGSEGV on OpenBSD 6.9-current as well, compiled with clang 10.0.1.

It appears that clang is optimizing out some very important NULL pointer checks in the entity class files. I'm not familiar enough with C++ to figure out why this is happening, but it certainly is alarming. I was able to solve this with the -fno-delete-null-pointer-checks flag, but this should be looked at.

+ add_compile_options(-fno-delete-null-pointer-checks)

brynet avatar Apr 20 '21 04:04 brynet