Skip to content

Commit

Permalink
Don't pass MONO_UNWIND_ACTUAL_METHOD to the stack walker in a signal …
Browse files Browse the repository at this point in the history
…handler, its not signal safe. Fixes bxc mono#263.
  • Loading branch information
vargaz committed Aug 14, 2011
1 parent 41d9165 commit c8d809d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mono/mini/debugger-agent.c
Expand Up @@ -2152,7 +2152,13 @@ mono_debugger_agent_thread_interrupt (void *sigctx, MonoJitInfo *ji)
data.last_frame_set = FALSE;
if (sigctx) {
mono_arch_sigctx_to_monoctx (sigctx, &ctx);
mono_walk_stack_with_ctx (get_last_frame, &ctx, MONO_UNWIND_DEFAULT, &data);
mono_arch_sigctx_to_monoctx (sigctx, &ctx);
/*
* Don't pass MONO_UNWIND_ACTUAL_METHOD, its not signal safe, and
* get_last_frame () doesn't need it, the last frame cannot be a ginst
* since we are not in a JITted method.
*/
mono_walk_stack_with_ctx (get_last_frame, &ctx, MONO_UNWIND_NONE, &data);
}
if (data.last_frame_set) {
memcpy (&tls->async_last_frame, &data.last_frame, sizeof (StackFrameInfo));
Expand Down
1 change: 1 addition & 0 deletions mono/utils/mono-stack-unwinding.h
Expand Up @@ -21,6 +21,7 @@ typedef enum {
typedef enum {
MONO_UNWIND_NONE = 0x0,
MONO_UNWIND_LOOKUP_IL_OFFSET = 0x1,
/* NOT signal safe */
MONO_UNWIND_LOOKUP_ACTUAL_METHOD = 0x2,
/*
* Store the locations where caller-saved registers are saved on the stack in
Expand Down

0 comments on commit c8d809d

Please sign in to comment.