Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2012, 11:33 PM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default Segmentation Fault

I am new to Linux, and my server has a segmentation fault when I try to start it, which I've been researching so I sorta understand what it is and what's happened. But I am at a loss at things to try in order to get it fixed.

Here's the output if it helps:
Code:
eqemu@xxxxxxxx:~/server$ ./start
+ LNAME=zone
+ '[' '' = test ']'
+ P=/home/eqemu/server
+ export LD_LIBRARY_PATH=:/home/eqemu/server
+ LD_LIBRARY_PATH=:/home/eqemu/server
+ mkdir -p logs
+ '[' '!' -e .lock-zones -a '!' -e .lock-world ']'
+ for f in 'logs/eqemu_*.log'
+ '[' logs/eqemu_commands_zone.log = logs/eqemu_commands_zone.log ']'
+ continue
+ for f in 'logs/eqemu_*.log'
+ '[' logs/eqemu_debug_2134.log = logs/eqemu_commands_zone.log ']'
+ rm -f logs/eqemu_debug_2134.log
+ for f in 'logs/eqemu_*.log'
+ '[' logs/eqemu_debug_world.log = logs/eqemu_commands_zone.log ']'
+ rm -f logs/eqemu_debug_world.log
+ for f in 'logs/eqemu_*.log'
+ '[' logs/eqemu_world.log = logs/eqemu_commands_zone.log ']'
+ rm -f logs/eqemu_world.log
+ '[' '!' -e .lock-world ']'
+ touch .lock-world
+ '[' ']'
+ sleep 15
+ ./world
./start: line 60:  2157 Segmentation fault      ./world 2>&1 > logs/world
+ '[' '!' -e .lock-launcher ']'
+ touch .lock-launcher
+ '[' ']'
+ '[' ']'
+ ./eqlaunch zone
I'd appreciate any thoughts, ideas, or links to get me started figuring this out.
Reply With Quote
  #2  
Old 12-04-2012, 12:09 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

post the contents of your world log.
Reply With Quote
  #3  
Old 12-04-2012, 08:06 PM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default

logs/world:
Code:
[Debug] Starting Log: logs/eqemu_debug_world.log
[Debug] [WORLD__INIT] Loading server configuration..
[Debug] [COMMON__THREADS] Starting TCPServerLoop with thread ID -1223750800
[Debug] [COMMON__THREADS] Starting TCPServerLoop with thread ID -1232143504
[Debug] [WORLD__INIT] Log settings loaded from log.ini
[Debug] [WORLD__INIT] CURRENT_WORLD_VERSION:EQEmulator 0.8.0
[Debug] [WORLD__INIT] Added loginserver eqemulator.net:5998
[Debug] [WORLD__INIT] Connecting to MySQL...
[Status] Starting Log: logs/eqemu_world.log
[Status] Using database 'peq' at localhost:3306
[Debug] [WORLD__INIT] HTTP world service disabled.
[Debug] [WORLD__INIT] Loading variables..
[Debug] [COMMON__THREADS] Starting DBAsyncLoop with thread ID -1242563728
[Debug] [WORLD__INIT] Loading zones..
[Debug] [WORLD__INIT] Clearing groups..
[Debug] [WORLD__INIT] Clearing raids..
[Debug] [WORLD__INIT] Loading items..
[Status] libEMuShareMem.so loaded
[Status] Loading items from database: count=94982
Reply With Quote
  #4  
Old 12-04-2012, 08:42 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

If you have a core.xxxxx (xxxxx is numbers) file in the directory where world is then you can open it with gdb and get a trace of where the crash happened.

In that directory type gdb world core.xxxx, then type bt after it loads and post that stack trace.

If there is no core file then you can run world in gdb by navigating to the directory where it is, typing gdb world, then run once it starts. If it crashes type bt to get the stack trace.
Reply With Quote
  #5  
Old 12-04-2012, 09:09 PM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default

Wow, gdb, who knew. I had to go find it and install it, but now I've got it to use. Thanks!

