[Mono-bugs] [Bug 683277] New: Mono finalizer has trouble exiting

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Mar 28 22:44:01 EDT 2011



           Summary: Mono finalizer has trouble exiting
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.8.x
          Platform: x86
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: GC
        AssignedTo: lupus at novell.com
        ReportedBy: xocotl at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Windows NT 6.1; rv:2.0) Gecko/20100101

I am running into the 'finalizer shutdown timed out' message after two seconds
of collecting. This wouldn't be a big deal on exit, except I encountered a PC
during testing which actually appears to be unable to terminate. Needless to
say, for that person, having to end task the program to exit is not pretty. So,
I'd like to fix this lockup for them... I am thinking of just killing the
process when they click exit as a workaround.

In any case, the stack trace from MSVC (I compiled with VC2008 to get the
trace, but this problem occurs with the ordinary runtime as well often -- 28
as well as 2.10...) is as follows:

[note, as far as Visual C++ is concerned, it's frozen at mono_get_lmf_addr..
however, I'm unclear as to how that got in between what's around it...]

--- Finalizer thread below ---
     ntdll.dll!_KiFastSystemCallRet at 0()     
     user32.dll!_NtUserMoveWindow at 24()  + 0xc bytes    
>	mono.dll!mono_get_lmf_addr()  Line 2382 + 0xe bytes	C
     usp10.dll!UspFreeAnalysisMem()  + 0x40 bytes    
     usp10.dll!_ScriptStringFree at 4()  + 0x4f bytes    
     msvcr90d.dll!_free_dbg(void * pUserData=0x104ecffa, int
nBlockUse=35257924)  Line 1260 + 0xc bytes    C++
     mono.dll!monoeg_g_free(void * ptr=0x0423b330)  Line 36 + 0xc bytes    C
     mono.dll!mono_gc_run_finalize(void * obj=0x0423b330, void *
data=0x00000000)  Line 220 + 0x11 bytes    C
     mono.dll!finalize_domain_objects(DomainFinalizationReq * req=0x03f73ed8) 
Line 1012 + 0xb bytes    C
     mono.dll!finalizer_thread(void * unused=0x00000000)  Line 1069 + 0x9 bytes
     mono.dll!start_wrapper(void * data=0x0135ce98)  Line 782 + 0x9 bytes    C
     mono.dll!thread_start(void * arg=0x0066cff8)  Line 531 + 0x10 bytes    C
     kernel32.dll!@BaseThreadInitThunk at 12()  + 0x12 bytes    
     ntdll.dll!___RtlUserThreadStart at 8()  + 0x27 bytes    
     ntdll.dll!__RtlUserThreadStart at 8()  + 0x1b bytes    

This seemed a bit of a strange stack trace to me, but maybe you will have more
knowledge about how it can skip about... as an aside,

0x02467998 " System.Windows.Forms.XplatUIWin32:SetWindowPos
(intptr,int,int,int,int) + 0x1f (04220928 04220949) [00324E60 -

--- Shutdown thread below ---
>	mono.dll!mono_gc_cleanup()  Line 1135 + 0x18 bytes	C
     mono.dll!mono_runtime_cleanup(_MonoDomain * domain=0x00444e60)  Line 355  
     mono.dll!mini_cleanup(_MonoDomain * domain=0x00444e60)  Line 6387 + 0x9
bytes    C
     mono.dll!mono_main(int argc=4, char * * argv=0x014c3068)  Line 1868 + 0x9
bytes    C
     mono.exe!mono_main_with_options(int argc=4, char * * argv=0x014c3068) 
Line 66 + 0xd bytes    C
     mono.exe!main()  Line 87 + 0xd bytes    C
     mono.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes    C
     mono.exe!mainCRTStartup()  Line 403    C
     kernel32.dll!@BaseThreadInitThunk at 12()  + 0x12 bytes    
     ntdll.dll!___RtlUserThreadStart at 8()  + 0x27 bytes    
     ntdll.dll!__RtlUserThreadStart at 8()  + 0x1b bytes    

mono_gc_cleanup here is where you'd expect it to be. A few lines up because I
had to add a while(1) { } to be able to pause it to get you the stack of the
other thread... if I assert a bit later I get interesting errors and am unable
to break.

Please let me know if there's any other information I can provide. I'm
uncertain whether this is a Windows Forms issue, a GC issue, somewhere in

Reproducible: Always

Steps to Reproduce:

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list