Bug #751

Segmentation fault with other mods

Added by Spyhawk over 4 years ago. Updated almost 3 years ago.

Status:Confirmed% Done:

20%

Priority:LowSpent time:-
Assignee:-
Category:General
Target version:ALL
OS:Linux Arch:

Description

I’ve been unable to run a listen server with etpub/nq/nitmod with latest etl (jaymod/silent/legacy are fine).

It seems the game crash at soon as the listen server is started.

Backtrace when launching etpub:

Program received signal SIGSEGV, Segmentation fault.
0x080abae4 in Cvar_Register (vmCvar=0xf6f41b80 <g_log>, varName=0xd4ec9056 "g_log", defaultValue=0xd4ec8ccb "", flags=1)
    at /home/remy/dev/etlegacy/src/qcommon/cvar.c:1511
1511            vmCvar->handle            = cv - cvar_indexes;
(gdb) backtrace
#0  0x080abae4 in Cvar_Register (vmCvar=0xf6f41b80 <g_log>, varName=0xd4ec9056 "g_log", defaultValue=0xd4ec8ccb "", flags=1)
    at /home/remy/dev/etlegacy/src/qcommon/cvar.c:1511
#1  0x080c3ad3 in SV_GameSystemCalls (args=0xffffb454) at /home/remy/dev/etlegacy/src/server/sv_game.c:409
#2  0x08092d06 in VM_DllSyscall (arg=3) at /home/remy/dev/etlegacy/src/qcommon/vm.c:317
#3  0xd4e6b9b1 in trap_Cvar_Register () from /home/remy/.etlegacy/etpub/qagame.mp.i386.so
#4  0x00000003 in ?? ()
#5  0xf6f41b80 in ?? () from /usr/lib32/libglib-2.0.so.0
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) quit

Related issues

Related to ET: Legacy Development - Bug #1241: Rename &g_log internal variable. New 01.04.2019

History

#1 Updated by Spyhawk over 4 years ago

  • Description updated (diff)

#2 Updated by Jacker over 4 years ago

just ran etpub on windows (latest master) and worked without any issues. Possibly linux only?

#3 Updated by IR4T4 over 4 years ago

Seems memory related - other cvars were registered before ... there is no special in var g_log.
I’ve just realized this tiny difference in the count of cvars:

gamename: etpub
gamedate: Jun 28 2010
412 cvars in use.
gamename: legacy
gamedate: Dec 31 2014
190 cvars in use.

#4 Updated by Spyhawk over 4 years ago

  • Priority changed from Normal to Low
  • Target version changed from 2.72 to 2.78

I actually cannot reproduce with the official static 2.71a, but I can reproduce it when compiling 2.71a by myself.
The issue is thus on my end, maybe related to Arch or dynamic linking.

#5 Updated by Spyhawk over 4 years ago

  • Description updated (diff)

#6 Updated by IR4T4 over 4 years ago

  • Target version changed from 2.78 to 2.74

#7 Updated by IR4T4 over 4 years ago

  • OS set to Linux

#8 Updated by Spyhawk over 4 years ago

People running Arch Linux + nVidia don’t have issue afaik.
This issue appears with Intel gfx card, and from my research is most probably due to the mesa 10.4 update that happened in late December. I can still reproduce it.

#9 Updated by IR4T4 over 4 years ago

  • Category set to General

#10 Updated by Spyhawk over 4 years ago

  • Description updated (diff)

#11 Updated by Spyhawk over 4 years ago

The issue isn’t due to Mesa 10.4, but to Freetype 2.5.5 when linked dynamically. The 2.5.5 update occurred on 2014-12-30 upstream and 2015-01-01 on my machine.

Setting BUNDLED_LIBS=1 and BUNDLED_FREETYPE=1 solves the issue. Both static and dynamic versions are 2.5.5 - this is strictly a dynamic compilation issue.
I also checked that the few extra Arch patches aren’t responsible for this issue (same issue with recompiled vanilla freetype).

Edit: According to Ensi:

< Ensiform> #751 is probably related to https://github.com/ioquake/ioq3/commit/de1840a23a1d1ec0a92e6317c197da53d47503fe
but of course this is not something you could fix without fixing etpub or other mods (this commit itself is
broken as it changes the cvar string names themselves though)
< Ensiform> see https://github.com/ioquake/ioq3/commit/4eb569b706ff03a6a6225409d16b9726bab1f19d / https://github.com/ioquake/ioq3/commit/b5074539ae797f94378b0bca086cd8a39461a302
essentially change the cvar variables but not the config names

This is most probably related, but doesn’t explain why Legacy runs with the same "bug" in the qgame code and isn’t something we can fix for other mods either.

#12 Updated by Spyhawk over 4 years ago

  • Description updated (diff)
  • % Done changed from 0 to 20

#13 Updated by Saukko over 4 years ago

  • Subject changed from segmentation fault with other mods to Segmentation fault with other mods

#14 Updated by Spyhawk over 4 years ago

  • Status changed from New to Confirmed

#15 Updated by gaoesa over 4 years ago

Changing variable names is of course not a proper fix to a bug that shouldn’t exist. On the part of the mod library files, this and future name clashes can be avoided by setting the default visibility to hidden in GCC (-fvisibility=hidden) and using:

#if __GNUC__ >= 4
#pragma GCC visibility push(default)
#endif
...
#if __GNUC__ >= 4
#pragma GCC visibility pop
#endif

around the vmMain functions. Maybe there was another function that needed this too, but I don’t remember. That resolves it in regards to the mod, but not if the libraries start clashing against each others. Of course, running strip is also good for the binaries.

#16 Updated by IR4T4 about 4 years ago

  • Status changed from Confirmed to Feedback

#17 Updated by Spyhawk about 4 years ago

  • Status changed from Feedback to Confirmed
  • Target version changed from 2.74 to 2.78

Can’t seem to solve this issue. This is minor anyway, official binaries are statically compiled anyway.

#18 Updated by IR4T4 almost 3 years ago

  • Target version changed from 2.78 to ALL

#19 Updated by Spyhawk 5 months ago

  • Related to Bug #1241: Rename &g_log internal variable. added

Also available in: Atom PDF