View Issue Details

IDProjectCategoryView StatusLast Update
0004034unrealircdpublic2012-08-17 13:12
ReporterJerVoo Assigned To 
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionno change required 
Product Version3.2.8 
Summary0004034: Crash on server connect
DescriptionSo I've been creating a bot for my server, which connects as a server (e.g. like services), but Unreal crashes the moment I connect.

Data comes through perfectly. All TKLs, users and server info are sent to the bot, but even before noticing me that the bot's server has connected, Unreal just crashes.
Steps To ReproduceReproducing isn't easy, the bot has been written in C# and needs an awful lot of files. I can upload the code on request, tho.
3rd party modules

Activities

JerVoo

2011-07-20 00:31

reporter   ~0016721

I must add: I've tried it on Unreal 3.2.8 on Windows as well as on Linux, so it's not OS-related.

syzop

2011-07-20 11:04

administrator   ~0016722

On Linux, you can run './unreal backtrace' which will give a lot more information on the crash, such as a backtrace and the exact command that caused it.

On Windows you can see similar information in the wircd.<number>.core files.

Most likely your server (as we may call it, since it's connected as a server) is sending some incorrect line which causes the server to crash, this is possible as server-to-server traffic is considered trusted and has less checks.
Previously we even had a policy of not doing any checks on server-to-server traffic, for performance, but that's no longer an issue in todays world.

JerVoo

2011-07-20 12:32

reporter   ~0016723

=================== START HERE ======================
BACKTRACE:
Core was generated by `/root/ircd2/src/ircd'.
Program terminated with signal 6, Aborted.
#0 0xb781d424 in __kernel_vsyscall ()
#0 0xb781d424 in __kernel_vsyscall ()
#1 0xb74e7df0 in raise () from /lib/libc.so.6
#2 0xb74e9701 in abort () from /lib/libc.so.6
#3 0x0808d1dc in decode_ip (buf=0x8444a54 "bot.failIRC.nl") at support.c:1944
#4 0xb7314e52 in _register_user (cptr=0x8444910, sptr=0x8414770,
    nick=0x8414799 "qwerty", username=0x8444a0d "qwerty",
    umode=0x8444a33 "+iowghaAsOVSxNCWqBzvHtp", virthost=0x8444a4b "kcfvGqso",
    ip=0x8444a54 "bot.failIRC.nl") at m_nick.c:1164
#5 0xb7317945 in m_user (cptr=0x8444910, sptr=0x8414770, parc=9,
    parv=0x8124e6c) at m_user.c:215
#6 0xb7316370 in m_nick (cptr=0x8444910, sptr=0x8414770, parc=12,
    parv=0x8124e60) at m_nick.c:777
#7 0x08068b0f in parse (cptr=0x8444910, buffer=0x84449f4 "NICK",
    bufend=0x8444a7c "") at parse.c:440
0000008 0x08067df4 in dopacket (cptr=0x8444910,
    buffer=0x80b8020 "\nNICK qwerty 0 1311113939 qwerty bot.failIRC.nl bot.jervo o.nl 0 +iowghaAsOVSxNCWqBzvHtp kcfvGqso bot.failIRC.nl :Qwerty - The Bot [C# v1] \r\n:qwerty JOIN #Services\r\nrty - The Bot [C# v1]\r\n:qwerty JOIN #"...,
    length=25) at packet.c:138
#9 0x08058dad in read_packet (delay=1, listp=0x813c960) at s_bsd.c:1485
---Type <return> to continue, or q <return> to quit---
#10 read_message (delay=1, listp=0x813c960) at s_bsd.c:1978
#11 0x08063457 in main (argc=1311113947, argv=<value optimized out>)
    at ircd.c:1793

#0 0xb781d424 in __kernel_vsyscall ()

0x8140c00 <backupbuf>: "NICK qwerty 0 1311113939 qwerty bot.failIRC.nl bot.jervoo.nl 0 +iowghaAsOVSxNCWqBzvHtp kcfvGqso bot.failIRC.nl :Qwerty - The Bot [C# v1]"

#0 0xb781d424 in __kernel_vsyscall ()
No symbol table info available.
#1 0xb74e7df0 in raise () from /lib/libc.so.6
No symbol table info available.
#2 0xb74e9701 in abort () from /lib/libc.so.6
No symbol table info available.
GCC: gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)
UNAME: Linux vps.jervoo.nl 2.6.36 #4 SMP Sat Nov 6 13:22:47 UTC 2010 i686 i686 i386 GNU/Linux
UNREAL: Unreal3.2.8.1 build 1.1.1.1.2.26 2009/04/13 11:03:55
CORE: -rw------- 1 root root 1806336 Jul 20 00:19 core.18854
=================== STOP HERE ======================

syzop

2011-07-20 17:33

administrator   ~0016726

Ah ok, you are even hitting a deliberate abort() in decode_ip() ;)

ip=0x8444a54 "bot.failIRC.nl"
there's your problem. we expect a base64 encoded IP here, not a hostname.
See doc/technical/serverprotocol.html for details

JerVoo

2011-07-20 17:41

reporter   ~0016727

Since it's the nick-message, it can also be a hostname.
I already have a PHP-version running, which sends

NICK <nick> 0 <timestamp> <ident> bot.failIRC.nl <server> +<modes> bot.failIRC.nl :<realname>

with no encoding whatsoever. So that doesn't sounds logic to me.

syzop

2012-08-17 13:12

administrator   ~0017078

Invalid server traffic caused by a connected (and fully authenticated) server. These don't have priority for us. Instead, fix the server.

Issue History

Date Modified Username Field Change
2011-07-20 00:30 JerVoo New Issue
2011-07-20 00:31 JerVoo Note Added: 0016721
2011-07-20 11:04 syzop Note Added: 0016722
2011-07-20 12:32 JerVoo Note Added: 0016723
2011-07-20 17:33 syzop Note Added: 0016726
2011-07-20 17:41 JerVoo Note Added: 0016727
2012-08-17 13:12 syzop Note Added: 0017078
2012-08-17 13:12 syzop Status new => closed
2012-08-17 13:12 syzop Resolution open => no change required