Skip to content

Commit

Permalink
[IA64] Only unwind non-running tasks.
Browse files Browse the repository at this point in the history
Unwinding a running task has proven problematic.

In one instance, the running task was attempting to unwind itself and
received an interrupt between when get_wchan allocated local variables on
the stack and when unw_init_from_blocked_task was called which resulted
in unw_init_frame_info to place this tasks task_struct pointer over the
switch stack's ar_bspstore entry.

Signed-off-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Robin Holt authored and Tony Luck committed May 22, 2007
1 parent e2e6fe7 commit 6ae3848
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/ia64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,9 @@ get_wchan (struct task_struct *p)
unsigned long ip;
int count = 0;

if (!p || p == current || p->state == TASK_RUNNING)
return 0;

/*
* Note: p may not be a blocked task (it could be current or
* another process running on some other CPU. Rather than
Expand All @@ -773,6 +776,8 @@ get_wchan (struct task_struct *p)
*/
unw_init_from_blocked_task(&info, p);
do {
if (p->state == TASK_RUNNING)
return 0;
if (unw_unwind(&info) < 0)
return 0;
unw_get_ip(&info, &ip);
Expand Down

0 comments on commit 6ae3848

Please sign in to comment.