Sauerbraten engine development |
by Aardappel
on 03/03/2004 05:18, 1571 messages, last message: 03/14/2008 18:53, 1351318 views, last view: 12/09/2021 06:26 |
 |
|
This thread is for discussion of Sauerbraten coding issues / implementation ideas etc.
|
 |
|

Board Index

|
 |
#1495: My sauer-map utility |
|
by xoltra
on 06/18/2006 07:17
|
 |
|
I've recently completed a utility that provides a command line means of querying and manipulating Sauerbraten maps. Hopefully it will be useful to developers and mappers. You can find it here:
http://home.austin.rr.com/selliott4/sauer-map
Feel free to send me any comments or questions that you might have.
reply to this message
|
 |
#1496: Small change |
|
by virtualblackfox
on 06/18/2006 17:58
|
 |
|
Here is a small change to sicompare function in serverbrowser.cpp
-----
int sicompare(const serverinfo *a, const serverinfo *b)
{
//Servers with a good version appears before others
if ( (a->attr.ulen > 0) && (b->attr.ulen > 0))
{
if ( (a->attr[0] == PROTOCOL_VERSION) && (b->attr[0] != PROTOCOL_VERSION) )
return -1;
if ( (a->attr[0] != PROTOCOL_VERSION) && (b->attr[0] == PROTOCOL_VERSION) )
return 1;
}
return a->ping>b->ping ? 1 : (a->ping<b->ping ? -1 : strcmp(a->name, b->name));
};
-----
Just to make servers you could connect to apears first.
I haven't been able to find a Mailling list or something like that for dev issues so i post here.
reply to this message
|
 |
#1497: Client/Server crashes |
|
by guest57
on 06/18/2006 18:35
|
 |
|
Can someone please focus on the robustness of the network code to ensure that clients can't crash the server or other clients - cheats are an annoyance, but these loosers are a problem when they can crash other machines! I'll try and catch some examples...
- aka rpointon
reply to this message
|
 |
#1498: Re: Client/Server crashes |
|
by eihrul
on 06/18/2006 19:27, refers to #1497
|
 |
|
Unless you send us a stack trace (which is even conveniently printed for you on the Windows version), we can't fix it, because we don't know what the problem is.
reply to this message
|
 |
#1499: .. |
|
by virtualblackfox
on 06/18/2006 19:56
|
 |
|
I got a crash today in the assert of
T &operator[](int i) { ASSERT(i>=0 && i<ulen); return buf[i]; };
in tools.h
The cause seemed to be that i was in coopedit and have "/getmap" then a SV_ITEMPICKUP arrived ... tryed to itemname() and boom...
It seem possible that as not all ppl on a coop-edit map see the same items a SV_ITEMPICKUP could arrive on a "not existing for me" item.
I think that someone that want to crash other clients could craft such a packet.
reply to this message
|
 |
#1500: Re: .. |
|
by eihrul
on 06/18/2006 20:12, refers to #1499
|
 |
|
I cleaned that up, thanks.
reply to this message
|
 |
#1501: Re: .. |
|
by xoltra
on 06/18/2006 21:02, refers to #1499
|
 |
|
I saw that one, and I should have told the list. They can easily craft such an attack by creating a map that has extra entities (the person who crashed my client only wanted to cheat by having extra health boosts, not to crash my client).
So, I'm glad its fixed (otherwise I would not have provided clues as to how it can be exploited in the above). In general any time anything is sent through the network (client to server, or vice versa) that is an index into any sort of array that value should be checked (I realize I may be stating the obvious, but it may be a good place to start if someone wants to search through the code).
reply to this message
|
 |
#1502: Just getting started with source |
|
by Pxtl
on 06/19/2006 20:09
|
 |
|
I was gonna tinker with the source, but I can't get the thing to compile under VC Express. The linker keeps complaining about missing symbols for the Windows stuff. Any idea what version of the Windows SDK I'm supposed to be using for this?
reply to this message
|
 |
#1503: Re: Just getting started with source |
|
by Passa
on 06/19/2006 23:10, refers to #1502
|
 |
|
I gave up with VC Express and *cough* 'bought' a copy of Visual Studio 2005.
reply to this message
|
 |
#1504: Re: Just getting started with source |
|
by Pxtl
on 06/19/2006 23:28, refers to #1503
|
 |
|
Nuts. I think I'm close - I got it linking against the Windows SDK (a whole gig download) but it still complains about those symbols. Wouldn't that only happen if the header didn't match up with the libs? But I've got it pointing to all the SDK stuff. So I'm confused.
reply to this message
|
 |
#1505: Server crash |
|
by virtualblackfox
on 06/20/2006 01:31
|
 |
|
Today i had a crash to my server do to a cheater, here is what appened :
---------------------------
client connected (168-103-233-110.ptld.qwest.net)
[NewPlayer] Name: Paul
status: 6 remote clients, 13.2 send, 2.7 rec (K/sec)
[MapChange] New map:
[Chat] . : gg
[Chat] . : lol
status: 6 remote clients, 14.2 send, 2.8 rec (K/sec)
[MapChange] New map:
status: 6 remote clients, 17.1 send, 3.4 rec (K/sec)
status: 6 remote clients, 17.8 send, 3.5 rec (K/sec)
disconnected client
[MapChange] New map:
status: 5 remote clients, 11.0 send, 2.7 rec (K/sec)
[MapChange] New map:
status: 5 remote clients, 9.9 send, 2.4 rec (K/sec)
status: 5 remote clients, 9.8 send, 2.4 rec (K/sec)
[MapChange] New map:
status: 5 remote clients, 9.3 send, 2.3 rec (K/sec)
[MapChange] New map:
status: 5 remote clients, 9.0 send, 2.2 rec (K/sec)
status: 5 remote clients, 8.6 send, 2.1 rec (K/sec)
status: 5 remote clients, 8.3 send, 2.0 rec (K/sec)
status: 5 remote clients, 9.0 send, 2.2 rec (K/sec)
client connected
[NewPlayer] Name: Homo
disconnected client
disconnected client
client connected
[NewPlayer] Name: .
status: 5 remote clients, 10.0 send, 2.2 rec (K/sec)
[MapChange] New map:
disconnected client
status: 4 remote clients, 8.4 send, 2.3 rec (K/sec)
client connected
[NewPlayer] Name: Rareware
sending request to sauerbraten.org...
masterserver reply:
your server was registered
[NameChange] Rareware -> Homonculus
[MapChange] New map:
status: 5 remote clients, 9.5 send, 2.5 rec (K/sec)
[Chat] . : paul you are a cheater
[Chat] Homonculus : goddamn respawn limit
[Chat] Homonculus : >:I
[Chat] Homonculus : this is retarded :3
status: 5 remote clients, 11.2 send, 2.8 rec (K/sec)
[Chat] . : dnx, kick paul please
disconnected client
[MapChange] New map:
[Chat] . : paul go home
status: 4 remote clients, 8.8 send, 2.6 rec (K/sec)
[Chat] Paul : sorry
status: 4 remote clients, 7.1 send, 2.3 rec (K/sec)
[MapChange] New map:
disconnected client
client connected
[NewPlayer] Name: .
disconnected client
client connected
[NewPlayer] Name: .
disconnected client
status: 3 remote clients, 6.1 send, 2.0 rec (K/sec)
client connected
[NewPlayer] Name: .
client connected
[NewPlayer] Name: unnamed
status: 5 remote clients, 7.2 send, 2.1 rec (K/sec)
[Chat] . : /kick Paul
[Chat] . : doesn't work :(
[MapChange] New map:
status: 5 remote clients, 9.8 send, 2.4 rec (K/sec)
[Kick] dnx
client (168-103-233-110.ptld.qwest.net) disconnected because: kicked/banned
disconnected client (168-103-233-110.ptld.qwest.net)
---------------------------
My server does some printf on events so you could see what appened.
After the last line (dnx having kicked the cheater) the server crash with this stack trace :
---------------------------
sauerbraten_debug.exe!fpsserver::captureserv::movebases(const char * team=0x00000108, const vec & oldpos={...}, const vec & newpos={...}) Line 381 + 0x3 bytes C++
sauerbraten_debug.exe!fpsserver::captureserv::leavebases(const char * team=0x00000108, const vec & o={...}) Line 396 C++
sauerbraten_debug.exe!fpsserver::clientdisconnect(int n=0) Line 596 C++
sauerbraten_debug.exe!serverslice(int seconds=1150756441, unsigned int timeout=5) Line 439 + 0x1c bytes C++
sauerbraten_debug.exe!initserver(bool dedicated=true) Line 532 + 0x12 bytes C++
---------------------------
When i break i see some things :
"char * team=0x00000108" is an invalid adress (just a function offset on NULL pointer) due to the fact that getinfo returned NULL (because clients[i]->type==ST_EMPTY).
So we have a playing client (num=0) that had type==ST_EMPTY but i don't known how he managed to do that. Also note that if m_capture has been false no crash would have hapened.
I don't known if it was something wanted by the cheater by some reason or if it is just a random bug that hapenned to a cheater but could have hapenned to everyone.
Just adding a "if (ci == NULL) return;" could solve this particular problem but it think that maybe it is a chance to find the root cause.
I will let my debugger breaked on this error till tomorrow so if you have questions about the program state just ask (too late for me to do debugging :D)
reply to this message
|
 |
