On Tuesday 21 February 2006 16:36, Antoine Martin wrote:
> > disassemble 0x40000b20 0x40000b40
> (gdb) disassemble 0x40000b20 0x40000b40
> Dump of assembler code from 0x40000b20 to 0x40000b40:
> 0x40000b20: Cannot access memory at address 0x40000b20
> (gdb) c
> Continuing.
> Program received signal SIGUSR1, User defined signal 1.
> 0xa02aebb1 in kill () at err.h:24
> 24 {
> (gdb)
> Continuing.
> > > deactivate_all_fds failed, errno = 9
> > > It is 100% reproducible on a slackware10 filesystem running in 32-bit
> > > mode on an amd64 system: just by doing make in the kernel src tree.
> > > How do I debug this skas3/noprocmm mode? (gdb gave me nothing useful)
> > SKAS0, SKAS3 and mixed things do debug the same way - gdb ./vmlinux.
> >
> > I'd use "attach <pid>", and "break" on the function containing that IP,
> > or directly on the IP itself.
> Since this address is not accessible, how do I get gdb to give me a
> backtrace / how do I find the function? (IANA gdb expert)
No idea - however it seems it's printing an address of userspace code.
> > > (I tried 2.6.15.4-bs1-tls and 2.6.15.4-bs2, and other versions... with
> > > plain skas0 and mixed mode)
> > I.e. even on vanilla... what a mess! I hoped it was introduced by this
> > one.
> Me too.. But it had been reported by someone else before, I just ignored
> it for too long.
I've decided to try with the attached patch. It's an old "TODO" thing.
I'm trying this to exclude other possible stuff. I'm also going to touch a
couple of other patches for long-known issues hard to fix properly; the "hard
to fix properly" part is that I can't use execvp() since it allocates memory
and there are reasons this can't be done, while I don't want to do without
$PATH lookup.
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
Index: linux-2.6.git/arch/um/os-Linux/process.c
===================================================================
--- linux-2.6.git.orig/arch/um/os-Linux/process.c
+++ linux-2.6.git/arch/um/os-Linux/process.c
@@ -202,7 +202,7 @@ void init_new_thread_signals(int altstac
{
int flags = altstack ? SA_ONSTACK : 0;
- set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags,
+ set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags | SA_NODEFER,
SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
set_handler(SIGTRAP, (__sighandler_t) sig_handler, flags,
SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
Index: linux-2.6.git/arch/um/os-Linux/skas/trap.c
===================================================================
--- linux-2.6.git.orig/arch/um/os-Linux/skas/trap.c
+++ linux-2.6.git/arch/um/os-Linux/skas/trap.c
@@ -20,17 +20,12 @@ void sig_handler_common_skas(int sig, vo
struct sigcontext *sc = sc_ptr;
struct skas_regs *r;
void (*handler)(int, union uml_pt_regs *);
+ /* XXX: May be racy - but only for nested SIGSEGV, and only about which
+ * error code is given. The code may however depend on correct error
+ * code. */
int save_errno = errno;
int save_user;
- /* This is done because to allow SIGSEGV to be delivered inside a SEGV
- * handler. This can happen in copy_user, and if SEGV is disabled,
- * the process will die.
- * XXX Figure out why this is better than SA_NODEFER
- */
- if(sig == SIGSEGV)
- change_sig(SIGSEGV, 1);
-
r = &TASK_REGS(get_current())->skas;
save_user = r->is_user;
r->is_user = 0;