--- 0/kernel/signal.c 2008-05-14 02:24:51.000000000 +0800 +++ 1/kernel/signal.c 2008-05-22 13:54:42.000000000 +0800 @@ -1488,6 +1488,9 @@ { int killed = 0; + /* Let the debugger run. */ + __set_current_state(TASK_TRACED); + if (arch_ptrace_stop_needed(exit_code, info)) { /* * The arch code has something special to do before a @@ -1516,8 +1519,6 @@ current->last_siginfo = info; current->exit_code = exit_code; - /* Let the debugger run. */ - __set_current_state(TASK_TRACED); spin_unlock_irq(¤t->sighand->siglock); read_lock(&tasklist_lock); if (!unlikely(killed) && may_ptrace_stop()) {