Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ae38488 authored by Robin Holt's avatar Robin Holt Committed by Tony Luck
Browse files

[IA64] Only unwind non-running tasks.



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: default avatarRobin Holt <holt@sgi.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent e2e6fe7b
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -763,6 +763,9 @@ get_wchan (struct task_struct *p)
	unsigned long ip;
	unsigned long ip;
	int count = 0;
	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
	 * Note: p may not be a blocked task (it could be current or
	 * another process running on some other CPU.  Rather than
	 * another process running on some other CPU.  Rather than
@@ -773,6 +776,8 @@ get_wchan (struct task_struct *p)
	 */
	 */
	unw_init_from_blocked_task(&info, p);
	unw_init_from_blocked_task(&info, p);
	do {
	do {
		if (p->state == TASK_RUNNING)
			return 0;
		if (unw_unwind(&info) < 0)
		if (unw_unwind(&info) < 0)
			return 0;
			return 0;
		unw_get_ip(&info, &ip);
		unw_get_ip(&info, &ip);