<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>I attached the diff, seems to fix the problem, at least I tested consective 1,000 times shutdown, and no problem. not sure if there are other side effects, though.</DIV>
<DIV><BR><BR>--- On <B>Mon, 7/26/10, Huihong Luo <I><huisinro@yahoo.com></I></B> wrote:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>From: Huihong Luo <huisinro@yahoo.com><BR>Subject: Re: [vbox-dev] possible cause for the crash when shutting down a vm<BR>To: vbox-dev@virtualbox.org<BR>Date: Monday, July 26, 2010, 10:27 PM<BR><BR>
<DIV id=yiv712431059>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top>more importantly, when WM_VBOX_RENDERSPU_DESTROY_WINDOW is received, should the while loop break out? that loop will definitely causes problems after dll is unloaded.<BR><BR>--- On <B>Mon, 7/26/10, Huihong Luo <I><huisinro@yahoo.com></I></B> wrote:<BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>From: Huihong Luo <huisinro@yahoo.com><BR>Subject: [vbox-dev] possible cause for the crash when shutting down a vm<BR>To: vbox-dev@virtualbox.org<BR>Date: Monday, July 26, 2010, 10:04 PM<BR><BR>
<DIV id=yiv712431059yiv1288922985>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top>
<DIV id=yiv712431059yiv1288922985yiv1136583137>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top>
<DIV>I continue to debug the crash bug when shutting down a vm on windows host.</DIV>
<DIV> </DIV>
<DIV>The crash indicated that some code is still being executed after a dll is unloaded. </DIV>
<DIV> </DIV>
<DIV>After some extensive debugging, I found the following function might be problematic. Can you guys double check?</DIV>
<DIV> </DIV>
<DIV>When WM_VBOX_RENDERSPU_DESTROY_WINDOW is received, it immediately invokes SetEvent(render_spu.hWinThreadReadyEvent), should that statement be commented out? and leave the last one.</DIV>
<DIV> </DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<DIV>static</FONT></FONT><FONT size=2> DWORD WINAPI renderSPUWindowThreadProc(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>void</FONT></FONT><FONT size=2>* unused)</DIV>
<DIV>{</DIV>
<DIV>...</DIV></FONT><FONT size=2>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</DIV></FONT></FONT><FONT size=2>
<DIV>{</DIV></FONT><FONT size=2>
<DIV>...</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (msg.message == WM_VBOX_RENDERSPU_DESTROY_WINDOW)</DIV>
<DIV>{</DIV>
<DIV>CRASSERT(msg.lParam && !msg.wParam);</DIV>
<DIV>DestroyWindow(((VBOX_RENDERSPU_DESTROY_WINDOW*) msg.lParam)->hWnd);</DIV>
<DIV>SetEvent(render_spu.hWinThreadReadyEvent);</DIV>
<DIV>}</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</DIV></FONT></FONT><FONT size=2>
<DIV>{</DIV>
<DIV>TranslateMessage(&msg);</DIV>
<DIV>DispatchMessage(&msg);</DIV>
<DIV>}</DIV>
<DIV>}</DIV>
<DIV>}</DIV>
<DIV>render_spu.dwWinThreadId = 0;</DIV>
<DIV>crDebug(</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"RenderSPU: Window thread stopped (%x)"</FONT></FONT><FONT size=2>, crThreadID());</DIV>
<DIV>SetEvent(render_spu.hWinThreadReadyEvent);</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> 0;</DIV>
<DIV>}</DIV></FONT></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></DIV><BR>-----Inline Attachment Follows-----<BR><BR>
<DIV class=yiv712431059plainMail>_______________________________________________<BR>vbox-dev mailing list<BR><A href="http://us.mc343.mail.yahoo.com/mc/compose?to=vbox-dev@virtualbox.org" target=_blank rel=nofollow>vbox-dev@virtualbox.org</A><BR><A href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank rel=nofollow>http://vbox.innotek.de/mailman/listinfo/vbox-dev</A><BR></DIV></BLOCKQUOTE></TD></TR></TBODY></TABLE></DIV><BR>-----Inline Attachment Follows-----<BR><BR>
<DIV class=plainMail>_______________________________________________<BR>vbox-dev mailing list<BR><A href="http://us.mc343.mail.yahoo.com/mc/compose?to=vbox-dev@virtualbox.org" ymailto="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</A><BR><A href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank>http://vbox.innotek.de/mailman/listinfo/vbox-dev</A><BR></DIV></BLOCKQUOTE></td></tr></table>