[IRCServices] Compiling and Crashing on boot under Solaris 9

Kevin Kane kane at firelion.org
Sun Jun 8 12:22:33 PDT 2003


I am attempting to use IRC Services 5.0.19.

The IRCD is Unreal3.2-beta16cvs20030527.

I have successfully been using IRC Services 5.0.16 with this server,
although I had to do similar tinkering as mentioned below to get it to
compile.  But since compiled, no problems.

The server is an UltraSPARC 1 (sun4u) running Solaris 9.  Compiler is GCC
3.2.2.

First, I had to add a -libs parameter to configure with "-lsocket -lnsl
-lresolv" so that it would find hstrerror() and gethostbyname().  It seems
to figure out that it needs -lsocket on its own, so I probably don't have
to add it myself, but I did just to be sure.  It refuses to compile
dynamic modules, but I didn't care enough to try and correct that.  I also
had to tell Make to be sure to use bash as the shell, instead of Solaris'
braindead /bin/sh by adding a SHELL=/usr/local/bin/bash parameter to the
make command.  After that it compiles fine.  It still complains that it
cannot find strtok, although this isn't fatal.  Solaris does seem to have
this function, however.  Here is the relevant snippet from the
configure.log when it attempts to locate strtok:
 --
check_strtok    : >>> gcc -O2 -fno-strict-aliasing conf-tmp/test.c
-lsocket -lsocket -lnsl -lresolv -ldl -o conf-tmp/test
conf-tmp/test.c: In function `main':
conf-tmp/test.c:8: warning: comparison between pointer and integer
conf-tmp/test.c:10: warning: comparison between pointer and integer
conf-tmp/test.c:12: warning: comparison between pointer and integer
conf-tmp/test.c:14: warning: comparison between pointer and integer
conf-tmp/test.c:16: warning: comparison between pointer and integer
conf-tmp/test.c:18: warning: comparison between pointer and integer
conf-tmp/test.c:20: `buf4' undeclared (first use in this function)
conf-tmp/test.c:20: (Each undeclared identifier is reported only once
conf-tmp/test.c:20: for each function it appears in.)
conf-tmp/test.c:20: warning: comparison between pointer and integer
conf-tmp/test.c:22: warning: comparison between pointer and integer
check_strtok    : *** Command failed (exit code 1)
check_strtok    : didn't find strtok
 --

While I'm at it, I might as well clip out the section of log of its
attempt to use dynamic modules.  But as advertised, things have worked
fine in the past without dynamic modules:
 --
