Page 1 of 1

RacetoSeven 1.11.1

Posted: Sat Sep 03, 2005 1:35 am
by RPG
Author: RPG

Description: Here it is, the final release of RacetoSeven... even though you can adjust the number of captures you race to!

This release is hardly different from 0.11.1, the only change is that there's a new configuration option, -allowMatches, which allows weather matches can be played. Useful if an admin wants to have the plugin running in case he wants a match, but doens't want any matches while he's away. Just set -allowMatches to false, and no matches will be allowed to be played. Here's the tiny changelog:

Code: Select all

-------------------------CHANGELOG-------------------------
1.11.1 (Release):
FEATURE: Added -allowMatches config option, so in essence, admins can "dissalow" matches.
Play with it. Have matches at your will. And most importantly, report crashes :).

Files:
(Linux .so library file compiled by meacan)

Posted: Sat Sep 03, 2005 8:01 am
by I_Died_Once
How would you like those crashes to be reported?

Regular backtrace? valgrind files?

Posted: Sat Sep 03, 2005 2:14 pm
by RPG
Regular backtraces are fine. I don't understand Valgrind that well.

Posted: Sat Sep 03, 2005 10:22 pm
by I_Died_Once
Someone joined mid match, using default config

Code: Select all

Player [7] accept() from 193.201.54.13:46678 on 7
Player [7] submitted reverse resolve query
Player [7] resolved to dahlia.d75.net
Player  [7] removed at 2005-09-03 18:14:57: Disconnected
Player bzfscron [2] -> All: /say Welcome to Planet MoFo! Plugin testing taking place!
Player bzfscron [2] -> All: /say Invitations are open to the private forums @ bzflag.org. See an admin for more info. Must be registered.
Player bzfscron [2] -> All: /say Planet MoFo: Doing exceptional other servers wouldn't be caught dead doing.
Player [7] accept() from 69.79.205.190:1368 on 7
Player [7] submitted reverse resolve query
Player  [7] inbound UDP up 69.79.205.190:1368 actual 1368
Player [7] resolved to Dynamic-IP-6979205190.cable.net.co
Player  [7] outbound UDP up
Player Karies [7] sent version string: 2.0.2.20050318-STABLE-W32VC71
Time elapsed: 8.6e-05 seconds
Player Karies [7] has joined from 69.79.205.190 at 2005-09-03 18:15:04 with token ""
Queuing ADD message to list server
Player Karies [7] removed at 2005-09-03 18:15:04: There a league match in progress. Please join observer.
There is a message already queued to the list server: not sending this one yet.
Segmentation fault (core dumped)
linux:/home/death # rpm -q --queryformat '==name\n%{NAME}\n==version\n%{VERSION}\n==release\n%{RELEASE}\n==summary\n%{SUMMARY}\n==group\n%{GROUP}\n==distribution\n%{DISTRIBUTION}\n==vendor\n%{VENDOR}\n==packager\n%{PACKAGER}\n==installtime\n%{INSTALLTIME:date}\n==buildtime\n%{BUILDTIME:date}\n==size\n%{SIZE}\n==provides\n[%{PROVIDES}, ]\n==requires\n[%{REQUIRENAME} (%{REQUIREFLAGS:depflags} %{REQUIREVERSION}), ]\n==description\n[%{DESCRIPTION}]\n==\n' MPlayer;echo RESULT=$?
linux:/home/death # gdb --core=core
GNU gdb 6.2.1
Copyright 2004 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 "i586-suse-linux".
Core was generated by `./bzfs -conf redvsblue.conf'.
Program terminated with signal 11, Segmentation fault.
#0  0x403db072 in ?? ()
(gdb) file /home/death/bzflag/bin/bzfs
Reading symbols from /home/death/bzflag/bin/bzfs...done.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) bt
#0  0x403db072 in ?? ()
#1  0xbfffe650 in ?? ()
#2  0xbfffe654 in ?? ()
#3  0x082c9000 in ?? ()
#4  0x4039aff4 in ?? ()
#5  0x40016cc0 in ?? ()
#6  0xbfffe7d0 in ?? ()
#7  0xbfffe698 in ?? ()
#8  0x0816a92b in WorldEventManager::callEvents (this=0x403e0d6c, eventType=3221219024, eventData=0x6) at WorldEventManager.cxx:97
#9  0x0816a92b in WorldEventManager::callEvents (this=0x8282fd8, eventType=bz_ePlayerJoinEvent, eventData=0xbfffe6d0) at WorldEventManager.cxx:97
#10 0x08189640 in addPlayer (playerIndex=7, playerData=0x82d4c28) at bzfs.cxx:1632
#11 0x08190a47 in doStuffOnPlayer (playerData=@0x82d4c28) at bzfs.cxx:3758
#12 0x081943ab in main (argc=3, argv=0xbffff1d4) at bzfs.cxx:4455
(gdb) quit
linux:/home/death #   
Nevermind the --rpm crap mid note there, i was sifting through my terminal history looking for a prior instand of gdb, but I got it handled, as you see.

Posted: Sat Sep 03, 2005 10:23 pm
by I_Died_Once
Oh yeah, that is with today's CVS, red vs blue, with a bunch of other plugins loaded.

Posted: Sat Sep 03, 2005 10:32 pm
by I_Died_Once
This is the same config but with only airspawn, bzfscron, and the race plugin. I changed the capNum to 1 for fast testing.

Code: Select all

Player  [7] inbound UDP up 69.196.191.12:4448 actual 4448
Player [7] resolved to CPE0008749a3a23-CM00080d51cc4c.cpe.net.cable.rogers.com
Player  [7] outbound UDP up
Player asshat [7] sent version string: 2.0.3.20050826-DEVEL-W32VC71
Time elapsed: 8.2e-05 seconds
Player asshat [7] has joined from 69.196.191.12 at 2005-09-03 18:28:17 with token ""
Queuing ADD message to list server
Player asshat [7] removed at 2005-09-03 18:28:17: There a league match in progress. Please join observer.
There is a message already queued to the list server: not sending this one yet.
Segmentation fault (core dumped)
linux:/home/death #
linux:/home/death # gdb --core=core
GNU gdb 6.2.1
Copyright 2004 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 "i586-suse-linux".
Core was generated by `./bzfs -conf redvsblue.conf'.
Program terminated with signal 11, Segmentation fault.
#0  0x403db072 in ?? ()
(gdb) file /home/death/bzflag/bin/bzfs
Reading symbols from /home/death/bzflag/bin/bzfs...done.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) bt
#0  0x403db072 in ?? ()
#1  0xbfffe650 in ?? ()
#2  0xbfffe654 in ?? ()
#3  0x082b1f70 in ?? ()
#4  0x4039aff4 in ?? ()
#5  0x40016cc0 in ?? ()
#6  0xbfffe7d0 in ?? ()
#7  0xbfffe698 in ?? ()
#8  0x0816a92b in WorldEventManager::callEvents (this=0x403e0d6c, eventType=3221219024, eventData=0x6) at WorldEventManager.cxx:97
#9  0x0816a92b in WorldEventManager::callEvents (this=0x8282fd8, eventType=bz_ePlayerJoinEvent, eventData=0xbfffe6d0) at WorldEventManager.cxx:97
#10 0x08189640 in addPlayer (playerIndex=7, playerData=0x82e3550) at bzfs.cxx:1632
#11 0x08190a47 in doStuffOnPlayer (playerData=@0x82e3550) at bzfs.cxx:3758
#12 0x081943ab in main (argc=3, argv=0xbffff1d4) at bzfs.cxx:4455
(gdb)   
That's be and a handful of bots, and someone joined & it crashed.

