logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
NWNX_Events Segfault on Quickchat

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
Seph K



Joined: 09 Jul 2013
Posts: 6

PostPosted: Tue Jul 09, 2013 6:20    Post subject: NWNX_Events Segfault on Quickchat Reply with quote

Hi everyone, new to these forums. I ran into an issue with the current llinux version of nwnx_events, whenever a character uses a particular emote/quickchat, either from pressing v, etc on the keyboard or through the subradial menu, the server crashes. Not all emotes cause a crash, but the ones that do will always cause a crash. The one I first noticed was the "greet" emote.

My first thought was that I had screwed something up when compiling, so I recompiled > Segfault. Then I downloaded the lastest build from Elven's stickied post of nwnx_events.so > segfault. So then I just started trying all of the builds of nwnx_events and found that all builds after #118 (May 08, 2013) have this problem, at least on my end. The May 08 Build, and any build before then works fine and does not segfault.

P.S. I tried to do a backtrace when the first segfault happened, but as I am new to linux, and had never done it before, I was extremely unsuccessful.
Back to top
View user's profile Send private message
elven



Joined: 28 Jul 2006
Posts: 259
Location: Germany

PostPosted: Tue Jul 09, 2013 11:34    Post subject: Reply with quote

Build 118 was debian squeeze, build 120 is debian wheezy, which pulled in a new version of gcc and appendages.

I've also been seeing reliable crashes with SCO/RCO in odbc when using the new compiler. I think they've 'optimised' asm generation somehow, but I didn't investigate. I'd suggest using build #118 until this crap is fixed .. sorry for the mess.
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Tue Jul 09, 2013 11:46    Post subject: Reply with quote

Thanks for taking the time to narrow down the cause!
Apparently, NWNX has major issues with GCC >=4.6. Try to avoid GCC 4.6 or 4.7 until we've tested everything. Last known working version is GCC 4.4.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
eeriegeek



Joined: 07 Jan 2008
Posts: 59

PostPosted: Tue Jul 09, 2013 14:36    Post subject: Reply with quote

I haven't looked into this recently, but based on the debugging I was doing last year, I think the gcc folks may have changed the generated function call stack frame exit code. I think that (possibley) rewritting the hooks from embedded assembly (relying on the gcc stack handling) to pure assembly (with the old exit syntax) MAY solve at least some of the issues with new gcc versions.
Back to top
View user's profile Send private message
leo_x



Joined: 25 Aug 2010
Posts: 75

PostPosted: Tue Jul 09, 2013 17:40    Post subject: Reply with quote

I've been using NWNX built with gcc4.7 for awhile on my test server. The machinery in nx_hook definitely still works fine, so does d_redirect style (at least in the case of nwnx_optimizations). So, while I have no clue what's causing the issue (and even re-implemented part of nwnx_events because of it), it seems particular to only some plugins.
_________________
the awakening (PW Action)
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Tue Jul 09, 2013 18:43    Post subject: Reply with quote

I think it only applies to the older plugins that heavily use assembly in their hook code. Recent plugins rely on C declarations and should be working fine.
ODBC, Events, Chat, Profiler, Resman may be affected.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Jul 10, 2013 0:55    Post subject: Reply with quote

I've just pushed a change to the git repo. Please try recompiling from the latest revision.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Seph K



Joined: 09 Jul 2013
Posts: 6

PostPosted: Mon Jul 15, 2013 19:36    Post subject: Reply with quote

now it doesn't want to compile, says error 2 in defenses>funcs/GetAcByType, or something along those lines.
Back to top
View user's profile Send private message
Seph K



Joined: 09 Jul 2013
Posts: 6

PostPosted: Tue Jul 16, 2013 5:46    Post subject: Reply with quote

Sorry was in a hurry earlier, here's more info:

Code:
make[1]: Entering directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/defenses'
gcc -mtune=i386 -pipe -g -O2 -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o funcs/f_GetACByType.o funcs/f_GetACByType.c
funcs/f_GetACByType.c:1:0: error: unwind tables currently require either a frame pointer or -maccumulate-outgoing-args for correctness [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [funcs/f_GetACByType.o] Error 1
make[1]: Leaving directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/defenses'
make: *** [plugins/defenses] Error 2
Back to top
View user's profile Send private message
Seph K



Joined: 09 Jul 2013
Posts: 6

PostPosted: Tue Jul 16, 2013 6:47    Post subject: Reply with quote

By selectively editing makefiles and adding -maccumulate-outgoing-args to the individual plugins I got additional errors sequentially:

Code:
make[1]: Entering directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/funcs'
gcc -mtune=i386 -pipe -g -O2 -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o funcs/ability/f_GetAbilityIncreaseByLevel.o funcs/ability/f_GetAbilityIncreaseByLevel.c
funcs/ability/f_GetAbilityIncreaseByLevel.c:1:0: error: unwind tables currently require either a frame pointer or -maccumulate-outgoing-args for correctness [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [funcs/ability/f_GetAbilityIncreaseByLevel.o] Error 1
make[1]: Leaving directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/funcs'
make: *** [plugins/funcs] Error 2


Code:
make[1]: Entering directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/spells'
gcc -mtune=i386 -pipe -g -O2 -mno-accumulate-outgoing-args -Wall -Werror -Wno-error=unused-but-set-variable -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -mno-accumulate-outgoing-args -Wall -Werror -Wno-error=unused-but-set-variable -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o funcs/f_GetSpellOption.o funcs/f_GetSpellOption.c
funcs/f_GetSpellOption.c:1:0: error: unwind tables currently require either a frame pointer or -maccumulate-outgoing-args for correctness [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [funcs/f_GetSpellOption.o] Error 1
make[1]: Leaving directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/spells'
make: *** [plugins/spells] Error 2

Code:

make[1]: Entering directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/structs'
gcc -mtune=i386 -pipe -g -O2 -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o funcs/f_GetCreator.o funcs/f_GetCreator.c
funcs/f_GetCreator.c:1:0: error: unwind tables currently require either a frame pointer or -maccumulate-outgoing-args for correctness [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [funcs/f_GetCreator.o] Error 1
make[1]: Leaving directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/structs'
make: *** [plugins/structs] Error 2


Code:
make[1]: Entering directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/system'
gcc -mtune=i386 -pipe -g -O2 -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o funcs/f_DirList.o funcs/f_DirList.c
funcs/f_DirList.c:1:0: error: unwind tables currently require either a frame pointer or -maccumulate-outgoing-args for correctness [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [funcs/f_DirList.o] Error 1
make[1]: Leaving directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/system'
make: *** [plugins/system] Error 2


Code:
make[1]: Entering directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/tweaks'
gcc -mtune=i386 -pipe -g -O2 -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o funcs/f_GetTweakOption.o funcs/f_GetTweakOption.c
funcs/f_GetTweakOption.c:1:0: error: unwind tables currently require either a frame pointer or -maccumulate-outgoing-args for correctness [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [funcs/f_GetTweakOption.o] Error 1
make[1]: Leaving directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/tweaks'
make: *** [plugins/tweaks] Error 2


Code:
make[1]: Entering directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/weapons'
gcc -mtune=i386 -pipe -g -O2 -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -mno-accumulate-outgoing-args -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o common/c_GetIsUnarmedWeapon.o common/c_GetIsUnarmedWeapon.c
common/c_GetIsUnarmedWeapon.c:1:0: error: unwind tables currently require either a frame pointer or -maccumulate-outgoing-args for correctness [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [common/c_GetIsUnarmedWeapon.o] Error 1
make[1]: Leaving directory `/home/kjhitt/Games/nwnx2-linux-master/plugins/weapons'
make: *** [plugins/weapons] Error 2


So while I don't know what an unwind table is or why it is a problem, I think that the problem with defenses is also a problem in funcs, spells, structs, system, tweaks, and weapons.

Mad
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Tue Jul 16, 2013 9:34    Post subject: Reply with quote

Hmm, try to add -fno-omit-frame-pointer to the flags.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Tue Jul 16, 2013 13:21    Post subject: Reply with quote

What's your OS and GCC version? I can't reproduce the problem on Debian Wheezy. Everything compiles fine.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Seph K



Joined: 09 Jul 2013
Posts: 6

PostPosted: Tue Jul 16, 2013 17:30    Post subject: Reply with quote

I tried compiling on fedora 18 with GCC 4.7.2-8, then I also tried on Xubuntu 12.04.2 with GCC 4.6.3-1ubuntu5
Back to top
View user's profile Send private message
Seph K



Joined: 09 Jul 2013
Posts: 6

PostPosted: Tue Jul 16, 2013 17:45    Post subject: Reply with quote

The -fno-omit-frame-pointer option seems to keep the compiler happy. Very Happy
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Tue Jul 16, 2013 19:51    Post subject: Reply with quote

I've disabled optimization for autoconf/make compile path. cmake didn't pass -O2, so it should be working anyway.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group