PDA

View Full Version : Segmentation fault with Raspian (Debian)


Wisteso
10-12-2015, 02:44 PM
So I thought I'd see if I would be able to get EQEmu running on a Raspberry Pi (Model B+ currently, with Pi 2 in the mail).

Was able to get everything to compile (using this guide (http://wiki.eqemulator.org/p?EQEmu_on_Debian_7_Virtualbox) as my reference), and WORLD is able to start, but quickly hits a segmentation fault.

[World Server] Loading server configuration..
[World Server] CURRENT_VERSION: 1.1.3
[World Server] Added loginserver login.eqemulator.net:5998
[World Server] Connecting to MySQL...
[World Server] HTTP world service disabled.
[World Server] Checking Database Conversions..
[Upgrade Script] No script update necessary
Perl Version is 5.14.2
MySQL path not found, please add the path for automatic database upgrading to continue...

script_exiting...
[World Server] Loading variables..
Segmentation fault


As far as I can tell, this happens before any logs are created, since I haven't been able to find any log files. The same DB works well with my existing EQEmu install on Ubuntu x86_64.

Thought I would post here to see if anyone has any suggestions on how to progress from here. I've done some C++ on Windows but haven't used a debugger on linux before.

N0ctrnl
10-12-2015, 03:05 PM
Ok, so are you running on a Raspberry Pi? The first thing you should do is run gdb against the core file and see what kind of general info that can tell you. Could be something really simple, but that's the first step if you have no log files.

At a glance, this looks like a DB configuration issue. Have you verified the user/password and all that works to connect to the DB?

Uleat
10-12-2015, 03:18 PM
That's an eqemu_update.pl message.

It will resolve win- or linux-based locations.


My guess is that you could either adapt the script to recognize raspberryPi, or manually ensure that your db is up-to-date and ignore the script failure message.

Wisteso
10-12-2015, 04:05 PM
Uleat, the perl script is causing the segmentation fault? I had thought the perl script was fine, since the segmentation fault occurs after "[World Server] Loading variables.."

Cilraaz
10-12-2015, 04:07 PM
The update script is failing due to a bad MySQL path and the world server is seg faulting when it's pulling variables from the database. I'm guessing it's an issue with how Raspian handles its MySQL installation or your MySQL configuration.

Wisteso
10-12-2015, 04:54 PM
Perhaps its due to the DB being some months out of date. It took a while to get it working properly when I initially set up EQEmu in my Ubuntu VM (few month ago), and I didn't want to lose my player database. So I may need to run an update SQL file or two.

Though it does seem to be connecting, since I get failure messages when the DB is offline or has the wrong credentials.

Wisteso
10-12-2015, 05:25 PM
Yeah, I was a nooblet and assumed that the DB hadn't changed since world was still version 1.1.3, but it seems I'm missing quite a few DB updates.

Will report back on what happens after updating.

Mysql path is fine now that I did "apt-get install mysql-client". I initially skipped a lot of DB pre-reqs since the DB is on the VM still since the RPi doesnt have the space for it.

Wisteso
10-12-2015, 05:46 PM
Alright, seems the DB is up to date after installing mysql and letting the patcher do its things, though the Segmentation Fault still occurs.


pi@raspberrypi ~/eq/server $ ./world
[World Server] Loading server configuration..
[World Server] CURRENT_VERSION: 1.1.3
[World Server] Added loginserver login.eqemulator.net:5998
[World Server] Connecting to MySQL...
[Status] Starting File Log 'logs/world_681.log'
[World Server] HTTP world service disabled.
[World Server] Checking Database Conversions..
[Upgrade Script] No script update necessary
Perl Version is 5.14.2
================================================== ==========
EQEmu: Automatic Upgrade Check
================================================== ==========
(Linux) MySQL is in system path
Path = /usr/bin/mysql
================================================== ==========
Binary Revision / Local: (9087 / 9087)
Database up to Date: Continuing World Bootup...
================================================== ==========
[World Server] Loading variables..
Segmentation fault
pi@raspberrypi ~/eq/server $


Might have to look into using gdb, but I haven't used any linux debuggers for a long time. Hopefully I can figure something out with it.

Wisteso
10-12-2015, 06:02 PM
After using GDB...

GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 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 "arm-linux-gnueabihf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/pi/eq/server/world...done.
(gdb) run
Starting program: /home/pi/eq/server/world
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0xb683f460 (LWP 762)]
[New Thread 0xb603f460 (LWP 763)]
[New Thread 0xb583f460 (LWP 764)]
[Thread 0xb583f460 (LWP 764) exited]
[World Server] Loading server configuration..
[World Server] CURRENT_VERSION: 1.1.3
[World Server] Added loginserver login.eqemulator.net:5998
[World Server] Connecting to MySQL...
[Status] Starting File Log 'logs/world_759.log'
[World Server] HTTP world service disabled.
[World Server] Checking Database Conversions..
[Upgrade Script] No script update necessary
Perl Version is 5.14.2
================================================== ==========
EQEmu: Automatic Upgrade Check
================================================== ==========
(Linux) MySQL is in system path
Path = /usr/bin/mysql
================================================== ==========
Binary Revision / Local: (9087 / 9087)
Database up to Date: Continuing World Bootup...
================================================== ==========
[World Server] Loading variables..

Program received signal SIGSEGV, Segmentation fault.
0xb6fd00a0 in memcpy () from /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so
(gdb) backtrace
#0 0xb6fd00a0 in memcpy () from /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so
#1 0xb6b8bf38 in ?? () from /usr/lib/arm-linux-gnueabihf/libmysqlclient.so.18
Cannot access memory at address 0x0
#2 0xb6b8bf38 in ?? () from /usr/lib/arm-linux-gnueabihf/libmysqlclient.so.18
Cannot access memory at address 0x0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Seems like it's an issue with libcofi_rpi.so that I need to look into with Raspbian.

N0ctrnl
10-12-2015, 11:16 PM
Looks more like a MySQL issue to me. What's ldd on the binary return?

twidget60
10-22-2015, 01:20 AM
Has any progress been made, Wisteso? I've done the exact same thing and I'm getting the very same Segmentation fault following "Loading variables...". Any help would be great.

twidget60
10-22-2015, 01:23 AM
(gdb) run
Starting program: /home/pi/server/world
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0x76790450 (LWP 3228)]
[New Thread 0x75d90450 (LWP 3229)]
[New Thread 0x753ff450 (LWP 3230)]
[Thread 0x753ff450 (LWP 3230) exited]
[World Server] Loading server configuration..
[World Server] CURRENT_VERSION: 1.1.3
[World Server] Added loginserver login.eqemulator.net:5998
[World Server] Connecting to MySQL...
[Status] Starting File Log 'logs/world_3225.log'
[World Server] HTTP world service disabled.
[World Server] Checking Database Conversions..
[Upgrade Script] No script update necessary
Perl Version is 5.20.2
================================================== ==========
EQEmu: Automatic Upgrade Check
================================================== ==========
(Linux) MySQL is in system path
Path = /usr/bin/mysql
================================================== ==========
Binary Revision / Local: (9087 / 9087)
Database up to Date: Continuing World Bootup...
================================================== ==========
[World Server] Loading variables..

