Segfault due to malformed data in database

Bug #375191 reported by ameyp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cyphesis
Fix Released
Undecided
Unassigned

Bug Description

After running fine a couple of times, Cyphesis segfaults immediately upon launching.

gdb output:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb767b6d0 (LWP 20056)]
Location::readFromMessage (this=0x34, msg=@0xbf835ae8)
   at /usr/local/include/wfmath-0.3/wfmath/atlasconv.h:128
128 array[i] = _asNum(list[i]);
(gdb) bt
#0 Location::readFromMessage (this=0x34, msg=@0xbf835ae8)
   at /usr/local/include/wfmath-0.3/wfmath/atlasconv.h:128
#1 0x0807dc82 in StorageManager::restoreChildren (this=0xbf835bd4,
parent=0x821b4f8)
   at StorageManager.cpp:292
#2 0x0807e553 in StorageManager::restoreWorld (this=0xbf835bd4) at
StorageManager.cpp:396
#3 0x080b7ffe in main (argc=2, argv=0x82df908) at server.cpp:219

The problem goes away on running 'cydb world purge'

Revision history for this message
Al Riddoch (alriddoch) wrote :

Did you load any data into the world using cyclient each time you ran cyphesis?

Are you able to make a database dump of your cyphesis database immediately after the crash? If so can you attach it to this bug.

Revision history for this message
ameyp (ameyp) wrote : Re: [Bug 375191] Re: Segfault due to malformed data in database

I ran cyclient without any arguments every time I started the server.
Cyphesis isn't crashing right now, so I'll attach a dump as soon as it
crashes again

Revision history for this message
Alexey Torkhov (atorkhov) wrote :

Backtrace I got after running it with old database left from 0.5.19:

(gdb) bt
#0 0x00000000004b485c in _ArrayFromAtlas () at /usr/include/wfmath-0.3/wfmath/atlasconv.h:128
#1 WFMath::Point<3>::fromAtlas () at /usr/include/wfmath-0.3/wfmath/atlasconv.h:203
#2 Location::readFromMessage (this=0x68, msg=@0x7fff3fccf680) at ../../modules/Location.cpp:116
#3 0x000000000042e597 in StorageManager::restoreChildren (this=0x7fff3fccf7d0, parent=0x1279cc0)
    at ../../server/StorageManager.cpp:292
#4 0x000000000042edb4 in StorageManager::restoreWorld (this=0x1364898) at ../../server/StorageManager.cpp:396
#5 0x0000000000459922 in main (argc=<value optimized out>, argv=<value optimized out>) at ../../server/server.cpp:219

Revision history for this message
Al Riddoch (alriddoch) wrote :

It looks a lot like the same backtrace as Amey got, but without optimisation turned on.

Amey, you may want to keep in mind that building your code without optimisation makes backtraces much more useful, and debugging easier without really affecting the performance of simple test servers at all.

Revision history for this message
ameyp (ameyp) wrote :

Ok, getting this bug again. Backtrace:

#0 0x0811a816 in Location::readFromMessage (this=0x34, msg=@0xbfcc18a4)
    at /usr/local/include/wfmath-0.3/wfmath/atlasconv.h:128
#1 0x0808e9f1 in StorageManager::restoreChildren (this=0xbfcc1cf8,
    parent=0x89d73c8) at StorageManager.cpp:292
#2 0x0808ed4f in StorageManager::restoreChildren (this=0xbfcc1cf8,
    parent=0x86a61f8) at StorageManager.cpp:303
#3 0x0808f283 in StorageManager::restoreWorld (this=0xbfcc1cf8)
    at StorageManager.cpp:396
#4 0x080bb1f5 in main (argc=Cannot access memory at address 0xc
) at server.cpp:219

Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

Hasn't been seen in six years, so marking as fixed.

Changed in cyphesis:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.