<div dir="ltr"><div><div><div>It seems that UIMachineView::maxGuestSize() continues to execute while some other thread/process destroys the UIMachineView object. To test this out, I put in a hack in UIMachineView to basically SpinLock until any existing maxGuestSize exits. Then it sets a flag using a static variable to prevent maxGuestSize from using any member variables after the view has been destroyed. When the view is recreated, the flag is reset.<br>

</div><div><br></div><div>I've attached is my hack (based on 4.2.10), it works pretty well and seems to stop the crash. I hope this will help you put in a better fix in the future.<br><br></div><div>Just one question, Which process/thread executes maxGuestSize? An EMT thread?<br>

</div><br></div>Cheers!<br><br></div>fyi,  There are cases where this hack will not work (in theory) so please don't use it.<br><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 16, 2013 at 4:09 PM, Ribhi Kamal <span dir="ltr"><<a href="mailto:rbhkamal@gmail.com" target="_blank">rbhkamal@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div>Just happened while switching from full screen back to normal view. This is something new, only in 4.2, because the virtual machine used to crash only while closing it so it wasn't a big deal. I'll open a bug once I reproduce it with the released binaries... don't wait.<br>


<br></div></div>Meanwhile, please let me know if you need any additional information/testing.<br><br></div>Thanks,<br></div>Ribhi<br><div><div><div><div><br></div></div></div></div></div><div class="gmail_extra"><div><div class="h5">

<br><br><div class="gmail_quote">
On Fri, Mar 15, 2013 at 8:26 PM, Ribhi Kamal <span dir="ltr"><<a href="mailto:rbhkamal@gmail.com" target="_blank">rbhkamal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<div dir="ltr"><div><div><div>"Unfortunately, I can't find the log files"<br></div> <br></div></div>Obviously that is not true, I uploaded the logs to my dropbox<br><div><div><div class="gmail_extra">
<div><div><br><br><div class="gmail_quote">
On Fri, Mar 15, 2013 at 8:25 PM, Ribhi Kamal <span dir="ltr"><<a href="mailto:rbhkamal@gmail.com" target="_blank">rbhkamal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div dir="ltr"><div><div><div><div><div>I've been seeing a crash when closing VirtualBox.exe that is almost never reproducible. Few days ago I managed to get a crash dump and ran the analysis, see below. At the time of the crash, I was closing the virtual machine after it had been running for ~24 hours. Unfortunately, I can't find the log files<br>




<br>I'm using the following:<br></div>VirtualBox 4.2.8 (Cross compiled with VS2010-SP1 on windows 7 64bit, Target Host = x86)<br></div></div>Host Win7 32bit<br></div>Guest Linux 2.6 32bit<br></div>Build Type: Release<br>




<div><div><div><div><div><br></div><div>Please let me know if you have any questions.<br><br></div><div>Thanks,<br></div><div>Ribhi<br></div><div><br></div><div>Log files:<br></div><div>Successful: <a href="https://www.dropbox.com/s/xrvcr8sud4z63ia/Success.log" target="_blank">https://www.dropbox.com/s/xrvcr8sud4z63ia/Success.log</a><br>