Program received signal SIGSEGV, Segmentation fault.
0x76fbcd58 in memcmp () from /usr/lib/arm-linux-gnueabihf/libarmmem.so
(gdb) backtrace
#0 0x76fbcd58 in memcmp () from /usr/lib/arm-linux-gnueabihf/libarmmem.so
#1 0x00000000 in ?? ()
(gdb) step
Single stepping until exit from function memcmp,
which has no line number information.
[Thread 0x76790450 (LWP 3228) exited]
[Thread 0x76ff5210 (LWP 3225) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) backtrace
No stack.
(gdb)

Uleat
10-22-2015, 12:52 PM
Perl Version is 5.20.2


Straying away from the recommended perl versions can lead to issues.

Shendare
10-22-2015, 01:01 PM
It is the root of all sorts of evil.

twidget60
10-22-2015, 01:50 PM
I'm new to Linux btw. How would one downgrade to a previous version? Has anyone actually succeeded in getting an Eq server to work on a raspberry pi?

Wisteso
10-29-2015, 11:47 AM
twidget60, I'm pretty sure its a problem with the mysql client library (libmysqlclient.so.18)

libarmmem.so and libcofi_rpi.so are the same thing, I think (Raspbian 6 and 7 equivalents)

Even if EQEmu was using libmysqlclient in some weird way, it should not cause segmentation faults. It would be helpful if EQEmu supported some alternative database driver, but I haven't seen any evidence of such a thing.