Commit 690def21 authored by Kirill Korotaev's avatar Kirill Korotaev Committed by Tony Luck

[IA64] unwind did not work for processes born with CLONE_STOPPED

Minor problem for mainstream. Big problem for checkpoint/restore,
because all the stopped/traced processes are born in this state,
hence they cannot be checkpointed again due to failing unwind.

The problem was identified as assumption in kernel unwind library
that top level frame is different of syscall frame. It is the case
unless process was born with CLONE_STOPPED.

Author: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-Off-By: default avatarAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-Off-By: default avatarKirill Korotaev <dev@sw.ru>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 3be44b9c
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
# define UNW_DEBUG_ON(n) unw_debug_level >= n # define UNW_DEBUG_ON(n) unw_debug_level >= n
/* Do not code a printk level, not all debug lines end in newline */ /* Do not code a printk level, not all debug lines end in newline */
# define UNW_DPRINT(n, ...) if (UNW_DEBUG_ON(n)) printk(__VA_ARGS__) # define UNW_DPRINT(n, ...) if (UNW_DEBUG_ON(n)) printk(__VA_ARGS__)
# undef inline
# define inline # define inline
#else /* !UNW_DEBUG */ #else /* !UNW_DEBUG */
# define UNW_DEBUG_ON(n) 0 # define UNW_DEBUG_ON(n) 0
...@@ -1943,9 +1944,9 @@ EXPORT_SYMBOL(unw_unwind); ...@@ -1943,9 +1944,9 @@ EXPORT_SYMBOL(unw_unwind);
int int
unw_unwind_to_user (struct unw_frame_info *info) unw_unwind_to_user (struct unw_frame_info *info)
{ {
unsigned long ip, sp, pr = 0; unsigned long ip, sp, pr = info->pr;
while (unw_unwind(info) >= 0) { do {
unw_get_sp(info, &sp); unw_get_sp(info, &sp);
if ((long)((unsigned long)info->task + IA64_STK_OFFSET - sp) if ((long)((unsigned long)info->task + IA64_STK_OFFSET - sp)
< IA64_PT_REGS_SIZE) { < IA64_PT_REGS_SIZE) {
...@@ -1963,7 +1964,7 @@ unw_unwind_to_user (struct unw_frame_info *info) ...@@ -1963,7 +1964,7 @@ unw_unwind_to_user (struct unw_frame_info *info)
__FUNCTION__, ip); __FUNCTION__, ip);
return -1; return -1;
} }
} } while (unw_unwind(info) >= 0);
unw_get_ip(info, &ip); unw_get_ip(info, &ip);
UNW_DPRINT(0, "unwind.%s: failed to unwind to user-level (ip=0x%lx)\n", UNW_DPRINT(0, "unwind.%s: failed to unwind to user-level (ip=0x%lx)\n",
__FUNCTION__, ip); __FUNCTION__, ip);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment