[CF-Devel] Character Creation and Crossedit Bugs

Benjamin `Quisar' Lerman quisar at quisar.ambre.net
Fri Feb 23 05:27:19 CST 2001


>
     
      >  The server does crashed from time to time when someone creates a new character :
     
     >
     
     
     >
     
      Yes, this has been raised already. I am not sure if anyone is working on
     
     >
     
      fixing it just yet. =(
     
     
 I try to see what might be wrong. The big problems is that I didn't
figure out how to make this thing predictable. I finally get a core file
which was usable (after removing the catching of SIGSEV signals...) and I
found that :

hell:~ $ gdb ~quisar/download/crossfire/crossfire-test/server/crossfire
core 
GNU gdb 4.18
Copyright 1998 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-suse-linux"...

Core was generated by
`/home/quisar/download/crossfire/crossfire-test/server/crossfire -d'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libcrypt.so.1...done.
Reading symbols from /lib/libnsl.so.1...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading symbols from /lib/libnss_files.so.2...done.
Reading symbols from /lib/libnss_dns.so.2...done.
Reading symbols from /lib/libresolv.so.2...done.
#0  0x80b6a6c in draw_client_map (pl=0x87c0b98) at request.c:896
896
esrv_map_setbelow(&pl->contr->socket,ax,ay,
(gdb) backtrace
#0  0x80b6a6c in draw_client_map (pl=0x87c0b98) at request.c:896
#1  0x80afc5d in draw (pl=0x87c0b98) at info.c:219
#2  0x80b3dfb in doeric_server () at loop.c:572
#3  0x8064103 in main (argc=2, argv=0xbffff634) at main.c:967
(gdb) print face
$1 = (New_Face *) 0x3e8
(gdb) print face->number
Cannot access memory at address 0x3e8.

OOOps

The value for face is wrong. 0x3e8 is way out of the addressing space of
this program.

face is taken from pl->map, but we can see a little up in the file :

    /* IF player is just joining the game, he isn't here yet, so the map
     * can get swapped out.  If so, don't try to send them a map.  All
     * will
     * be OK once they really log in.
     */
    if (pl->map->in_memory!=MAP_IN_MEMORY) return;

 So maybe the initalisation of pl->map is incorrect or incomplete. So I
add the patch :

-------------------------------------------------------------------
--- ../crossfire-0.96.0/server/player.c	Tue Feb 13 07:59:59 2001
+++ server/player.c	Fri Feb 23 12:02:15 2001
@@ -666,7 +666,9 @@
 
 	    /* So that enter_exit will put us at startx/starty */
 	    op->x= -1;
-
+#if 1
+	    op->map->in_memory = ! MAP_IN_MEMORY;
+#endif
 	    enter_exit(op,NULL);
 
 	    SET_ANIMATION(op, 2);     /* So player faces south */
-------------------------------------------------------------------

 and the server didn't crashed anymore since.

 The problem is that, because I don't know how to force the bug to show,
I might be totally wrong. So if someone is more aware than me (it is not
difficult...) how the initalisation of a new player is done and can
confirm or deny that the probleme might be this one...

-- 
 Benjamin `Quisar' Lerman
 
     
     quisar at quisar.ambre.net
     
     
     http://www.ambre.net/quisar
     
     
 "Si les yeux pouvaient tuer et enfanter, les rues seraient pleines de cadavres
et de femmes grosses." Valery

    
    


More information about the crossfire mailing list