[Xorp-hackers] xorpsh crash

Ben Greear greearb at candelatech.com
Thu Oct 11 18:55:45 PDT 2007


Pavlin Radoslavov wrote:
> Ben Greear <greearb at candelatech.com> wrote:
> 
>> Pavlin Radoslavov wrote:
>>> Ben Greear <greearb at candelatech.com> wrote:
>>>
>>>> I'm getting a repeatable crash in xorpsh (I have not yet added that patch
>>>> that Pavlin sent yesterday...this is just the latest cvs).
>>> Is there a simple procedure how to repeat the crash?
>> I don't think so...seems it might be a race of some kind...
>>
>> I'm trying to add a new file to libxorp/ dir to help debug
>> this.  I tried editing the Makefile.am and reran ./configure in the
>> base dir, but the .cc file is still not being compiled.  What do I
>> need to do to make it compile my file?
> 
> If you modify any Makefile.am or configure.in file, you must run
> ./bootstrap
> in the XORP top-level directory.
> After that you need to run ./configure
> 
> Note however that you should have installed the same versions of the
> autotools we are using, otherwise the result is unpredictable:
> 
> autoconf: 2.61
> automake: 1.10
> libtool: 1.5.22
> 
> Also, see the beginning of the "bootstrap" script for the list of
> environmental variables you might need to set if the installed
> executables on your machine doesn't match those names:
> 
> ACLOCAL=${ACLOCAL:-"aclocal-1.10"}
> AUTOCONF=${AUTOCONF:-"autoconf-2.61"}
> AUTOHEADER=${AUTOHEADER:-"autoheader-2.61"}
> AUTOM4TE=${AUTOM4TE:-"autom4te-2.61"}
> AUTOMAKE=${AUTOMAKE:-"automake-1.10"}
> LIBTOOLIZE=${LIBTOOLIZE:-"libtoolize"}

That sounds a bit scary...it won't be easy to fix this if
my versions are off.  I managed to manually tweak the Makefile
for now...

Anyway, I added my 'bug-cather' files and sure enough, we are deleting
already-freed memory:

(gdb) bt
#0  0x08189566 in TimerNode::release_ref (this=0x83016d0) at timer.cc:87
#1  0x080bea0e in ~XorpTimer (this=0xbf8cdf04) at timer.hh:537
#2  0x0818a24c in TimerList::expire_one (this=0xbf8d4014, worst_priority=9) at timer.cc:458
#3  0x0818a395 in TimerList::run (this=0xbf8d4014) at timer.cc:428
#4  0x08170688 in EventLoop::run (this=0xbf8d4010) at eventloop.cc:114
#5  0x080c1cdf in XorpShell::run (this=0xbf8d20d0, commands=@0xbf8d4244) at xorpsh_main.cc:388
#6  0x080c3b69 in main (argc=1, argv=0xbf8d4304) at xorpsh_main.cc:897
(gdb) frame 0
#0  0x08189566 in TimerNode::release_ref (this=0x83016d0) at timer.cc:87
87      in timer.cc
(gdb) print *this
$1 = {<HeapBase> = {<BugCatcher> = {_vptr.BugCatcher = 0x0, magic = 3735928559, static _cnt = 8},
     _pos_in_heap = -1}, _ref_cnt = -1, _expires = {static ONE_MILLION = 1000000, _sec = 179108,
     _usec = 477834}, _cb = {_M_ptr = 0x0, _M_index = 71}, _priority = 9, _list = 0xbf8d4014}
(gdb) print /x this->magic
$2 = 0xdeadbeef
(gdb)


No fix yet, but please consider the attached patch and new files..this has saved
me many hours debugging complex applications & core files...


Thanks,
Ben



> 
> Regards,
> Pavlin


-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: xorp.patch
Type: text/x-patch
Size: 3892 bytes
Desc: not available
Url : http://mailman.ICSI.Berkeley.EDU/pipermail/xorp-hackers/attachments/20071011/9b059ab2/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_catcher.cc
Type: text/x-c++src
Size: 66 bytes
Desc: not available
Url : http://mailman.ICSI.Berkeley.EDU/pipermail/xorp-hackers/attachments/20071011/9b059ab2/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_catcher.hh
Type: text/x-c++hdr
Size: 511 bytes
Desc: not available
Url : http://mailman.ICSI.Berkeley.EDU/pipermail/xorp-hackers/attachments/20071011/9b059ab2/attachment-0002.bin 


More information about the Xorp-hackers mailing list