check_shared    : found dlfcn.h in /usr/include
check_shared    : testing dlfcn method
check_shared    : >>> gcc -O2 -fno-strict-aliasing -lsocket -lsocket -lnsl
-lresolv -ldl conf-tmp/test-dlopen.c -o conf-tmp/test
check_shared    : dlopen() found (no libs)
check_shared    : >>> gcc -rdynamic -O2 -fno-strict-aliasing -lsocket
-lsocket -lnsl -lresolv -ldl conf-tmp/test-dlopen.c -o conf-tmp/test
gcc: unrecognized option `-rdynamic'
check_shared    : -rdynamic works
check_shared    : >>> gcc -shared -O2 -fno-strict-aliasing -lsocket
-lsocket -lnsl -lresolv -ldl conf-tmp/test-lib.c -o conf-tmp/test-lib.so
Text relocation remains                         referenced
    against symbol                  offset      in file
no_such_symbol                      0x0         /var/tmp//cccAI8HB.o
no_such_symbol                      0x4         /var/tmp//cccAI8HB.o
ld: fatal: relocations remain against allocatable but non-writable
sections
collect2: ld returned 1 exit status
check_shared    : *** Command failed (exit code 1)
check_shared    : no -shared, aborting dlfcn test
check_shared    : static modules selected
 --



The crash occurs on starting services whenever there are database files
present.  It starts successfully the first time ever, when no databases
yet exist.

I have attempted two scenarios.  I will include the verbose log entries
and the backtrace from gdb for both circumstances.



SCENARIO 1.  IRC Services was already started with no database files
present, so that it created blank files.  Services is gracefully shut down
with SIGTERM (leaving new db files behind), and then restarted.  It
segmentation faults and dumps core.

Log file contents:
 --
[Jun 08 12:52:14.090067 2003] IRC Services 5.0.19 starting up (options:
debug)
[Jun 08 12:52:14.092986 2003] debug: Loading language 0 from file
`languages/en_us'
[Jun 08 12:52:14.240809 2003] debug: Loading language 10 from file
`languages/nl'
[Jun 08 12:52:14.384819 2003] debug: Loading language 6 from file
`languages/fr'
[Jun 08 12:52:14.538818 2003] debug: Loading language 9 from file
`languages/de'
[Jun 08 12:52:14.688365 2003] debug: Loading language 11 from file
`languages/hu'
[Jun 08 12:52:14.835368 2003] debug: Loading language 8 from file
`languages/it'
[Jun 08 12:52:14.946416 2003] debug: Loading language 2 from file
`languages/ja_euc'
[Jun 08 12:52:15.108724 2003] debug: Loading language 3 from file
`languages/ja_sjis'
[Jun 08 12:52:15.255023 2003] debug: Loading language 5 from file
`languages/pt'
[Jun 08 12:52:15.376611 2003] debug: Loading language 4 from file
`languages/es'
[Jun 08 12:52:15.527586 2003] debug: Loading language 7 from file
`languages/tr'
[Jun 08 12:52:15.671046 2003] debug: Loaded languages
[Jun 08 12:52:15.672898 2003] debug: Loading module `protocol/unreal'
[Jun 08 12:52:15.681838 2003] debug: Successfully loaded module
`protocol/unreal'
[Jun 08 12:52:15.683772 2003] debug: Loading module `database/version4'
[Jun 08 12:52:15.693401 2003] debug: Successfully loaded module
`database/version4'
[Jun 08 12:52:15.695319 2003] debug: Loading module `mail/main'
[Jun 08 12:52:15.698281 2003] debug: Successfully loaded module
`mail/main'
[Jun 08 12:52:15.700118 2003] debug: Loading module `mail/smtp'
[Jun 08 12:52:15.702835 2003] debug: Successfully loaded module
`mail/smtp'
[Jun 08 12:52:15.704677 2003] debug: Loading module `operserv/main'
[Jun 08 12:52:15.709453 2003] debug: Successfully loaded module
`operserv/main'
[Jun 08 12:52:15.711354 2003] debug: Loading module `operserv/akill'
[Jun 08 12:52:15.715177 2003] debug: Successfully loaded module
`operserv/akill'
[Jun 08 12:52:15.717199 2003] debug: Loading module `operserv/news'
[Jun 08 12:52:15.720836 2003] debug: Successfully loaded module
`operserv/news'
[Jun 08 12:52:15.722642 2003] debug: Loading module `operserv/sessions'
[Jun 08 12:52:15.727185 2003] debug: Successfully loaded module
`operserv/sessions'
[Jun 08 12:52:15.729063 2003] debug: Loading module `operserv/sline'
[Jun 08 12:52:15.733909 2003] debug: Successfully loaded module
`operserv/sline'
[Jun 08 12:52:15.735940 2003] debug: Loading module `nickserv/main'
[Jun 08 12:52:15.742644 2003] debug: Successfully loaded module
`nickserv/main'
[Jun 08 12:52:15.744537 2003] debug: Loading module `nickserv/access'
[Jun 08 12:52:15.750246 2003] debug: Successfully loaded module
`nickserv/access'
[Jun 08 12:52:15.752109 2003] debug: Loading module `nickserv/autojoin'
[Jun 08 12:52:15.757868 2003] debug: Successfully loaded module
`nickserv/autojoin'
[Jun 08 12:52:15.759752 2003] debug: Loading module `nickserv/link'
[Jun 08 12:52:15.765427 2003] debug: Successfully loaded module
`nickserv/link'
[Jun 08 12:52:15.767832 2003] debug: Loading module `memoserv/main'
[Jun 08 12:52:15.774760 2003] debug: Successfully loaded module
`memoserv/main'
[Jun 08 12:52:15.776911 2003] debug: Loading module `memoserv/ignore'
[Jun 08 12:52:15.783875 2003] debug: Successfully loaded module
`memoserv/ignore'
[Jun 08 12:52:15.785721 2003] debug: Loading module `statserv/main'
 --

Output from gdb:
 --
> gdb ../bin/ircservices core
GNU gdb 5.3
Copyright 2002 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 "sparc-sun-solaris2.9"...
Core was generated by `./ircservices -debug'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/lib/libresolv.so.2...done.
Loaded symbols for /usr/lib/libresolv.so.2
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1...done.
Loaded symbols for /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1
#0  0x0003b380 in load_one_serverstats (f=0x25e468) at version4.c:2163
2163        SAFE(read_int32(&tmp32, f));  /* t_quit */
(gdb) bt
#0  0x0003b380 in load_one_serverstats (f=0x25e468) at version4.c:2163
#1  0x0003b50c in open_statserv_db (dbname=0x25dd78 "stats.db")
    at version4.c:2219
#2  0x00072f6c in init_module_statserv_main (module_=0x0) at main.c:622
#3  0x00023c08 in internal_init_module (module=0x1) at modules.c:363
#4  0x00023ce8 in load_module (modulename=0x1065d0 "statserv/main")
    at modules.c:392
