openbsd-ports/lang/mono/patches/patch-mono_mini_mini-posix_c
robert f99e840e0c Remove the handles.c patch because that's not needed anymore because
Zoltan Varga from the mono team helped me to debug the problem we
were having. So the correct problem description is that on OpenBSD,
ctx can be NULL if we are interrupting poll().
The upstream diff also fixes the issue where we are interrupting
unmanaged code.
2010-03-27 12:06:26 +00:00

32 lines
1.1 KiB
Plaintext

$OpenBSD: patch-mono_mini_mini-posix_c,v 1.2 2010/03/27 12:06:26 robert Exp $
--- mono/mini/mini-posix.c.orig Sat Mar 27 12:33:58 2010
+++ mono/mini/mini-posix.c Sat Mar 27 12:34:52 2010
@@ -179,16 +179,22 @@ SIG_HANDLER_SIGNATURE (sigusr1_signal_handler)
}
/*
- * FIXME:
* This is an async signal, so the code below must not call anything which
* is not async safe. That includes the pthread locking functions. If we
* know that we interrupted managed code, then locking is safe.
*/
- ji = mono_jit_info_table_find (mono_domain_get (), mono_arch_ip_from_context(ctx));
- running_managed = ji != NULL;
+ /*
+ * On OpenBSD, ctx can be NULL if we are interrupting poll ().
+ */
+ if (ctx) {
+ ji = mono_jit_info_table_find (mono_domain_get (), mono_arch_ip_from_context(ctx));
+ running_managed = ji != NULL;
- if (mono_debugger_agent_thread_interrupt (ctx, ji))
- return;
+ if (mono_debugger_agent_thread_interrupt (ctx, ji))
+ return;
+ } else {
+ running_managed = FALSE;
+ }
exc = mono_thread_request_interruption (running_managed);
if (!exc)