Bug #1211

Segfault on client linux x64 at startup (master branch)

Added by Ododo 9 months ago. Updated 22 days ago.

Status:New% Done:

0%

Priority:NormalSpent time:-
Assignee:-
Category:Client
Target version:2.78
OS:Linux Arch:64-bit

Description


Starting program: /home/olivier/etlegacy/etl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
ET Legacy v2.76-139-g1abf64a5 linux-x86_64 Feb 25 2019
Zone megs: 64
Info: fs_game now defaults to 'legacy' mod instead of 'etmain'
----- FS_Startup -----
Current search path:
    /home/olivier/.etlegacy/legacy
    ./legacy
    ./legacy/pak3_v2.76_dirty.pk3 (1122 files)
    ./legacy/etl_bin_v2.76_dirty.pk3 (2 files)
    /home/olivier/.etlegacy/etmain
    ./etmain
    ./etmain/pak2.pk3 (22 files)
    ./etmain/pak1.pk3 (10 files)
    ./etmain/pak0.pk3 (3725 files)

----------------------
4881 files in pk3 files
SQLite3 libversion 3.26.0 - database URI 'etl.db' - in file
... loading existing database '/home/olivier/.etlegacy/etl.db'
... database file '/home/olivier/.etlegacy/etl.db' loaded
SQLite3 ETL: DB init #2/home/olivier/.etlegacy/etl.db in [0] ms - autocommit 1
SQLite3 ETL: DB schema version #2 is up to date!
Warning: etl_pakmeta.txt was not found.
execing default.cfg
couldn't exec autoexec.cfg
Hunk_Clear: reset the hunk ok
Not logging server attacks to disk.
----- Client Initialization -----
----- Initializing Renderer ----
Trying to load "librenderer_opengl1_x86_64.so" from "/home/olivier/etlegacy"...
-------------------------------
ETKEY found.
Available client translations: Bulgarian Czech German Greek English Esperanto Spanish Finnish French Hungarian Italian Korean Dutch Norwegian Polish Portuguese Romanian Russian Slovak Slovenian Serbian Swedish Turkish
Available mod translations: Bulgarian Czech German Greek English Esperanto Spanish Finnish French Hungarian Italian Korean Dutch Norwegian Polish Portuguese Romanian Russian Slovak Slovenian Serbian Swedish Turkish
Language set to English
----- Client Initialization Complete -----
----- R_Init -----
SDL build version 2.0.9 - link version 2.0.9.
SDL initialized driver "x11" 
Initializing OpenGL display
Estimated display aspect: 1.781
...setting mode -2: 1368x768
Using 24 color bits, 24 depth, 0 stencil display.
Available modes [22]: '684x384 1368x768 432x243 480x270 512x288 640x360 800x450 864x486 960x540 1024x576 1280x720 1600x900 640x400 1280x800 700x450 1400x900 320x240 400x300 512x384 640x480 800x600 1024x768'
Using GLEW 2.1.0
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce 610M/PCIe/SSE2
GL_VERSION: 4.6.0 NVIDIA 390.87
Using vanilla renderer
Initializing OpenGL extensions
...found OpenGL extension - GL_EXT_texture_compression_s3tc
...found OpenGL extension - GL_EXT_texture_env_add
...found OpenGL extension - GL_ARB_multitexture
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce 610M/PCIe/SSE2
GL_VERSION: 4.6.0 NVIDIA 390.87
GL_MAX_TEXTURE_SIZE: 16384
GL_MAX_ACTIVE_TEXTURES_ARB: 4
PIXELFORMAT: color(24-bits) Z(24-bit) stencil(0-bits)
MODE: -2, SCREEN: 1368 x 768 fullscreen (ratio 1.7812) Hz:N/A
GAMMA: hardware w/ 0 overbright bits
rendering primitives: single glDrawElements
texturemode: GL_LINEAR_MIPMAP_NEAREST
picmip: 1
texture bits: 0
multitexture: enabled
compiled vertex arrays: enabled
texenv add: enabled
compressed textures: enabled
Initializing Shaders
----- finished R_Init -----
------ Initializing Sound (1)------
SDL_Init( SDL_INIT_AUDIO )... [New Thread 0x7fffd380d700 (LWP 22078)]
OK
SDL audio driver is "pulseaudio".
[New Thread 0x7fffd37cc700 (LWP 22079)]
SDL_AudioSpec:
  Format:   AUDIO_S16LSB
  Freq:     44100
  Samples:  1024
  Channels: 2
  Silence:  0
  Size:     4096