Posted: Sat Sep 03, 2005 11:00 pm
by RPG
Since this never happened before, and I didn't change anything around the "kick new players" part, I'm guessing it's CVS. Or another plugin. Once again, if you really have spare time, run JUST the racetoseven plugin and see what happens.

Posted: Sat Sep 03, 2005 11:03 pm
by I_Died_Once

Code: Select all

Player  [0] removed at 2005-09-03 18:58:58: Disconnected
Queuing ADD message to list server
Player [0] accept() from 69.28.129.166:40109 on 5
Player [0] submitted reverse resolve query
Player  [0] removed at 2005-09-03 18:58:58: Disconnected
Player [0] accept() from 192.168.1.1:42312 on 5
Player [0] submitted reverse resolve query
Player  [0] inbound UDP up 192.168.1.1:42312 actual 42312
Player  [0] outbound UDP up
Player [0] failed to resolve: error 4
Player Darth Vader [0] sent version string: 2.0.3.20050821-DEVEL-linux-SDL
Time elapsed: 0.000493 seconds
Player Darth Vader [0] has joined from 192.168.1.1 at 2005-09-03 18:59:02 with token "1017897362"
Queuing ADD message to list server
Player [1] accept() from 69.28.129.166:40114 on 7
Player [1] submitted reverse resolve query
Player  [1] removed at 2005-09-03 18:59:02: Disconnected
Got: TOKGOOD: Darth Vader:MoFo.Admin:MoFo.Cop
Identify DARTH VADER
Queuing ADD message to list server
Player [1] accept() from 69.28.129.166:40117 on 7
Player [1] submitted reverse resolve query
Player  [1] removed at 2005-09-03 18:59:03: Disconnected
Player Darth Vader [0] -> All: /match end
Segmentation fault (core dumped)
linux:/home/death # gdb --core=core
GNU gdb 6.2.1
Copyright 2004 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 "i586-suse-linux".
Core was generated by `./bzfs -conf redvsblue.conf'.
Program terminated with signal 11, Segmentation fault.
#0  0x08101c0c in ?? ()
(gdb) file /home/death/bzflag/bin/bzfs
Reading symbols from /home/death/bzflag/bin/bzfs...done.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) bt
#0  0x08101c0c in bzApiString::c_str (this=0x4) at bzfsAPI.cxx:211
#1  0x403da342 in ?? ()
#2  0x00000004 in ?? ()
#3  0x403db905 in ?? ()
#4  0x00000000 in ?? ()
#5  0x403de386 in ?? ()
#6  0xbfffe3e0 in ?? ()
#7  0x400c254c in ?? ()
#8  0x00000003 in ?? ()
#9  0x0817f53e in parseServerCommand (message=0x82deaac "/match end", t=0) at commands.cxx:2764
#10 0x08187066 in sendPlayerMessage (playerData=0x82cfe48, dstPlayer=254 '', message=0x82deaac "/match end") at bzfs.cxx:971
#11 0x0818ed64 in handleCommand (t=0, rawbuf=0x82ddaec, udp=false) at bzfs.cxx:3278
#12 0x081900d3 in handleTcp (netPlayer=@0x82ddaa8, i=0, e=ReadAll) at bzfs.cxx:3653
#13 0x08147299 in GameKeeper::Player::handleTcpPacket (this=0x82cfe48, set=0xbffff040) at GameKeeper.cxx:309
#14 0x08195fbf in main (argc=3, argv=0xbffff1d4) at bzfs.cxx:4803
(gdb)      
Thats the racetoseven by itself. The allowplayersduringmatch option is funky, and I don't think it works, or it is backwards, and it don't work all the time. Hows about that?

Posted: Sat Sep 03, 2005 11:14 pm
by I_Died_Once
Well here is a valgrind report in case someone wants to point RPG in the right direction...

Posted: Sat Sep 03, 2005 11:37 pm
by RPG
-allowPlayersDuringMatch is a variable, allow_players, and that variable is either set to true or false. I have no clue on this one. Can someone inspect the source of the plugin for any memory leaks?

Posted: Sun Sep 04, 2005 4:52 am
by DTRemenak
Memory leaks do not cause crashes. Invalid reads, on the other hand...

==27495== Invalid read of size 1
==27495== at 0x1B909072: RaceToSevenAutomatic::process(bz_EventData*) (in /home/death/bzflag/plugins/racetoseven/racetoseven.so)
==27495== by 0x816A92A: WorldEventManager::callEvents(bz_eEventType, bz_EventData*) (WorldEventManager.cxx:97)
==27495== by 0x818963F: addPlayer(int, GameKeeper::Player*) (bzfs.cxx:1632)
==27495== by 0x8190A46: doStuffOnPlayer(GameKeeper::Player&) (bzfs.cxx:3758)
==27495== by 0x81943AA: main (bzfs.cxx:4455)
==27495== Address 0x2F is not stack'd, malloc'd or (recently) free'd

And from the code

Code: Select all

		bz_PlayerRecord *data = bz_getPlayerByIndex(playerID);

		if((team_id == eRogueTeam || team_id == eRedTeam || team_id == eGreenTeam || team_id == eBlueTeam || team_id == ePurpleTeam) && !data->admin && !allow_players){
And from the documentation
WARNING: this function CAN and WILL return NULL in certain situations. Always check for NULL before dereferencing the result of this function, otherwise your plugin may crash the server.
Which is EXACTLY what it did :)

If you can't figure it out...data is a NULL pointer in this crash. "!data->admin" dereferences data ("thing->other" does the same as "(*thing).other"), which causes a crash (invalid dereference). You need to check to see if data is NULL and do something appropriate in that case (I haven't read the code, I don't know what would be appropriate).

Posted: Sun Sep 04, 2005 5:59 pm
by I_Died_Once

Code: Select all

(gdb) bt
#0  0x403db4c2 in ?? ()
#1  0x00000005 in ?? ()
#2  0x0817f53e in parseServerCommand (message=0x82cb5dc "/match start", t=0) at commands.cxx:2764
#3  0x08187066 in sendPlayerMessage (playerData=0x82c3a60, dstPlayer=254 '', message=0x82cb5dc "/match start") at bzfs.cxx:971
#4  0x0818ed64 in handleCommand (t=0, rawbuf=0x82cda14, udp=false) at bzfs.cxx:3278
#5  0x081900d3 in handleTcp (netPlayer=@0x82cd9d0, i=0, e=ReadAll) at bzfs.cxx:3653
#6  0x08147299 in GameKeeper::Player::handleTcpPacket (this=0x82c3a60, set=0xbffff040) at GameKeeper.cxx:309
#7  0x08195fbf in main (argc=3, argv=0xbffff1d4) at bzfs.cxx:4803
(gdb)                                                                 

Posted: Fri Sep 09, 2005 10:05 pm
by ts
I compiled a Mac version of it. Note that this will not work with a stripped version of bzfs, AFAIR.

Now I have two heroes

Posted: Fri Sep 09, 2005 11:09 pm
by optic delusion
Now I have two heroes, learner and toughshooter.
Can't test till tomorrow though.

Speaking of tests, toughshooter, did you know RPG is creating a newer version for today's API, right now.

Posted: Fri Sep 09, 2005 11:16 pm
by RPG
ToughShooter
Great effort, but we're on API 12 now :oops:

What movie is this from?

Posted: Sat Sep 10, 2005 4:23 pm
by optic delusion
I'm trying to figure out what movie this is from. I'm thinking Animal House, but I know that's wrong.

A kid is in the principal's office, getting a paddling.
Every time he gets smacked, he has to say...
"Thank You Sir, May I Have Another?"

I must have had a premonition when I chose that avatar.

Posted: Sat Sep 10, 2005 10:05 pm
by RPG
I found this strange API bug. bz_format turns "5" into "1235467". So, if you have -capnum 5 in your config file, the plugin will say "First team to 1235467 captures wins!". Gotta resolve that before another one can be released.