Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] (PR#12900) pubserver crash in /start
Home

[Freeciv-Dev] (PR#12900) pubserver crash in /start

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12900) pubserver crash in /start
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Apr 2005 10:13:39 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12900 >

I knew something was wrong.  I tested this with observers, but if you
/detach and then press /start you'll cause a server crash.  This patch
should fix it (I will commit immediately).

-jason


-------- Original Message --------
Subject: [Freeciv-Dev] civserver crashed:
http://pubserver.freeciv.org/games/407985
Date: Tue, 26 Apr 2005 07:53:54 -0700
From: freeciv@xxxxxxxxxxxxxxxxxxxxx
To: freeciv-dev@xxxxxxxxxxx



# examining core.1632 in /games/407985/. ...
# using $FREECIV_PATH 
:/home/freeciv/.freeciv/code/installed/cvs/S2_0/2005-04-25_10.00+mintimeout+original_gamelog/share/freeciv
# running: (echo bt full; echo quit; exec yes '') | gdb  
/home/freeciv/.freeciv/code/installed/cvs/S2_0/2005-04-25_10.00+mintimeout+original_gamelog/share/freeciv/../../bin/civserver
 core.1632
GNU gdb Red Hat Linux (5.2-2)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by 
`/home/freeciv/.freeciv/code/installed/cvs/S2_0/2005-04-25_10.00+mintimeout+orig'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/lib/gconv/ISO8859-1.so...done.
Loaded symbols for /usr/lib/gconv/ISO8859-1.so
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /lib/libnss_nisplus.so.2...done.
Loaded symbols for /lib/libnss_nisplus.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libnss_dns.so.2...done.
Loaded symbols for /lib/libnss_dns.so.2
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
#0  start_command (caller=0x817dab0, name=0xbfffc5b0 "", check=false)
    at stdinhand.c:3632
3632          caller->player->is_started = TRUE;
(gdb) #0  start_command (caller=0x817dab0, name=0xbfffc5b0 "", check=false)
    at stdinhand.c:3632
        pplayer = (struct player *) 0x0
        PI_p_itr = 0
        caller = (struct connection *) 0x0
        check = false
        started = 0
        notstarted = 0
#1  0x08055b1f in handle_stdin_input (caller=0x817dab0, 
    str=0x83cd058 "/start", check=false) at stdinhand.c:3501
        str = 0xffffffff <Address 0xffffffff out of bounds>
        command = "start\0l\b", '\0' <repeats 12 times>, "ÐQl\b", '\0' <repeats 
12 times>, "ê\f\0\0\r \0\0, \0\0\n\0\0\0\0\0\0\0\002\0\0\0~ü\016\0ÿÿÿÿÿÿÿÿ·R", 
'\0' <repeats 38 times>, " \0\0\0ä\037\0\0\0\0\0\0ÆÜ\v@", '\0' <repeats 12 
times>, "\fó\026@\0\0\0\0ä­\021\b\030Ïÿ¿\232¡\t@0Ïÿ¿ä­\021\b\0\0\0\0ã­\021\b", 
'\0' <repeats 12 times>, 
" 1\026@\0\0\0\0\225\003\021\bHÏÿ¿\232¡\t@àÍ\t@\225\003\021\b\0\0\0\0\224\003\021\bÍý\020\b\bÛ\027\b\0\0\0\0"...
        arg = 
"\0Æÿ¿x\223C\b\005\0\0\0 Æÿ¿\0\0\0\0 Æÿ¿\bÆÿ¿\226\025\f@ Æÿ¿¶è\020\bøÒ\026@\0\0\0\0x³C\b\b
 
\0\0 Ï\026@\fó\026@p\223C\b Ï\026@\030Æÿ¿H\025\f@àj4\bX\0\0\0 Ï\026@\226\025\f@\0\0\0\0\220j4\bøÒ\026@\001\0\0\0\220ÔD\b
 A\001\0 Ï\026@\fó\026@\230³C\b Ï\026@XÆÿ¿H\025\f@\024Èÿ¿\0 
\0\0\0\0\0\0 Æÿ¿\020\204+\b ³C\bxÆÿ¿wH\020\b\0\0\0\0ÀÈÿ¿r\0\0\0\0\0\0\0\0Ô\027\b\031\204+\b"...
        allargs = 
"\0Éÿ¿\0\0\0\0\0\0\0\0à¢\021\bXÄÿ¿¬Êÿ¿\0\0\0\0ÿÿÿÿ(Éÿ¿\0\0\0\0y\0\0\0ÿÿÿÿ\0\0\0\0\0\0\0\0?\0\0\0ÿÿÿÿ\0\0\0\0
 the Dutch KingdàÆ\026@\0\0\0\030. Belgium is mainly characterized by its 
movem\2240>0\001\212\031\b\003\0\0\0xÄÿ¿A¹\004\bn\0\0\0\0\0\0\0\003\0\0\0\0\006\0\0ÐÄÿ¿8Ô\027\b\210Äÿ¿\003Ð\004\bÐÄÿ¿\0\006\0\0"...
        full_command = "start\0l\b", '\0' <repeats 12 times>, "ÐQl\b", '\0' 
<repeats 12 times>, "ê\f\0\0\r \0\0, 
\0\0\n\0\0\0\0\0\0\0\002\0\0\0yü\016\0ÿÿÿÿÿÿÿÿ", '\0' <repeats 40 times>, " 
\0\0\0ä\037", '\0' <repeats 86 times>, 
"vwvh(*:%\0\0\0\0\230ë\024\b\b\0\0\0pÉÿ¿\224¢\021\b Àÿ¿\001\0\0\0update auth 
set accesstime=unix_timestamp(), address='210.168.167.171'"...
        cptr_s = 0x83cd05e ""
        cptr_d = 0xffffffff <Address 0xffffffff out of bounds>
        i = -1
        cmd = CMD_START_GAME
#2  0x0806a447 in handle_chat_msg_req (pconn=0x817dab0, 
    message=0x83cd058 "/start") at handchat.c:175
        sender_name = 
"\0Ô\027\b´Ðÿ¿\0\0\0\0\0\0\0\0ÐÐÿ¿\0\0\0\0\bÑÿ¿úm\006\b\0Ô\027\b\0\0\0\0èÐÿ¿>\234\t\b\0Ñÿ¿\002\0\0\0\001\0\0\0\0Ñÿ¿\003\0\0\0
 Ñÿ¿8á"
        chat = "ED\006@\fó\026@xËÿ¿Ê­\021@X\231*\b\a\0\0\0ØÊÿ¿fy\022@\bËÿ¿ 
\231*\b\001\0\0\0\0Ô\027\b\020\204+\b\031\204+\b\bÑÿ¿öJ\006\b°R\021\b\020\204+\b\0\0\0\0\0\0\0\0\r\0\0\0PËÿ¿8Ëÿ¿\bËÿ¿ìû\026@Ü\227\001@^\237\001@¢\230\001@Ð\227\001@0Ëÿ¿xËÿ¿tËÿ¿ \216=\b\001\0\0\0\r\0\0\0
 
\0\0\0/usr/lib$¡\001@xËÿ¿Àæ\025\bÀö\025\bà\216=\b\004\0\0\0\0\0\0\0àj4\bØ\216=\b\0\0\0\0°Ëÿ¿\022\0\0\0"...
        cp = 0x83cd05e ""
#3  0x0804ecb1 in handle_packet_input (pconn=0x817dab0, packet=0x83cd058, 
    type=19) at srv_main.c:966
        packet = (void *) 0x0
        type = 19
        pplayer = (struct player *) 0x817dab0
#4  0x080866da in sniff_packets () at sernet.c:629
        command_ok = 135781040
        packet = (void *) 0x83cd058
        type = PACKET_CHAT_MSG_REQ
        result = true
        i = 62
        max_desc = 135781040
        readfs = {__fds_bits = {64, 0 <repeats 31 times>}}
        writefs = {__fds_bits = {0 <repeats 32 times>}}
        exceptfs = {__fds_bits = {0 <repeats 32 times>}}
        tv = {tv_sec = 0, tv_usec = 790000}
        year = 0
#5  0x0804fd95 in srv_loop () at srv_main.c:1800
        flag = false
        i = 0
        start_nations = true
#6  0x0804fa81 in srv_main () at srv_main.c:1670
No locals.
#7  0x0804a5f0 in main (argc=14, argv=0xbfffe754) at civserver.c:200
        argc = 14
        argv = (char **) 0xbfffe754
        inx = 14
        showhelp = false
        showvers = false
        option = 0x0
#8  0x400641c4 in __libc_start_main () from /lib/libc.so.6
No symbol table info available.
(gdb) 

Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.354.2.32
diff -u -r1.354.2.32 stdinhand.c
--- server/stdinhand.c  20 Apr 2005 16:55:04 -0000      1.354.2.32
+++ server/stdinhand.c  26 Apr 2005 17:08:18 -0000
@@ -3630,6 +3630,9 @@
     } else if (!caller) {
       start_game();
       return TRUE;
+    } else if (!caller->player || !caller->player->is_connected) {
+      /* A detached or observer player can't do /start. */
+      return TRUE;
     } else {
       int started = 0, notstarted = 0;
       const int percent_required = 100;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12900) pubserver crash in /start, Jason Short <=