[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [BusyBox] insmod problems HINT
From:       "Andreas Neuhaus" <andy () fasta ! fh-dortmund ! de>
Date:       2001-05-29 22:32:17
[Download RAW message or body]

after hours of debugging i finally found a little hint:

busybox insmod really segfaults on insmod fat.o. the deal is that during
boot the segfault msg is not visible, so i missed it.

now for the segfault cause. i added lots of debug printfs to insmod.c and
finally found the following:

in insmod.c line 2867-2887 (function obj_relocate):

when doing relocation i=2 (n=23) within the for(;rel<relend;++rel) loop,
there's suddenly a relocation (after about 376 for-loops without problems)
which crashes:

symndx = ELFW(R_SYM) (rel->r_info);        // line 2867: symndx is assigned
254 here
...
(ELFW(ST_BIND) (extsym->st_info) == STB_LOCAL)  // line 2872: is true, so
doing a local table lookup
...
intsym = f->local_symtab[symndx]               // line 2875: assigns 0x00 to
intsym
...
intsym->referenced = 1;                              // line 2887: boom!


well, i know nearly nothing about elf relocations and that stuff... i
changed line 2887 to

if (intsym) intsym->referenced = 1;

and it works for me. however i do not understand what's going on.

perhaps there's somebody who's familiar with all those elf stuff and can
check out the above code? if you need my kernel/modules to reproduce the
problem, just tell me.

regards,
andreas neuhaus





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic