PDA

View Full Version : Strange zone crash in fedora 8( (double free)


Dakaar
09-22-2005, 05:06 PM
**UPDATE** my zone will launch if i remove spells_us.txt is removed.. Its definately crashing loading the file, or not properly unloading(or unloading twice).. Can someone help me figure out exactly what path the code takes going through and loading spells_us.txt? ***

**more update =P** Apparently this is something new to fc3 where it has a MALLOC_CHECK variable, see below
Now with the MALLOC_CHECK i just segfault on loading spells_us.txt
Im running a proper spells_us.txt so somewhere for me, something is not being accessed correctly
>From the Fedora Core 3 release notes:

glibc
The version of glibc provided with Fedora Core 3 performs
additional internal sanity checks to prevent and detect data
corruption as early as possible. By default, should corruption
be detected, a message similar to the following will be displayed
on standard error (or logged via syslog if stderr is not open):

*** glibc detected *** double free or corruption: 0x0937d008 ***

By default, the program that generated this error will also be
killed; however, this (and whether or not an error message is
generated) can be controlled via the MALLOC_CHECK_ environment
variable. The following settings are supported:

0 -- Do not generate an error message, and do not kill the program
1 -- Generate an error message, but do not kill the program
2 -- Do not generate an error message, but kill the program
3 -- Generate an error message and kill the program

Note

If MALLOC_CHECK_ is explicitly set a value other than 0, this
causes glibc to perform more tests that are more extensive than
the default, and may impact performance.

Should you have a program from a third party ISV that triggers
these corruption checks and displays a message, you should
file a defect report with the application's vendor, since this
indicates a serious bug.


[Status] Starting Log: logs/eqemu_zone.log
[Status] Using database 'eqemu' at localhost
[Status] CURRENT_ZONE_VERSION: EQEMu 0.6.2-DR1
[Status] Loading opcodes..
[Status] Mapping Opcodes
[Status] Loading Variables
[Status] Loading zone names
[Status] Loading items
[Status] libEMuShareMem.so loaded
[Status] Loading items from database: count=46073
[Status] Loading npcs
[Status] Loading npc faction lists
[Status] libEMuShareMem.so loaded
[Status] Loading NPC Faction Lists from database...
[Status] Loading loot tables
[Status] Loading Loot tables from database...
[Status] Loading doors
[Status] libEMuShareMem.so loaded
[Status] Loading Doors from database...
[Status] libEMuShareMem.so loaded
[Status] FileLoadSPDat() Loading spells from ./spells_us.txt
*** glibc detected *** double free or corruption (out): 0x091d08f8 ***
Aborted


Is there something in Doors.cpp that does not properly close up its connection or in spells that doesnt open it properly? What is different at all?

hey all. Im running almost the newest CVS (past the corpse update like 9/20ish) and my world works fine, ive compiled my binaries with gcc33 and I can get my zone to load up untill this point.


At this point cleanipcs does not properly get rid of
:------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x49038011 1409024 deadpeople600 23621072 0
0x5a038011 1441793 deadpeople600 18249721 0
0x46038011 1474562 deadpeople600 3872484 0
0x4c038011 1507331 deadpeople600 1323919 0
0x44038011 1540100 deadpeople600 593610 0
0x53038011 1572869 deadpeople600 7462132 0


I have to manually kill these.

Also when i ran my start script that loads 15 zones, it basically brought hte server to a halt indefinately because i presume of all the unattached sos floating around


edit: added kernel info
Linux version 2.6.12-1.1372_FC3 (bhcompile@tweety.build.redhat.com) (gcc version 3.4.3 20050227 (Red Hat 3.4.3-22)) #1 Fri Jul 15 00:59:10 EDT 2005


After changing database.cpp line 2902 i was able to compile with 3.3, 4.0 and 3.4, will any of them work is another question..

Dakaar
09-22-2005, 10:15 PM
It should be worth noting that this bug as pasted from another thread around 2004 is still in the current CVS




EDIT: An additonal tip for getting this compiled with gcc-3.4: in common/EQNetwork.cpp, on line 73, change
Code:
HI_LOSWAPlong (type x) to
Code:
HI_LOSWAPlong (type a)


it references type x but x is not used in the function, a is.

fathernitwit
09-23-2005, 04:59 PM
eqnetwork.cpp is no longer used.

Dakaar
09-24-2005, 10:14 AM
=( I just did a fresh virgin cvs pull and still the same error. Im gonna try refreshing my spells_en and spells_us.txt is there anything special i need to do when moving them from win to linux? they have the exact same filesize so i doubt it


I have the most success(ie no changes necessary just plugging in the right mysql paths in makefile) with this version of gcc

[deadpeople@serv1 ~]$ gcc33 --v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.4/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit --enable-languages=c,c++,objc,java,f77 --host=i386-redhat-linux
Thread model: posix
gcc version 3.3.4 20040817 (Red Hat Linux 3.3.4-2)

i changed the makefile ld and compiler to 'gcc33' so it should be fine.

I get no warnings in stock cvs.

if i run a ./zone . localhost 7999 localhost i get that error
World gives NO errors and runs properly

Dakaar
09-24-2005, 10:54 AM
Here are my warnings from zone compile when using 3.3.4

../common/EQStreamFactory.cpp: In member function `void
EQStreamFactory::ReaderLoop()':
../common/EQStreamFactory.cpp:163: warning: long unsigned int format, unsigned
int arg (arg 3)
../common/EQStreamFactory.cpp:134: warning: unused variable `time_t now'
attack.cpp: In member function `virtual void Client::Death(Mob*, int, short
unsigned int, unsigned char)':
attack.cpp:1250: warning: comparison between signed and unsigned integer
expressions
worldserver.cpp: In member function `int32 WorldServer::NextGroupID()':
worldserver.cpp:1220: warning: long unsigned int format, int32 arg (arg 2)
../common/crc32.cpp:105:2: warning: #warning "Comment out i386 define if your a rch isn't x86"
embperl.cpp: In constructor `Embperl::Embperl()':
embperl.cpp:99: warning: deprecated conversion from string constant to `char*'
embperl.cpp:99: warning: deprecated conversion from string constant to `char*'
embperl.cpp:99: warning: deprecated conversion from string constant to `char*'
embperl.cpp: In member function `void Embperl::dosub(const char*, const
std::vector<std::string, std::allocator<std::string> >*, int)':
embperl.cpp:268: warning: unused variable `PerlInterpreter*my_perl'
embperl.cpp:286: warning: unused variable `PerlInterpreter*my_perl'
../common/misc.cpp: In function `std::string generate_key(int)':
../common/misc.cpp:604: warning: deprecated conversion from string constant to
`char*'
command.cpp: In function `void command_opcode(Client*, const Seperator*)':
command.cpp:6010: warning: unsigned int format, different type arg (arg 3)
perl_entity.cpp: In function `void
XS_EntityList_RemoveNumbers(PerlInterpreter*, CV*)':
perl_entity.cpp:1207: warning: unused variable `char*CLASS'
pathing.cpp: In member function `bool PathManager::loadPaths(FILE*)':
pathing.cpp:124: warning: long unsigned int format, uint32 arg (arg 2)
pathing.cpp:124: warning: long unsigned int format, int arg (arg 3)
pathing.cpp:128: warning: long unsigned int format, uint32 arg (arg 2)
pathing.cpp:128: warning: long unsigned int format, uint32 arg (arg 3)
pathing.cpp:128: warning: long unsigned int format, uint32 arg (arg 5)
pathing.cpp:143: warning: long unsigned int format, uint32 arg (arg 2)
pathing.cpp:147: warning: long unsigned int format, uint32 arg (arg 2)
pathing.cpp:152: warning: long unsigned int format, uint32 arg (arg 2)
pathing.cpp:156: warning: long unsigned int format, uint32 arg (arg 2)
pathing.cpp:160: warning: long unsigned int format, unsigned int arg (arg 2)
pathing.cpp: In member function `void
Client::SendPathPacket(std::vector<FindPerson_Point,
std::allocator<FindPerson_Point> >&)':
pathing.cpp:880: warning: comparison between signed and unsigned integer
expressions
perl_perlpacket.cpp: In function `void XS_PerlPacket_new(PerlInterpreter*, CV*)
':
perl_perlpacket.cpp:48: warning: deprecated conversion from string constant to
`char*'
perl_perlpacket.cpp:42: warning: unused variable `char*CLASS'



EMuShareMem Compile warnings:
MMF.cpp: In member function `bool MMF::Open(const char*, unsigned int)':
MMF.cpp:213: warning: comparison between signed and unsigned integer
expressions
Loot.cpp: In function `bool pDLLLoadLoot(bool (*)(), unsigned int, unsigned
int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int,
unsigned int, unsigned int, unsigned int)':
Loot.cpp:193: warning: cast from `const uint8*' to `int32*' discards qualifiers
from pointer target type
Loot.cpp:194: warning: cast from `const uint8*' to `int32*' discards qualifiers
from pointer target type
Loot.cpp: In function `const LootTable_Struct* pGetLootTable(unsigned int)':
Loot.cpp:203: warning: cast from `const uint8*' to `LootTable_Struct*' discards
qualifiers from pointer target type
Loot.cpp: In function `const LootDrop_Struct* pGetLootDrop(unsigned int)':
Loot.cpp:211: warning: cast from `const uint8*' to `LootDrop_Struct*' discards
qualifiers from pointer target type











My *Successful load* without spells_us


[Status] Starting Log: logs/eqemu_zone.log
[Status] Using database 'eqemu' at localhost
[Status] CURRENT_ZONE_VERSION: EQEMu 0.6.2-DR1
Bad port specified
[deadpeople@serv1 eqemu]$ ./zone . localhost 7995 localhost
[Status] Starting Log: logs/eqemu_zone.log
[Status] Using database 'eqemu' at localhost
[Status] CURRENT_ZONE_VERSION: EQEMu 0.6.2-DR1
[Status] Loading opcodes..
[Status] Mapping Opcodes
[Status] Loading Variables
[Status] Loading zone names
[Status] Loading items
[Status] libEMuShareMem.so loaded
[Status] Loading npcs
[Status] Loading npc faction lists
[Status] libEMuShareMem.so loaded
[Status] Loading NPC Faction Lists from database...
[Status] Loading loot tables
[Status] Loading Loot tables from database...
[Status] Loading doors
[Status] libEMuShareMem.so loaded
[Status] Loading Doors from database...
[Error] Starting Log: logs/eqemu_error_zone.log
[Error] File './spells_us.txt' not found in same directory as zone.exe, spell loading FAILED!
[Debug] Starting Log: logs/eqemu_debug_zone.log
[Debug] LoadSPDat() MaxSpellID == -1, ./spells_us.txt missing?
[Status] Loading guilds
[Status] Loading guild list
[Status] libEMuShareMem.so loaded
[Status] Loading factions
[Status] Loading titles
[Status] Loading AA effects
[Status] Loading swarm spells
[Status] Loading tributes
[Status] Loading corpse timers
[Status] Loading what ever is left
[Status] Loading commands
~~(skipping addon.ini to keep under char limit)
[Status] 183 commands loaded
[Status] Loading embedded perl XS
[Debug] Warning: Perl dosub called for my_eval when perl is allready in use.

[Quest] Starting Log: logs/eqemu_quest_zone.log
[Quest] Loading perlemb plugins.
[Quest] Loading perl commands...
[Debug] Warning: Perl dosub called for my_eval when perl is allready in use.

[Quest] Loading perlemb plugins.
[Quest] Loading perl commands...
[Status] Starting EQ Network server.
[Status] Entering sleep mode
Connected to worldserver: localhost:9000

Dakaar
09-25-2005, 02:21 AM
Fixed, when passing arguments to Seperator(which does not properly deconstruct right etc otherwise) change the values to 202,2000 for arguments and arglen instead of 100,200

wize_one
09-25-2005, 04:58 AM
even get this error on gentoo..8( what file-files did you edit and what to fix this?

johane
09-25-2005, 11:54 AM
even get this error on gentoo..8( what file-files did you edit and what to fix this?

I also get this error on my Debian sarge (kernel 2.6.8) system. Can you please let us know exactly what and where you fixed this?