From: Marcus Brinkmann <[EMAIL PROTECTED]>
   Date: Wed, 7 Mar 2001 19:39:51 +0100

   So I think this might have something to do with what _cthread_init_routine
   does, or with the special code in libc/sysdeps/mach/hurd/i386/init-first
   when this function is defined. I don't understand this code at all, and I
   have no idea how to debug it any further than that.

What!  You don't understand Roland's overly clever stack-munging code :-).

Seriously, what _cthread_init_routine does is allocating a new stack
for the initial thread.  Then the code in sysdeps/mach/hurd/i386/init-first.c 
copies some stuff (such as the program arguments and environment) from
the old stack to the new one, switches to the new stack, and then
frees the old stack.

However the dynamic linker keeps a pointer to the old program
arguments in _dl_argv.  Now when mtrace() calls _dl_addr() it looks at
_dl_argv[0], which points somewhere in the deallocated stack which
results in your SIGBUS.

Unfortunately, I'm not sure how to fix this yet.


Bug-hurd mailing list

Reply via email to