There was not core file of any sort that you mentioned so I ran gdb world.
Code:
eqemu@xxxxxx:~/server$ gdb world
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/eqemu/server/world...done.
(gdb) run
Starting program: /home/eqemu/server/world
[Thread debugging using libthread_db enabled]
[New Thread 0xb7989b70 (LWP 2156)]
[New Thread 0xb7188b70 (LWP 2157)]
[Debug] Starting Log: logs/eqemu_debug_world.log
[Debug] [COMMON__THREADS] Starting TCPServerLoop with thread ID -1214735504
[Debug] [COMMON__THREADS] Starting TCPServerLoop with thread ID -1223128208
[Debug] [WORLD__INIT] Loading server configuration..
[Debug] [WORLD__INIT] Log settings loaded from log.ini
[Debug] [WORLD__INIT] CURRENT_WORLD_VERSION:EQEmulator 0.8.0
[Debug] [WORLD__INIT] Added loginserver eqemulator.net:5998
[Debug] [WORLD__INIT] Connecting to MySQL...
[Status] Starting Log: logs/eqemu_world.log
[Status] Using database 'peq' at localhost:3306
[New Thread 0xb6987b70 (LWP 2158)]
[Debug] [WORLD__INIT] HTTP world service disabled.
[Debug] [WORLD__INIT] Loading variables..
[Debug] [COMMON__THREADS] Starting DBAsyncLoop with thread ID -1231520912
[Debug] [WORLD__INIT] Loading zones..
[Debug] [WORLD__INIT] Clearing groups..
[Debug] [WORLD__INIT] Clearing raids..
[Debug] [WORLD__INIT] Loading items..
[Status] libEMuShareMem.so loaded
[Status] Loading items from database: count=94982

Program received signal SIGSEGV, Segmentation fault.
0xb7a2f8dc in ?? () from /lib/i686/cmov/libc.so.6
(gdb) bt
#0  0xb7a2f8dc in ?? () from /lib/i686/cmov/libc.so.6
#1  0xb7a2f640 in strtol () from /lib/i686/cmov/libc.so.6
#2  0x080e2b9f in atoi (this=0x81ec240, iItemCount=94982, iMaxItemID=154102) at /usr/include/stdlib.h:286
#3  SharedDatabase::DBLoadItems (this=0x81ec240, iItemCount=94982, iMaxItemID=154102) at ../common/shareddb.cpp:950
#4  0x080e3af7 in SharedDatabase::extDBLoadItems (iItemCount=94982, iMaxItemID=154102) at ../common/shareddb.cpp:787
#5  0xb617abac in DLLLoadItems (cbDBLoadItems=0x80e3ad6 <SharedDatabase::extDBLoadItems(int, unsigned int)>, iItemStructSize=1016, iItemCount=0xbffff2bc,
    iMaxItemID=0x81ec66c) at Items.cpp:117
#6  0x080e17ac in SharedDatabase::LoadItems (this=0x81ec240) at ../common/shareddb.cpp:799
#7  0x0809a9b8 in main (argc=1, argv=0xbffff8e4) at net.cpp:291
(gdb)
Reply With Quote
  #6  
Old 12-04-2012, 11:19 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

Ok, there's something wrong with your items database. If I had to guess I'd say one of the columns is NULL where it is using atoi to extract a number from a string.

Run it under gdb again and let it crash.
Type up until the SharedDatabase::DBLoadItems frame is selected.
Type list and hopefully it will show you the line in the source code where it crashed so you can tell what column it is.
You might be able to figure out exactly which item it is by typing print item, print item.Name, or print item.ID. That's assuming that those were parsed successfully before the crash happened.

It's been a while since I used gdb every day, so I might be a little fuzzy on the commands, but hopefully this will help you narrow it down a bit.
Reply With Quote
  #7  
Old 12-04-2012, 11:36 PM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default

Thanks very much, this was very helpful.

I am still building this server, so I just re-sourced the whole db since it only takes a few minutes, and that fixed it.

I have never experienced a Segmentation Fault before and I was worried that the OS had broken or possibly a hardware problem. But it was just the db, no problem.

Thanks again.
Reply With Quote
  #8  
Old 12-05-2012, 07:03 PM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default

Quote:
Originally Posted by revloc02c View Post
Wow, gdb, who knew. I had to go find it and install it, but now I've got it to use. Thanks!
I just realized that I did something here that really bugs me, I accomplished something in the background without explaining how I did it. This is not very helpful for future reference if someone else reads this. So to clear that up here's how I installed gdb on a Debian Linux box:
Code:
apt-get install gdb
Super simple, and easy enough to Google, but it is the principle of it that matters.
Reply With Quote
  #9  
Old 12-05-2012, 10:11 PM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default

Ok, so I got this same problem again, another Segmentation Fault. So I dived into gdb some more like you said lerxst and sure enough you were right.

In game I have a SQL sproc that adds an item to the db and I didn't do some of the columns right and they were coming out NULL, and it was trying to atoi one of those columns.

Thanks for the help, I would have never tracked that bug down without you.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:45 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3