Ubuntu server 12.04 crash
#1
Hi guys,

I setup a new ubuntu server today to play around with mcserver. I got everything compiled just fine, and it generates and starts up; however, once I open my minecraft multiplayer window with the server loaded up - it crashes. Meaning, the server crashes when it trys to send the packets to display server description/players/etc etc. I've included relevant information & the output below, thanks for the help!

Ubuntu server 12.04 x86
Mc-server revision 594
Minecraft version 1.2.5

Code:
root@ubuntu:/home/user/mcserver_svn# ./MCServer
[20:45:27] --- Started Log ---
[20:45:27] Creating new server instance...
[20:45:27] cSocketThreads startup
[20:45:27] Starting server...
/============================\
|   Custom Minecraft Server  |
|  Created by Kevin Bansberg |
|       A.K.A. FakeTruth     |
| Monsters by Alex Sonek     |
|       A.K.A. Duralex       |
| Stuff by Mattes D          |
|       A.K.A. _Xoft(o)      |
\============================/
More info: WWW.MC-SERVER.ORG
           WWW.AE-C.NET
           WWW.RBTHINKTANK.COM
email: faketruth@gmail.com

[20:45:27] Starting up server.
[20:45:27] Compatible clients: 1.2.4, 1.2.5, protocol version 29
[20:45:27] Port 25565 has been bound, server is open for connections
[20:45:27] Creating WebAdmin...
[20:45:27] Starting WebAdmin on port 8080
[20:45:27] Loading settings...
[20:45:27] -- Loading Groups --
[20:45:27] Loading group: Admins
[20:45:27] Permission: *
[20:45:27] Loading group: Mods
[20:45:27] Permission: core.time
[20:45:27] Permission: core.item
[20:45:27] Loading group: Vips
[20:45:27] Permission: core.teleport
[20:45:27] Loading group: Default
[20:45:27] Permission: core.build
[20:45:27] Permission: core.help
[20:45:27] Permission: core.playerlist
[20:45:27] Permission: core.pluginlist
[20:45:27] Permission: core.spawn
[20:45:27] -- Done Loading Groups --
[20:45:27] -- Loading recipes from recipes.txt --
[20:45:27] Error: Wrong format
[20:45:27] Error near: "    #-> Blaze Powder
1x2,1:1:341:1,1:2:377:1@378:1  #-> Magma Cream
1x1,1:1:266:1@371:9            #-> Gold Nugget





"
[20:45:27] -- Done loading recipes, found 114 recipes --
[20:45:27] -- Loading crafting recipes from crafting.txt --
[20:45:27] -- 189 crafting recipes loaded from crafting.txt --
[20:45:27] -- Loading furnace recipes --
[20:45:27] Got 9 furnace recipes, and 11 fuels.
[20:45:27] -- Done loading furnace recipes --
[20:45:27] Loading worlds...
[20:45:27] cWorld::cWorld(world)
[20:45:27] [Generator]::BiomeGen value not found in world.ini, using "DistortedVoronoi".
[20:45:27] Using a cache for biomegen of size 64.
[20:45:27] [Generator]::HeightGen value not found in world.ini, using "Biomal".
[20:45:27] Using a cache for Heightgen of size 64.
[20:45:27] [Generator]::CompositionGen value not found in world.ini, using "Biomal".
[20:45:27] Loading plugin manager...
[20:45:27] Loading plugins
[20:45:27] Binding /help (core.help)
[20:45:27] Binding /pluginlist (core.pluginlist)
[20:45:27] Binding /tp (core.teleport)
[20:45:27] Binding /item (core.item)
[20:45:27] Binding /i (core.item)
[20:45:27] Binding /list (core.playerlist)
[20:45:27] Binding /who (core.playerlist)
[20:45:27] Binding /playerlist (core.playerlist)
[20:45:27] Binding /motd (core.motd)
[20:45:27] Binding /reload (core.reload)
[20:45:27] Binding /time (core.time)
[20:45:27] Binding /spawn (core.spawn)
[20:45:27] Binding /home (core.spawn)
[20:45:27] Binding /kick (core.kick)
[20:45:27] Binding /ban (core.ban)
[20:45:27] Binding /unban (core.unban)
[20:45:27] Binding /top (core.top)
[20:45:27] Binding /gm (core.changegm)
[20:45:27] Binding /gotoworld (core.gotoworld)
[20:45:27] Binding /coords (core.coords)
[20:45:27] Binding /viewdistance (core.viewdistance)
[20:45:27] Binding /regeneratechunk (core.regeneratechunk)
[20:45:27] Core: loaded 466 item names.
[20:45:27] cWebPlugin::cWebPlugin()
[20:45:27] Initialized Core v.8
[20:45:27] Loaded 1 plugin(s)
[20:45:27] Loading MonsterConfig...
[20:45:27] Starting Authenticator...
[20:45:27] Starting worlds...
[20:45:27] Preparing spawn area in world "world"...
[20:45:27] 399 chunks to load, 0 chunks to generate
[20:45:28] Lighting spawn area in world "world"...
[20:45:28] 399 chunks remaining to light
[20:45:30] Starting server...
[20:45:30] ServerListenThread
[20:45:30] ServerTickThread
[20:45:30] Starting InputThread...
[20:45:30] Initialization done, server running now.

