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.
This commit is contained in:
robert 2010-03-27 12:06:26 +00:00
parent 57e6bf7141
commit f99e840e0c
3 changed files with 15 additions and 47 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.30 2010/03/26 17:53:26 robert Exp $
# $OpenBSD: Makefile,v 1.31 2010/03/27 12:06:26 robert Exp $
# sync with net/avahi,-mono
ONLY_FOR_ARCHS= amd64 i386 powerpc # arm
@ -6,7 +6,7 @@ ONLY_FOR_ARCHS= amd64 i386 powerpc # arm
COMMENT= cross platform, open source .NET developement framework
DISTNAME= mono-2.6.3
PKGNAME= ${DISTNAME}p10
PKGNAME= ${DISTNAME}p11
CATEGORIES= lang devel

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-mono_io-layer_handles_c,v 1.2 2010/03/26 17:53:26 robert Exp $
--- mono/io-layer/handles.c.orig Fri Sep 25 16:58:10 2009
+++ mono/io-layer/handles.c Fri Mar 26 18:47:01 2010
@@ -1046,6 +1046,9 @@ void _wapi_handle_unref (gpointer handle)
guint32 idx = GPOINTER_TO_UINT(handle);
gboolean destroy = FALSE;
int thr_ret;
+#if defined(__OpenBSD__)
+ int i = 0;
+#endif
if (!_WAPI_PRIVATE_VALID_SLOT (idx)) {
return;
@@ -1114,8 +1117,19 @@ void _wapi_handle_unref (gpointer handle)
* now, but pthreads doesn't have a
* "unlock_and_destroy" atomic function.
*/
+#if defined(__OpenBSD__)
+ /* XXX: It seems that we have to wait for some thread to finish */
+ do {
+ thr_ret = mono_mutex_destroy (&_WAPI_PRIVATE_HANDLES(idx).signal_mutex);
+ if (thr_ret == EBUSY) {
+ sleep(1);
+ i++;
+ }
+ } while ((thr_ret > 0) && (i < 5));
+#else
thr_ret = mono_mutex_destroy (&_WAPI_PRIVATE_HANDLES(idx).signal_mutex);
g_assert (thr_ret == 0);
+#endif
thr_ret = pthread_cond_destroy (&_WAPI_PRIVATE_HANDLES(idx).signal_cond);
g_assert (thr_ret == 0);

View File

@ -1,20 +1,21 @@
$OpenBSD: patch-mono_mini_mini-posix_c,v 1.1 2010/03/26 13:13:47 robert Exp $
--- mono/mini/mini-posix.c.orig Fri Mar 26 14:03:04 2010
+++ mono/mini/mini-posix.c Fri Mar 26 13:53:52 2010
@@ -184,11 +184,22 @@ SIG_HANDLER_SIGNATURE (sigusr1_signal_handler)
$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;
+#if defined(__OpenBSD__)
+ /*
+ * Let's say that this is a tripe XXX hack, because on OpenBSD ctx can be 0
+ * in some cases and I suspect this is because something async happens and
+ * threads are going away before we could handle them.
+ */
+ * On OpenBSD, ctx can be NULL if we are interrupting poll ().
+ */
+ if (ctx) {
+#endif
+ ji = mono_jit_info_table_find (mono_domain_get (), mono_arch_ip_from_context(ctx));
+ running_managed = ji != NULL;
@ -22,9 +23,9 @@ $OpenBSD: patch-mono_mini_mini-posix_c,v 1.1 2010/03/26 13:13:47 robert Exp $
- return;
+ if (mono_debugger_agent_thread_interrupt (ctx, ji))
+ return;
+#if defined(__OpenBSD__)
+ } else {
+ running_managed = FALSE;
+ }
+#endif
exc = mono_thread_request_interruption (running_managed);
if (!exc)