Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2001:
[Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/g
Home

[Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/g

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/games/18651 (PR#852)
From: Thue <thue@xxxxxxx>
Date: Sat, 21 Jul 2001 07:00:21 -0700 (PDT)

This was a case of genlist corruption when the item the iterator 
pointed to was deleted.

When iterating over a connection list while sending data this could 
only happen when a data send caused caused another data send, which 
then failed and cause connection to be removed. One case of that was 
when a write failed and a message was sent to all other clients (one of 
them then failed and was deleted, and the original list was corrupted).

As far as I can imagine there are no other cases where a network send 
causes another send, so there should be no similar bugs hidden.

The patch fixes the problem by postponing the disconnection of further 
connections when we are in the process of disconnecting one already.

-Thue

On Thursday 19 July 2001 20:08, Thue wrote:
> From the backtrace I think I can see that the crash happens if a
> client is disconnected, and then when trying to tell the other
> clients about it one of the other clients disconnect.
>
> Applying the attached "patch" allows us to reproduce the crash as
> follows:
> -start a game with 2 clients and a server.
> -use the "hard" command in the server (note that I added the crash
> stuff to it for easy manipulation).
> -make the server send a message to the client, fx doing a "set
> timeout 10". Because of the patch all the clients will fail at once,
> reproducing the crash.
>
> -Thue
>
> On Wednesday 18 July 2001 19:27, freeciv@xxxxxxxxxxxxxxxxxxxxx wrote:
> > # using $FREECIV_PATH /home/freeciv/src/freeciv/data
> > # running: (echo bt; echo quit; exec yes '') | gdb -d
> > /home/freeciv/src/freeciv/ai -d /home/freeciv/src/freeciv/amiga -d
> > /home/freeciv/src/freeciv/client/gui-beos -d
> > /home/freeciv/src/freeciv/client -d
> > /home/freeciv/src/freeciv/client/gui-gtk -d
> > /home/freeciv/src/freeciv/client/gui-mui -d
> > /home/freeciv/src/freeciv/client/gui-stub -d
> > /home/freeciv/src/freeciv/client/gui-xaw -d
> > /home/freeciv/src/freeciv/common -d /home/freeciv/src/freeciv/intl
> > -d /home/freeciv/src/freeciv/server
> > /home/freeciv/src/freeciv/server/civserver core GNU gdb 5.0
> > Copyright 2000 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/src/freeciv/server/civserver --gamelog gamelog -p
> > 5575 -m -r /hom'. 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 /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_nis.so.2...done.
> > Loaded symbols for /lib/libnss_nis.so.2
> > 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  0x808ca3a in send_connection_data (pc=0x30, data=0xbfffb5c0 "",
> > len=97) at connection.c:270 270       if (pc && pc->used) {
> > (gdb) #0  0x808ca3a in send_connection_data (pc=0x30,
> > data=0xbfffb5c0 "", len=97) at connection.c:270 #1  0x80957e7 in
> > send_packet_generic_message (pc=0x30, type=14, packet=0xbfffc5f0)
> > at packets.c:2468 #2  0x807382e in vnotify_conn_ex (dest=0x814cb8c,
> > x=-1, y=-1, event=-1, format=0x80b2284 "Game: Lost connection:
> > %s.", vargs=0xbfffcc58) at plrhand.c:862
> > #3  0x8073883 in notify_conn (dest=0x814cb8c, format=0x80b2284
> > "Game: Lost connection: %s.") at plrhand.c:886 #4  0x804e1bb in
> > lost_connection_to_client (pconn=0x810ac74) at srv_main.c:1396 #5
> > 0x8084694 in close_socket_callback (pc=0x810ac74) at sernet.c:206
> > #6 0x808c8b2 in write_socket_data (pc=0x810ac74, buf=0x817c348,
> > limit=0) at connection.c:191 #7  0x808c94d in
> > flush_connection_send_buffer_all (pc=0x810ac74) at connection.c:214
> > #8  0x808cad4 in
> > send_connection_data (pc=0x810ac74, data=0xbfffce60 "", len=71) at
> > connection.c:285 #9  0x80957e7 in send_packet_generic_message
> > (pc=0x810ac74, type=14, packet=0xbfffde90) at packets.c:2468 #10
> > 0x807382e in vnotify_conn_ex (dest=0x814cb8c, x=-1, y=-1, event=-1,
> > format=0x80b2284 "Game: Lost connection: %s.", vargs=0xbfffe4f8) at
> > plrhand.c:862
> > #11 0x8073883 in notify_conn (dest=0x814cb8c, format=0x80b2284
> > "Game: Lost connection: %s.") at plrhand.c:886 #12 0x804e1bb in
> > lost_connection_to_client (pconn=0x810a9e0) at srv_main.c:1396 #13
> > 0x8084694 in close_socket_callback (pc=0x810a9e0) at sernet.c:206
> > #14 0x808c8b2 in write_socket_data (pc=0x810a9e0, buf=0x8172300,
> > limit=0) at connection.c:191 #15 0x808c94d in
> > flush_connection_send_buffer_all (pc=0x810a9e0) at connection.c:214
> > #16 0x808cad4 in
> > send_connection_data (pc=0x810a9e0, data=0xbfffe700 "", len=3) at
> > connection.c:285 #17 0x80948b4 in send_packet_generic_empty
> > (pc=0x810a9e0, type=86) at packets.c:2015 #18 0x8084a59 in
> > sniff_packets () at sernet.c:379
> > #19 0x804e871 in main_loop () at srv_main.c:1686
> > #20 0x804eea0 in srv_main () at srv_main.c:1958
> > #21 0x8049b75 in main (argc=8, argv=0xbffffbf4) at civserver.c:147
> > #22 0x40066f31 in __libc_start_main (main=0x804965c <main>, argc=8,
> > ubp_av=0xbffffbf4, init=0x8049060 <_init>, fini=0x80b014c <_fini>,
> > rtld_fini=0x4000e274 <_dl_fini>, stack_end=0xbffffbec) at
> > ../sysdeps/generic/libc-start.c:129 (gdb)

Attachment: diff
Description: Text Data


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/games/18651 (PR#852), Thue <=