View previous topic :: View next topic |
Author |
Message |
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Aug 09, 2013 11:11 Post subject: SegFault on ExploreArea? |
|
|
Quote: |
Program terminated with signal 11, Segmentation fault.
#0 0x080d9352 in CNWSArea::ExploreArea(CNWSCreature *, int, int, int) ()
(gdb) Program terminated with signal 11, Segmentation fault.
|
Im still pretty new to linux/ubuntu - so maybe im doing the debugging wrong.
My Server has been Seg Faulting quite alot, not sure whats triggering it.
So - I enabled core dumps, and I used gdb to backtrace into it to find the failure.
(Am I doing it right?)
Does anyone know what could be causing this error? |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Aug 09, 2013 11:27 Post subject: |
|
|
Quote: |
(gdb) where
#0 0x080d9352 in CNWSArea::ExploreArea(CNWSCreature *, int, int, int) ()
#1 0x08119f43 in CNWSCreature::UpdateAutoMap(unsigned long) ()
#2 0x081190fb in CNWSCreature::AddToArea(CNWSArea *, float, float, float, int)
()
#3 0x080a1cc5 in CServerExoAppInternal::MovePlayerToArea(void *) ()
#4 0x08197707 in CNWSMessage::HandlePlayerToServerAreaMessage(CNWSPlayer *, unsigned char) ()
#5 0x0819695a in CNWSMessage::HandlePlayerToServerMessage(unsigned long, unsigned char *, unsigned long) ()
#6 0xb7337eaa in CNWSMessage__HandlePlayerToServerMessage_Hook(CNWSMessage*, int, char*, int) () from ./nwnx_connect.so
#7 0x0809e01a in CServerExoAppInternal::HandleMessage(unsigned long, unsigned char *, unsigned long, int) ()
#8 0x082a0888 in CNetLayerInternal::UncompressMessage(unsigned long, unsigned char *, unsigned long) ()
#9 0x0829f2d5 in CNetLayerWindow::UnpacketizeFullMessages(int) ()
#10 0x082a07c3 in CNetLayerInternal::ProcessReceivedFrames(int) ()
#11 0x080a04f4 in CServerExoAppInternal::MainLoop(void) ()
#12 0xb715138e in CServerExoApp__MainLoop_hook(void*) ()
from ./nwnx_optimizations.so
#13 0x0804bbe7 in main ()
|
The where command in gdb gives me this - I guess I know now that its nwnx_optimizations.
@virusman - are you still working on optimizations? If so - hope this helps?
Based on info from my players, it sounds like the crash may be associated with interactions with the nwnx_areas plugin.
The areas in question, that were being explored, were areas that had been generated by the areas plugin. |
|
Back to top |
|
|
axs
Joined: 11 Feb 2005 Posts: 76
|
Posted: Fri Aug 09, 2013 14:50 Post subject: |
|
|
Yes, I've mentioned in another topic that nwnx_areas isn't stable.
Some time ago I've made some tests and it's seems that map pin memory isn't reallocated when pc was before on module but is not in time when you load new area, also area count field in player object isn't changed.
So when player enters again and server is trying to access his map pin memory for new area, segfault occur.
I've made some approach to fix this, but wasn't successful. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Aug 09, 2013 15:56 Post subject: |
|
|
Did yours also crash in nwnx_optimizations though?
I'm hoping by removing nwnx_optimizations that it will remove or at least aleveate the crashing.
The crash dump puts nwnx optimizations as the origin of the crash.
Im hoping it gets resolved by this move - as my module is a heavy user of nwnx areas, and I just moved from Windows to Linux out of necessity - (nwnx chat and some others dont want to work on EC2 Servers) |
|
Back to top |
|
|
axs
Joined: 11 Feb 2005 Posts: 76
|
Posted: Fri Aug 09, 2013 16:19 Post subject: |
|
|
optimizations hooks main loop, so it will always show up on bt.
nwnx_connect is also present because of hook in CServerExoAppInternal::HandleMessage
Crash is related with 0x490 offset of CNWSCreature, which is pointer to minimap data.
Code: | 080d9326: esi = *( *(CNWSCreature + 0x490) + *(ebp - 0x3c) * 4);
080d9329: do {
080d9330: if(*(edi + ebx) != 0) {
080d9334: eax = edi;
080d9336: if(edi < 0) {
080d9338: eax = edi + 7;
}
080d933d: edx = eax >> 3;
080d9340: eax = edx * 8;
080d9349: ecx = edi - eax;
080d9350: eax = 1 << cl;
CRASH --> 080d9352: *(edx + esi) = *(edx + esi) | al;
}
080d9355: edi = edi + 1;
} while(edi < *(ebp - 0x40)); |
|
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Aug 09, 2013 17:54 Post subject: |
|
|
Hey VirusMan - any chance you could have a look at the code for nwnx areas and suggest a solution? |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Sat Aug 10, 2013 12:26 Post subject: |
|
|
Sorry, I don't have much free time lately.. It'll probably be like this until mid-September.
But if you can create a test module that can be used to easily reproduce this, I may be able to fix the bug. _________________ In Soviet Russia, NWN plays you! |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Mon Aug 12, 2013 3:31 Post subject: |
|
|
Not sure of the steps to reproduce it on command- Maybe Axs knows the steps?
In any case- I managed to get a dump of the registers from a crash that happened today:
I don't know if this helps much?
(gdb) info all-registers
eax 0x80 128
ecx 0x7 7
edx 0x0 0
ebx 0x2c5d2d88 744304008
esp 0xbff2c780 0xbff2c780
ebp 0xbff2c7c8 0xbff2c7c8
esi 0xe9 233
edi 0x7 7
eip 0x80d9352 0x80d9352 <CNWSArea::ExploreArea(CNWSCreature *, int, int, int)+234>
eflags 0x10202 [ IF RF ]
cs 0x73 115
ss 0x7b 123
ds 0x7b 123
es 0x7b 123
fs 0x0 0
gs 0x33 51
st0 0.168103002943098545074462890625 (raw 0x3ffcac23319000000000)
st1 -0.7071067896014166971607739498040246 (raw 0xbffeb504f3581e1d7f40)
st2 80.7152099609375 (raw 0x4005a16e300000000000)
st3 -18.0357208251953125 (raw 0xc0039049280000000000)
st4 10 (raw 0x4002a000000000000000)
st5 5 (raw 0x4001a000000000000000)
st6 10 (raw 0x4002a000000000000000)
st7 0 (raw 0x00000000000000000000)
fctrl 0x37f 895
fstat 0x2f 47
ftag 0xffff 65535
fiseg 0x73 115
fioff 0x80d8306 135103238 |
|
Back to top |
|
|
leo_x
Joined: 25 Aug 2010 Posts: 75
|
Posted: Sun Feb 09, 2014 21:01 Post subject: |
|
|
DELETED. _________________ the awakening (PW Action)
Last edited by leo_x on Sat Feb 22, 2014 19:08; edited 1 time in total |
|
Back to top |
|
|
leo_x
Joined: 25 Aug 2010 Posts: 75
|
Posted: Sat Feb 22, 2014 19:07 Post subject: |
|
|
I'm still getting segfaults in DropTURD and also the names of areas don't show when hovering over a character in the party bar...
So... forget what I said. I'm going to delay my plans for this.
Has anyone used this or the windows version on a production server? _________________ the awakening (PW Action) |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Wed Mar 05, 2014 16:57 Post subject: |
|
|
I use the nwnx_areas from Maxrocks branch on my production server.
its very stable.
It originally had a bug where if you log in before the area is generated, and then enter the area, that the area would be pitch black.
Its now resolved in Maxrocks version.
I have occasionally seen the issue with Area names not showing when hovering over players in the party, but its not a game breaker.
So far no crashes on windows (been using it for maybe a year or so) |
|
Back to top |
|
|
|