소스 검색

2010-03-26 Zoltan Varga <[email protected]>

	* mini-posix.c (SIG_HANDLER_SIGNATURE): Handle the case when ctx is NULL on
	OpenBSD.

svn path=/trunk/mono/; revision=154326
Zoltan Varga 16 년 전
부모
커밋
fde9da8765
2개의 변경된 파일16개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 0
      mono/mini/ChangeLog
  2. 11 5
      mono/mini/mini-posix.c

+ 5 - 0
mono/mini/ChangeLog

@@ -1,3 +1,8 @@
+2010-03-26  Zoltan Varga  <[email protected]>
+
+	* mini-posix.c (SIG_HANDLER_SIGNATURE): Handle the case when ctx is NULL on
+	OpenBSD.
+
 2010-03-26  Zoltan Varga  <[email protected]>
 
 	* debugger-agent.c (mono_debugger_agent_init): Set the GC type of the

+ 11 - 5
mono/mini/mini-posix.c

@@ -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)