[IRCServices Coding] Services 5.0a22 Segfault on unlink

Russell Garrett rg at tcslon.com
Sat Feb 23 08:30:50 PST 2002


> I guess it could be as simple as "unlink self" causing the crash.
> Hopefully, that will be sufficient information to begin
> tracking down the
> bug, I will try to get a fully reproducible case later.

[16:19:26] -> *nickserv* unlink Russ
[16:19:26] -NickServ- Nick Russ has been unlinked from your nick.
[16:20:57] -> *nickserv* status Russ
[16:20:57] -NickServ- STATUS Russ 0

Here it seems unlinking yourself appears to deregister the nick.

BUT... I reregister my nick:

[16:22:43] -NickServ- Authorization succeeded; your nickname
registration is now complete.
[16:23:02] -> *nickserv* unlink Russ
[16:23:02] -NickServ- Nick Russ has been unlinked from your nick.
*** Routing -- from apollo.final-conflict.net: Server
services.final-conflict.net[unknown at 0.0.0.0] closed the connection

And bang! we have a segfault. The services log is quite cryptic in
saying:

[Feb 23 16:23:02 2002] nickserv/link:

(that's it)

And here's a backtrace:

(gdb) bt
#0  0x40063431 in tmpfile () from /lib/libc.so.6
#1  0x40066724 in freopen64 () from /lib/libc.so.6
#2  0x40061966 in _IO_vfscanf () from /lib/libc.so.6
#3  0x8051430 in vlogprintf (fmt=0x4015d900 "0", args=0xbffff5f8) at
log.c:34
#4  0x8051727 in _module_log (modname=0x81220c0 "nickserv/link",
fmt=0x4015d900 "0") at log.c:189
#5  0x4015d3dd in do_unlink (u=0x812ece0) at link.c:101
#6  0x804df7a in run_cmd (service=0x8120df0 "NickServ", u=0x812ece0,
id=0x811d1c8, cmd=0xbffff72e "unlink") at commands.c:175
#7  0x4014f377 in _init () from
/home/ircservices/modules/nickserv/main.so
#8  0x8053f1d in call_callback_5 (module=0x0, id=26, arg1=0xbffff95c,
arg2=0xbffff724, arg3=0xbffff72e, arg4=0x0, arg5=0x0) at
modules.c:623
#9  0x80521c5 in m_privmsg (source=0xbffff95c "Russ", ac=2,
av=0x812e838) at messages.c:170
#10 0x805447c in process () at process.c:131
#11 0x8051a31 in readline_callback (s=0x812bb70, param_unused=0x24)
at main.c:158
#12 0x80557bf in check_sockets () at sockets.c:375
#13 0x8051c8d in main (ac=1, av=0xbffffb54, envp=0xbffffb5c) at
main.c:255

(this backtrace may be invalid, as I don't have gdb on my services
machine, so I had to copy the files to another box with a slightly
earlier version of services on - it looks ok though)


Russ Garrett (russ at garrett.co.uk)