All of the above works fine, however once I view the server on my multiplayer panel with the minecraft client, this happens and it crashes Sad

Code:
[20:46:45] Client "192.168.1.139" connected!
[20:46:45] New ClientHandle created at 0xae600538
[20:46:45] Creating a new cSocketThread (currently have 0)
*** buffer overflow detected ***: ./MCServer terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x45)[0xb75a1dd5]
/lib/i386-linux-gnu/libc.so.6(+0xfebaa)[0xb75a0baa]
/lib/i386-linux-gnu/libc.so.6(+0xffd6a)[0xb75a1d6a]
./MCServer[0x810e134]
./MCServer[0x81403de]
/lib/i386-linux-gnu/libpthread.so.0(+0x6d4c)[0xb764dd4c]
/lib/i386-linux-gnu/libc.so.6(clone+0x5e)[0xb758cace]
======= Memory map: ========
08048000-081e7000 r-xp 00000000 fc:00 1575378    /home/user/mcserver_svn/MCServer
081e7000-081e8000 r--p 0019f000 fc:00 1575378    /home/user/mcserver_svn/MCServer
081e8000-08205000 rw-p 001a0000 fc:00 1575378    /home/user/mcserver_svn/MCServer
08205000-08206000 rw-p 00000000 00:00 0
09543000-0a3ac000 rw-p 00000000 00:00 0          [heap]
aca00000-aca21000 rw-p 00000000 00:00 0
aca21000-acb00000 ---p 00000000 00:00 0
acbfe000-acbff000 ---p 00000000 00:00 0
acbff000-ad3ff000 rw-p 00000000 00:00 0
ad3ff000-ad400000 ---p 00000000 00:00 0
ad400000-adc00000 rw-p 00000000 00:00 0
adc00000-adc21000 rw-p 00000000 00:00 0
adc21000-add00000 ---p 00000000 00:00 0
addff000-ade00000 ---p 00000000 00:00 0
ade00000-ae600000 rw-p 00000000 00:00 0
ae600000-ae621000 rw-p 00000000 00:00 0
ae621000-ae700000 ---p 00000000 00:00 0
ae700000-ae721000 rw-p 00000000 00:00 0
ae721000-ae800000 ---p 00000000 00:00 0
ae800000-ae821000 rw-p 00000000 00:00 0
ae821000-ae900000 ---p 00000000 00:00 0
ae942000-ae9b2000 rw-p 00000000 00:00 0
ae9ea000-ae9eb000 ---p 00000000 00:00 0
ae9eb000-b11ca000 rw-p 00000000 00:00 0
b11f3000-b2800000 rw-p 00000000 00:00 0
b2800000-b28b0000 rw-p 00000000 00:00 0
b28b0000-b2900000 ---p 00000000 00:00 0
b2918000-b3381000 rw-p 00000000 00:00 0
b3381000-b3382000 ---p 00000000 00:00 0
b3382000-b3b82000 rw-p 00000000 00:00 0
b3b82000-b3b83000 ---p 00000000 00:00 0
b3b83000-b4383000 rw-p 00000000 00:00 0
b4383000-b4384000 ---p 00000000 00:00 0
b4384000-b4b84000 rw-p 00000000 00:00 0
b4b84000-b4b85000 ---p 00000000 00:00 0
b4b85000-b5385000 rw-p 00000000 00:00 0
b5385000-b5386000 ---p 00000000 00:00 0
b5386000-b6300000 rw-p 00000000 00:00 0
b6300000-b6321000 rw-p 00000000 00:00 0
b6321000-b6400000 ---p 00000000 00:00 0
b6422000-b649d000 rw-p 00000000 00:00 0
b649d000-b649e000 ---p 00000000 00:00 0
b649e000-b6c9e000 rw-p 00000000 00:00 0
b6c9e000-b6c9f000 ---p 00000000 00:00 0
b6c9f000-b74a2000 rw-p 00000000 00:00 0
b74a2000-b7641000 r-xp 00000000 fc:00 7864339    /lib/i386-linux-gnu/libc-2.15.so
b7641000-b7643000 r--p 0019f000 fc:00 7864339    /lib/i386-linux-gnu/libc-2.15.so
b7643000-b7644000 rw-p 001a1000 fc:00 7864339    /lib/i386-linux-gnu/libc-2.15.so
b7644000-b7647000 rw-p 00000000 00:00 0
b7647000-b765e000 r-xp 00000000 fc:00 7864357    /lib/i386-linux-gnu/libpthread-2.15.so
b765e000-b765f000 r--p 00016000 fc:00 7864357    /lib/i386-linux-gnu/libpthread-2.15.so
b765f000-b7660000 rw-p 00017000 fc:00 7864357    /lib/i386-linux-gnu/libpthread-2.15.so
b7660000-b7662000 rw-p 00000000 00:00 0
b7662000-b767e000 r-xp 00000000 fc:00 7864364    /lib/i386-linux-gnu/libgcc_s.so.1
b767e000-b767f000 r--p 0001b000 fc:00 7864364    /lib/i386-linux-gnu/libgcc_s.so.1
b767f000-b7680000 rw-p 0001c000 fc:00 7864364    /lib/i386-linux-gnu/libgcc_s.so.1
b7680000-b7681000 rw-p 00000000 00:00 0
b7681000-b76ab000 r-xp 00000000 fc:00 7864347    /lib/i386-linux-gnu/libm-2.15.so
b76ab000-b76ac000 r--p 00029000 fc:00 7864347    /lib/i386-linux-gnu/libm-2.15.so
b76ac000-b76ad000 rw-p 0002a000 fc:00 7864347    /lib/i386-linux-gnu/libm-2.15.so
b76ad000-b7785000 r-xp 00000000 fc:00 791411     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b7785000-b7786000 ---p 000d8000 fc:00 791411     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b7786000-b778a000 r--p 000d8000 fc:00 791411     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b778a000-b778b000 rw-p 000dc000 fc:00 791411     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b778b000-b7792000 rw-p 00000000 00:00 0
b7793000-b7799000 rw-p 00000000 00:00 0
b7799000-b779a000 r-xp 00000000 00:00 0          [vdso]
b779a000-b77ba000 r-xp 00000000 fc:00 7864336    /lib/i386-linux-gnu/ld-2.15.so
b77ba000-b77bb000 r--p 0001f000 fc:00 7864336    /lib/i386-linux-gnu/ld-2.15.so
b77bb000-b77bc000 rw-p 00020000 fc:00 7864336    /lib/i386-linux-gnu/ld-2.15.so
bf89e000-bf8bf000 rw-p 00000000 00:00 0          [stack]
Aborted (core dumped)
Reply
Thanks given by:
#2
Can you compile a debug version of MCServer ("make" instead of "make release=1") and run the server under gdb? Then when it crashes, it should display a proper backtrace including all the symbols.
Reply
Thanks given by:
#3
This sort of looks like the bug I experienced while trying it on FreeBSD. At least the crash occurs at the same time.