Starting SDL audio callback...
SDL audio initialized.
----- Sound Info -----
sound system is muted
    2 channels
32768 samples
   16 samplebits
    1 submission_chunk
44100 speed
0x5555583dd500 dma buffer
No background file.
----------------------
Sound initialization successfully done
s_backend set to SDL2
--------------------------------
Sound memory manager started
Sys_LoadGameDll -> FS_CL_ExtractFromPakFile(/home/olivier/.etlegacy, legacy, ui.mp.x86_64.so)
Sys_LoadDll(/home/olivier/.etlegacy/legacy/ui.mp.x86_64.so)... succeeded
Sys_LoadDll(legacy/ui) found vmMain function at 0x7fffd2bd0b30
Initializing Legacy ui v2.76-139-g1abf64a5
150 UI cvars in use.

Thread 1 "etl" received signal SIGSEGV, Segmentation fault

(gdb) bt
#0  0x00005555555d6665 in PC_Directive_define.part.7 ()
#1  0x00005555555d6da1 in PC_DefineFromString ()
#2  0x00005555555d6eb9 in PC_AddGlobalDefine ()
#3  0x00005555555fc189 in CL_UISystemCalls ()
#4  0x00005555555cec43 in VM_DllSyscall ()
#5  0x00007fffd2bea4a4 in ?? () from /home/olivier/.etlegacy/legacy/ui.mp.x86_64.so
#6  0x00007fffd2bce494 in ?? () from /home/olivier/.etlegacy/legacy/ui.mp.x86_64.so
#7  0x00007fffd2bd056a in ?? () from /home/olivier/.etlegacy/legacy/ui.mp.x86_64.so
#8  0x00007fffd2bd0bc9 in vmMain () from /home/olivier/.etlegacy/legacy/ui.mp.x86_64.so
#9  0x00005555555cfb6b in VM_CallFunc ()
#10 0x00005555555a5f39 in Com_Init ()
#11 0x0000555555591de6 in main ()

Associated revisions

Revision 6dbde6c4
Added by ryven 22 days ago

general: fix engine crash on 64bit systems, refs #1351 #1211 #1089

Engine was crashing on startup on 64 bit systems on Release builds.

It was happening due to SSE optimizations taking place, yielded by the
compiler on default settings (ETLegacy does not specify any optimization
flags by default). Most specifically the "movaps" instruction was failing
because it could not null several structure fields (in token_t) at once,
because it could not operate properly on Z_Malloc’ed memory block, as the
instruction requires a 16 byte boundary alignments, where Z_Malloc only does
4/8 byte paddings (depending on the system). The token_t alignment was 16 byte
due to the usage of "long double" type on "floatvalue" field, which is
extraordinarily big, even though on the 32bit systems it still occupies
12bytes, the struct alignment stays within 4 bytes, because the type is
non-atomic. The token_t "floatvalue" and "intvalue" now matching the
"pc_token_t" field types, as this makes more sense, since "pc_token_t" is the
structure used to receive "token_t" values on the mod side.

  • fixed botlib token_t alignment, was breaking sse optimization (causing
    the crash)
  • shut some botlib warnings

History

#1 Updated by IR4T4 9 months ago

This is issue is system dependant and was one of the reasons why our last release was delayed. See #1089

Which distribution is this?

#2 Updated by Ododo 9 months ago

IR4T4 wrote:

This is issue is system dependant and was one of the reasons why our last release was delayed. See #1089

Which distribution is this?

This was on ArchLinux

Linux 4.19.15-rt12-1-rt #1 SMP PREEMPT RT Mon Feb 18 15:51:39 CET 2019 x86_64 GNU/Linux

EDIT: gcc –version
gcc (GCC) 8.2.1 2018112

#3 Updated by Spyhawk 9 months ago

Arch Linux is affected by the issue (even when set up as a strictly minimal system). So far, only some systems work when etl is build in a container. See #1089.

#4 Updated by Ododo 9 months ago

Guess for that precise segault (not related to other 64bit build issue):

the asm instruction that segfault is movaps
movaps usually segfault on alignment issues
Occurs after GetMemory that uses Z_TagMalloc which is architecture dependant.

Maybe something has changed in common.c ?

#5 Updated by Spyhawk 9 months ago

  • Target version set to 2.77

#6 Updated by Spyhawk 7 months ago

  • Target version changed from 2.77 to 2.78

#7 Updated by ryven 22 days ago

Hey Ododo, could you please recheck latest master, my commit should have fixed the issue, would be great to hear any confirmations from you.

Also available in: Atom PDF