View Issue Details

IDProjectCategoryView StatusLast Update
0003557unrealircdpublic2009-05-13 06:35
ReporterStealthAssigned Tosyzop 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSFedoraOS Version7
Product Version3.2.7 
Target VersionFixed in Version3.2.9-RC1 
Summary0003557: Crash when reloading modules
DescriptionSo far I have only seen this reproducible on my box.

Crash happens when a module is overwritten with a new compile (example, when upgrading modules), Unreal crashes when rehashing.

This was done on a fresh install
Steps To ReproduceCompile Unreal
Make install
Copy a module from the source to the install (I used cloak.so)
Rehash, either by commandline or as oper
Additional Information=================== START HERE ======================
BACKTRACE:
Using host libthread_db library "/lib/libthread_db.so.1".

warning: Can't read pathname for load map: Input/output error.
Core was generated by `/home/john/Unreal/bin/ircd'.
Program terminated with signal 11, Segmentation fault.
#0 0x00a3d441 in check_match.8200 () from /lib/ld-linux.so.2
#0 0x00a3d441 in check_match.8200 () from /lib/ld-linux.so.2
#1 0x00a3d8bd in do_lookup_x () from /lib/ld-linux.so.2
#2 0x00a3d9e0 in _dl_lookup_symbol_x () from /lib/ld-linux.so.2
#3 0x00b59b30 in do_sym () from /lib/libc.so.6
#4 0x00b59eca in _dl_sym () from /lib/libc.so.6
#5 0x00ba9e28 in dlsym_doit () from /lib/libdl.so.2
#6 0x00a41c36 in _dl_catch_error () from /lib/ld-linux.so.2
#7 0x00baa2ec in _dlerror_run () from /lib/libdl.so.2
0000008 0x00ba9db3 in dlsym () from /lib/libdl.so.2
#9 0x08063ecb in Module_Create (path_=0x8a759b8 "modules/cloak.so") at modules.c:357
#10 0x0806cbc9 in load_conf (filename=0x809ef66 "unrealircd.conf") at s_conf.c:8016
#11 0x0806ce95 in init_conf (rootconf=0x809ef66 "unrealircd.conf", rehash=1) at s_conf.c:1653
#12 0x0806d2d0 in rehash_internal (cptr=0x8a720c0, sptr=0x8a720c0, sig=0) at s_conf.c:9065
#13 0x0806562f in parse (cptr=0x8a720c0, buffer=0x8a721a4 "REHASH", bufend=0x8a721aa "") at parse.c:440
#14 0x08064a21 in dopacket (cptr=0x8a720c0, buffer=0x80af6a0 "REHASH\n", length=0) at packet.c:138
#15 0x08056d84 in read_message (delay=1, listp=0x812e8a0) at s_bsd.c:1504
#16 0x080602dc in main (argc=1198135858, argv=<value optimized out>) at ircd.c:1597

#0 0x00a3d441 in check_match.8200 () from /lib/ld-linux.so.2

0x8132b40 <backupbuf>: "REHASH"

#0 0x00a3d441 in check_match.8200 () from /lib/ld-linux.so.2
No symbol table info available.
#1 0x00a3d8bd in do_lookup_x () from /lib/ld-linux.so.2
No symbol table info available.
#2 0x00a3d9e0 in _dl_lookup_symbol_x () from /lib/ld-linux.so.2
No symbol table info available.
GCC: gcc version 4.1.2 20070925 (Red Hat 4.1.2-27)
UNAME: Linux nobeef.x-tab.org 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:35:01 EDT 2007 i686 athlon i386 GNU/Linux
UNREAL: Unreal3.2.7 build 1.1.1.1.2.1.2.1.2.2234.2.676 2007/07/13 10:43:04
CORE: -rw------- 1 john john 1028096 2007-12-19 23:30 core.12491
=================== STOP HERE ======================
TagsNo tags attached.
3rd party modules

Activities

Bock

2007-12-24 12:08

reporter   ~0014927

yep, I have it too

syzop

2007-12-26 13:15

administrator   ~0014933

Last edited: 2007-12-26 13:16

354: if ((Mod = irc_dlopen(tmppath, RTLD_NOW)))
355: {
356: /* We have engaged the borg cube. Scan for lifesigns. */
357: irc_dlsym(Mod, "Mod_Version", Mod_Version);

all good...

so, no idea.

EDIT: line numbers

Stealth

2007-12-27 05:05

reporter   ~0014936

If you think you can get more info by playing with my box, I can get you access

capitaine

2008-11-10 17:44

reporter   ~0015422

Actually rehashing isn't necessary to reproduce it. You can just recompile a single module and overwrite it.
Then the crash occurs as soon as the module is called.

Example, m_getinfo without rehashing :

Program received signal SIGSEGV, Segmentation fault.
0xb7f0298f in m_getinfo (cptr=0x8179af0, sptr=0x8179af0, parc=2, parv=0x811d860) at m_getinfo.c:472
472 if (!IsPerson(sptr) || !IsAnOper(sptr))

darkwire

2008-11-20 19:37

reporter   ~0015423

I think that this bug is the same with http://svn.ratbox.org/svnroot/ircd-ratbox/trunk/BUGS (detailed description)

capitaine

2008-11-25 10:16

reporter   ~0015429

Ok now I understand why Anope handle their modules that way (a temporary copy of each module)

syzop

2009-01-18 17:31

administrator   ~0015683

darkwire / capitaine: that isn't the bug, as we already copy the modules (to the tmp/ directory) since 2003...

Personally, I reload modules from time to time so I don't have to restart, and this works fine... I just tested it on 3.2.8-rc1: 1) didn't crash, and 2) it used the updated version.

syzop

2009-05-13 06:35

administrator   ~0015847

Fixed a week+ ago, but couldn't access the bugtracker:
- Fixed crash on Linux (with a 'new' dynamic linker) when a module has
  been updated and then reloaded. From now on we just copy to a tempfile,
  and never hardlink. (bug 0003557).

I experienced this on someones else box, and fortunately this enabled me to trace this nasty issue :)

We hardlinked for 'disk space' reasons, but that no longer works... ah well... :)

Issue History

Date Modified Username Field Change
2007-12-20 07:37 Stealth New Issue
2007-12-24 12:08 Bock Note Added: 0014927
2007-12-26 13:15 syzop Note Added: 0014933
2007-12-26 13:16 syzop Note Edited: 0014933
2007-12-27 05:05 Stealth Note Added: 0014936
2008-11-10 17:44 capitaine Note Added: 0015422
2008-11-20 19:37 darkwire Note Added: 0015423
2008-11-25 10:16 capitaine Note Added: 0015429
2009-01-18 17:31 syzop Note Added: 0015683
2009-05-13 06:35 syzop QA => Not touched yet by developer
2009-05-13 06:35 syzop U4: Need for upstream patch => No need for upstream InspIRCd patch
2009-05-13 06:35 syzop Note Added: 0015847
2009-05-13 06:35 syzop Status new => resolved
2009-05-13 06:35 syzop Fixed in Version => 3.2.9-RC1
2009-05-13 06:35 syzop Resolution open => fixed
2009-05-13 06:35 syzop Assigned To => syzop