#1506: Re: Server crash |
|
by Passa
on 06/20/2006 02:19, refers to #1505
|
 |
|
That guy was hacking on my server too. And thats a bug with the current binaries, luckily I got a patch for Windows for my server, so if you guys want a more stable server, head over to mine for now, or ask eihrul to give you a patch.
Thats the same IP of the guy who was hacking for me. Hes a dumbshit, he just got that downloadable hack that someone posted a link to.
reply to this message
|
 |
#1507: .. |
|
by virtualblackfox
on 06/20/2006 09:33
|
 |
|
I patched with the changes in CVS i hope that the correction was commited.
Anyway eihrul i will be happy to known from where this crash really come from.
For the cheaters i don't mind them to connect to my server because most of the time waiting a few minutes is enough to see them go but if they crash the server it really annoy me :-D.
reply to this message
|
 |
#1508: Re: .. |
|
by eihrul
on 06/20/2006 09:37, refers to #1507
|
 |
|
CVS isn't compatible with the release, nor is it compatible with itself from day to day currently. Careful with that.
reply to this message
|
 |
#1509: .. |
|
by virtualblackfox
on 06/20/2006 09:49
|
 |
|
I know i cherry-pick the changes :D (Even if CVS is not very suited to that)
Any plan to switch at least to SVN (As sourceforge support it) ? or even better SVK or Bazaar-NG ?
reply to this message
|
 |
#1510: Re: Server crash |
|
by hampus_
on 06/20/2006 11:44, refers to #1506
|
 |
|
You could block his IP in your firewall.
reply to this message
|
 |
#1511: Re: Server crash |
|
by Passa
on 06/20/2006 12:49, refers to #1510
|
 |
|
Hey, who removed the IP address from the post? :P
Nice idea hampus, I will try that.. once I install a firewall on the server :S
reply to this message
|
 |
#1512: .. |
|
by virtualblackfox
on 06/20/2006 13:20
|
 |
|
Ok after some test kicking someone in capture make the server crash everytime it seem :D
reply to this message
|
 |
#1513: another crash |
|
by absinth
on 06/20/2006 13:29
|
 |
|
Thread 0 Crashed:
0 libSystem.B.dylib 0x900037a8 szone_malloc + 240
1 libSystem.B.dylib 0x90003380 malloc + 632
2 sauerbraten 0x0004099c enet_malloc + 32 (callbacks.c:36)
3 sauerbraten 0x000413b0 enet_packet_create + 64 (packet.c:30)
4 sauerbraten 0x00043ad8 enet_host_service + 2580 (protocol.c:431)
5 sauerbraten 0x00004d30 gets2c() + 624 (client.cpp:191)
6 sauerbraten 0x000718fc fpsclient::updateworld(vec&, int, int) + 5844 (fps.cpp:184)
reply to this message
|
 |
#1514: Re: .. |
|
by Passa
on 06/20/2006 13:49, refers to #1512
|
 |
|
Yeah its a bug with the current release. Server crashes, that is.
reply to this message
|
 |
 |
|

Board Index

|
 |