#5  0x0001eb0c in init (ac=2, av=0xffbff74c) at init.c:826
#6  0x00020ec0 in main (ac=2, av=0xffbff74c, envp=0x0) at main.c:192
 --


SCENARIO 2.  IRC Services is started with the database files that have
been correctly working under version 5.0.16.  This time, it reports a bus
error upon booting, and coredumps.  The database files are pretty small
because it's a private server with only a few years -- 3 nicks, no
channels registered, and some logon news.

Output from the log file:
 --
[Jun 08 12:58:35.059589 2003] IRC Services 5.0.19 starting up (options:
debug)
[Jun 08 12:58:35.062554 2003] debug: Loading language 0 from file
`languages/en_us'
[Jun 08 12:58:35.218619 2003] debug: Loading language 10 from file
`languages/nl'
[Jun 08 12:58:35.370950 2003] debug: Loading language 6 from file
`languages/fr'
[Jun 08 12:58:35.525613 2003] debug: Loading language 9 from file
`languages/de'
[Jun 08 12:58:35.688053 2003] debug: Loading language 11 from file
`languages/hu'
[Jun 08 12:58:35.840262 2003] debug: Loading language 8 from file
`languages/it'
[Jun 08 12:58:35.959109 2003] debug: Loading language 2 from file
`languages/ja_euc'
[Jun 08 12:58:36.110231 2003] debug: Loading language 3 from file
`languages/ja_sjis'
[Jun 08 12:58:36.267636 2003] debug: Loading language 5 from file
`languages/pt'
[Jun 08 12:58:36.393828 2003] debug: Loading language 4 from file
`languages/es'
[Jun 08 12:58:36.547625 2003] debug: Loading language 7 from file
`languages/tr'
[Jun 08 12:58:36.707242 2003] debug: Loaded languages
[Jun 08 12:58:36.709075 2003] debug: Loading module `protocol/unreal'
[Jun 08 12:58:36.717808 2003] debug: Successfully loaded module
`protocol/unreal'
[Jun 08 12:58:36.719731 2003] debug: Loading module `database/version4'
[Jun 08 12:58:36.729420 2003] debug: Successfully loaded module
`database/version4'
[Jun 08 12:58:36.731331 2003] debug: Loading module `mail/main'
[Jun 08 12:58:36.734309 2003] debug: Successfully loaded module
`mail/main'
[Jun 08 12:58:36.736161 2003] debug: Loading module `mail/smtp'
[Jun 08 12:58:36.738885 2003] debug: Successfully loaded module
`mail/smtp'
[Jun 08 12:58:36.740750 2003] debug: Loading module `operserv/main'
[Jun 08 12:58:36.745704 2003] debug: Successfully loaded module
`operserv/main'
[Jun 08 12:58:36.747718 2003] debug: Loading module `operserv/akill'
[Jun 08 12:58:36.751530 2003] debug: Successfully loaded module
`operserv/akill'
[Jun 08 12:58:36.753503 2003] debug: Loading module `operserv/news'
[Jun 08 12:58:36.757556 2003] debug: Successfully loaded module
`operserv/news'
[Jun 08 12:58:36.759519 2003] debug: Loading module `operserv/sessions'
[Jun 08 12:58:36.764352 2003] debug: Successfully loaded module
`operserv/sessions'
[Jun 08 12:58:36.766345 2003] debug: Loading module `operserv/sline'
[Jun 08 12:58:36.771531 2003] debug: Successfully loaded module
`operserv/sline'
[Jun 08 12:58:36.773604 2003] debug: Loading module `nickserv/main'
 --

Output from GDB:
 --
GNU gdb 5.3
Copyright 2002 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 "sparc-sun-solaris2.9"...
Core was generated by `./ircservices -debug'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/lib/libresolv.so.2...done.
Loaded symbols for /usr/lib/libresolv.so.2
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1...done.
Loaded symbols for /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1
#0  open_nick_db (dbname=0x1e7820 "nick.db") at version4.c:478
478                 } while (root->last_realmask);
(gdb) bt
#0  open_nick_db (dbname=0x1e7820 "nick.db") at version4.c:478
#1  0x00057688 in init_module_nickserv_main (module_=0xa7c00) at
main.c:1696
#2  0x00023c08 in internal_init_module (module=0x1) at modules.c:363
#3  0x00023ce8 in load_module (modulename=0x106558 "nickserv/main")
    at modules.c:392
#4  0x0001eb0c in init (ac=2, av=0xffbff74c) at init.c:826
#5  0x00020ec0 in main (ac=2, av=0xffbff74c, envp=0x0) at main.c:192
 --

Let me know if you need more information, and thanks.

                      Kevin Kane <kane at firelion.org>