Crash: <a href="https://www.dropbox.com/s/p5pslbt3sl9cpeo/Crash.log" target="_blank">https://www.dropbox.com/s/p5pslbt3sl9cpeo/Crash.log</a></div><div><br></div><div><br>0:000> !analyze -v -f
<br>*******************************************************************************
<br>*                                                                             *
<br>*                        Exception Analysis                                   *
<br>*                                                                             *
<br>*******************************************************************************
<br> <br>GetPageUrlData failed, server returned HTTP status 404
<br>URL requested: <a href="http://watson.microsoft.com/StageOne/VirtualBox_exe/4_2_8_0/51420e3b/unknown/0_0_0_0/bbbbbbb4/80000003/00000000.htm?Retriage=1" target="_blank">http://watson.microsoft.com/StageOne/VirtualBox_exe/4_2_8_0/51420e3b/unknown/0_0_0_0/bbbbbbb4/80000003/00000000.htm?Retriage=1</a>
<br> <br>FAULTING_IP: 
<br>VirtualBox!UIMachineView::maxGuestSize+18 [c:\vboxbuild\virtualbox\4.2.8\src\src\vbox\frontends\virtualbox\src\runtime\uimachineview.cpp @ 702]
<br><b>0145ed68 f00fc70f        lock cmpxchg8b qword ptr [edi]
</b><br> <br>EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
<br>ExceptionAddress: 00000000
<br>   ExceptionCode: 80000003 (Break instruction exception)
<br>  ExceptionFlags: 00000000
<br>NumberParameters: 0
<br> <br>FAULTING_THREAD:  00000ef4
<br> <br>DEFAULT_BUCKET_ID:  STATUS_BREAKPOINT
<br> <br>PROCESS_NAME:  VirtualBox.exe
<br> <br>ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION}  Breakpoint  A breakpoint has been reached.
<br> <br>EXCEPTION_CODE: (HRESULT) 0x80000003 <a href="tel:%282147483651" value="+12147483651" target="_blank">(2147483651</a>) - One or more arguments are invalid
<br> <br>MOD_LIST: <ANALYSIS/>
<br> <br>NTGLOBALFLAG:  0
<br> <br>APPLICATION_VERIFIER_FLAGS:  0
<br> <br>ADDITIONAL_DEBUG_TEXT:  Followup set based on attribute [Is_ChosenCrashFollowupThread] from Frame:[0] on thread:[PSEUDO_THREAD]
<br> <br>LAST_CONTROL_TRANSFER:  from 0143bea0 to 0145ed68
<br> <br>PRIMARY_PROBLEM_CLASS:  STATUS_BREAKPOINT
<br> <br>BUGCHECK_STR:  APPLICATION_FAULT_STATUS_BREAKPOINT_NULL_POINTER_READ
<br> <br>STACK_TEXT:  
<br>03a3ca98 0145ed68 virtualbox!UIMachineView::maxGuestSize+0x18
<br>03a3cab0 0143bea0 virtualbox!UIFrameBuffer::VideoModeSupported+0x30
<br>03a3cac8 6927c724 vboxc!vmmdevVideoModeSupported+0x74
<br>03a3caec 690b4edc vboxdd!vmmdevRequestHandler+0xecc
<br>03a3fb5c 72f198d1 vboxvmm!IOMIOPortWrite+0x91
<br>03a3fb84 72f0891f vboxvmm!HWACCMR3RestartPendingIOInstr+0xcf
<br>03a3fba4 72ea303c vboxvmm!emR3ExecuteIOInstruction+0x1c
<br>03a3fc78 72ea3589 vboxvmm!emR3HwaccmHandleRC+0x189
<br>03a3fc8c 72ea3788 vboxvmm!emR3HwAccExecute+0x168
<br>03a3fcb0 72ea0d84 vboxvmm!EMR3ExecuteVM+0x274
<br>03a3fcd8 72efb2aa vboxvmm!vmR3EmulationThreadWithId+0x45a
<br>03a3fcf8 72efb2f4 vboxvmm!vmR3EmulationThread+0x14
<br>03a3fd0c 69ca1523 vboxrt!rtThreadMain+0x33
<br>03a3fd38 69ce539b vboxrt!rtThreadNativeMain+0x6b
<br>03a3fd58 6bb6c556 msvcr100!_endthreadex+0x3f
<br>03a3fd90 6bb6c600 msvcr100!_endthreadex+0xce
<br>03a3fd9c 76b4ed6c kernel32!BaseThreadInitThunk+0xe
<br>03a3fda8 7722377b ntdll!__RtlUserThreadStart+0x70
<br>03a3fde8 7722374e ntdll!_RtlUserThreadStart+0x1b
<br> <br> <br>STACK_COMMAND:  .cxr 0000000003A3C7B4 ; kb ; dds 3a3ca98 ; kb
<br> <br>FOLLOWUP_IP: 
<br>VirtualBox!UIMachineView::maxGuestSize+0 [c:\vboxbuild\virtualbox\4.2.8\src\src\vbox\frontends\virtualbox\src\runtime\uimachineview.cpp @ 701]
<br>0145ed50 83ec0c          sub     esp,0Ch
<br> <br>FAULTING_SOURCE_CODE:  
<br>   697:                       RT_MAKE_U64(maxSize.height(), maxSize.width()));
<br>   698: }
<br>   699: 
<br>   700: QSize UIMachineView::maxGuestSize()
<br>>  701: {
<br>   702:     uint64_t u64Size = ASMAtomicReadU64(&m_u64MaxGuestSize);
<br>   703:     return QSize(int(RT_HI_U32(u64Size)), int(RT_LO_U32(u64Size)));
<br>   704: }
<br>   705: 
<br>   706: QSize UIMachineView::guestSizeHint()
<br> <br> <br>SYMBOL_NAME:  virtualbox!UIMachineView::maxGuestSize+0
<br> <br>FOLLOWUP_NAME:  MachineOwner
<br> <br>MODULE_NAME: VirtualBox
<br> <br>IMAGE_NAME:  VirtualBox.exe
<br> <br>DEBUG_FLR_IMAGE_TIMESTAMP:  51420e3b
<br> <br>FAILURE_BUCKET_ID:  STATUS_BREAKPOINT_80000003_VirtualBox.exe!UIMachineView::maxGuestSize
<br> <br>BUCKET_ID:  APPLICATION_FAULT_STATUS_BREAKPOINT_NULL_POINTER_READ_virtualbox!UIMachineView::maxGuestSize+0
<br> <br>WATSON_STAGEONE_URL:  <a href="http://watson.microsoft.com/StageOne/VirtualBox_exe/4_2_8_0/51420e3b/unknown/0_0_0_0/bbbbbbb4/80000003/00000000.htm?Retriage=1" target="_blank">http://watson.microsoft.com/StageOne/VirtualBox_exe/4_2_8_0/51420e3b/unknown/0_0_0_0/bbbbbbb4/80000003/00000000.htm?Retriage=1</a>
<br> <br>Followup: MachineOwner
<br>---------<span><font color="#888888"><br clear="all"><div><br>-- <br>-- Ribhi
</div></font></span></div></div></div></div></div></div>
</blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>-- Ribhi
</font></span></div></div></div></div>
</blockquote></div><br><br clear="all"><br></div></div><span class=""><font color="#888888">-- <br>-- Ribhi
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br>-- Ribhi
</div></div></div>