Can you try restarting the server and then joining (either after listing it, or removing it from the list and connecting by entering the ip)? It worked in my experience.
Reply
Thanks given by: fodah
#4
(06-12-2012, 05:55 PM)xoft Wrote: Can you compile a debug version of MCServer ("make" instead of "make release=1") and run the server under gdb? Then when it crashes, it should display a proper backtrace including all the symbols.

Strange enough, when I run in debug everything works fine. This crash is only reproducible when compiling with release.


(06-12-2012, 10:27 PM)cedeel Wrote: This sort of looks like the bug I experienced while trying it on FreeBSD. At least the crash occurs at the same time.

Can you try restarting the server and then joining (either after listing it, or removing it from the list and connecting by entering the ip)? It worked in my experience.

I can actually log into the server with release=1 when I do not view it on the multiplayer server list causing a crash. However this is happening, it's definitely happening when the server creates the ClientHandle for displaying on the list.
Reply
Thanks given by:
#5
How about requesting the list when somebody is already in the server? Does it still crash?
Reply
Thanks given by:
#6
(06-13-2012, 03:11 AM)FakeTruth Wrote: How about requesting the list when somebody is already in the server? Does it still crash?

Yes, it still crashes even if a player is online.
Reply
Thanks given by:
#7
Any chance you could modify the source a bit to add more logging, so that we know where exactly the problem happens?
I'm guessing it's somewhere in the cSocketThreads::cSocketThread::Execute() method. So replace that method (cSocketThreads.cpp, line ~500) with this code:
Code:
void cSocketThreads::cSocketThread::Execute(void)
{
    // Connect the "client" part of the Control socket:
    LOG("Execute() start");
    m_ControlSocket1 = cSocket::CreateSocket();
    cSocket::SockAddr_In Addr;
    Addr.Family = cSocket::ADDRESS_FAMILY_INTERNET;
    Addr.Address = cSocket::INTERNET_ADDRESS_LOCALHOST();
    Addr.Port = m_ControlSocket2.GetPort();
    ASSERT(Addr.Port != 0);  // We checked in the Start() method, but let's be sure
    if (m_ControlSocket1.Connect(Addr) != 0)
    {
        LOGERROR("Cannot connect Control sockets for a cSocketThread (\"%s\"); continuing, but the server may be unreachable from now on.", Socket::GetLastErrorString().c_str());
        m_ControlSocket2.CloseSocket();
        return;
    }
    LOG("ControlSockets connected");
    
    // The main thread loop:
    while (!m_ShouldTerminate)
    {
        // Put all sockets into the Read set:
        fd_set fdRead;
        cSocket::xSocket Highest = m_ControlSocket1.GetSocket();
        
        LOG("Preparing fdRead");
        PrepareSet(&fdRead, Highest);
        
        // Wait for the sockets:
        LOG("select()ing fdRead");
        if (select(Highest + 1, &fdRead, NULL, NULL, NULL) == -1)
        {
            LOG("select(R) call failed in cSocketThread: \"%s\"", cSocket::GetLastErrorString().c_str());
            continue;
        }
        
        LOG("Reading from sockets");
        ReadFromSockets(&fdRead);

        // Test sockets for writing:
        LOG("Preparing fdWrite");
        fd_set fdWrite;
        Highest = m_ControlSocket1.GetSocket();
        PrepareSet(&fdWrite, Highest);        
        timeval Timeout;
        Timeout.tv_sec = 0;
        Timeout.tv_usec = 0;
        LOG("Selecting fdWrite");
        if (select(Highest + 1, NULL, &fdWrite, NULL, &Timeout) == -1)
        {
            LOG("select(W) call failed in cSocketThread: \"%s\"", cSocket::GetLastErrorString().c_str());
            continue;
        }
        
        LOG("Writing to sockets");
        WriteToSockets(&fdWrite);
        
        LOG("Removing closed sockets");
        RemoveClosedSockets();
    }  // while (!mShouldTerminate)
}
This should provide a more detailed log, so paste it here.
Reply
Thanks given by:
#8
I reproduced the same behavior on MacOSX and fixed it in Rev 681. Can you please confirm if the fix is good for your crash as well?
Reply
Thanks given by:




Users browsing this thread: 8 Guest(s)