[Mono-bugs] [Bug 470568] mono_thread_current() called after TlsFree(current_object_key)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Feb 1 16:13:21 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=470568

User andyhume32 at yahoo.co.uk added comment
https://bugzilla.novell.com/show_bug.cgi?id=470568#c3





--- Comment #3 from Andy Hume <andyhume32 at yahoo.co.uk>  2009-02-01 14:13:19 MST ---
Out of interest I installed MingW's gdb; it gives correct locations, see below.
As expected the locations with big offsets were wrong, so the second case was
actually in mini_thread_cleanup.

[[
$ /cygdrive/d/Temp/2009-01/gdb-6.8-mingw-3/bin/gdb.exe --args mono   mdoc
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) directory /cygwin/usr/src/mono/mono/mono/mini/
Source directories searched: /cygwin/usr/src/mono/mono/mono/mini;$cdir;$cwd
(gdb) directory /cygwin/usr/src/mono/mono/mono/metadata
Source directories searched:
/cygwin/usr/src/mono/mono/mono/metadata;/cygwin/usr
/src/mono/mono/mono/mini;$cdir;$cwd
(gdb) break threads.c:mono_thread_cleanup
No source file named threads.c in loaded symbols.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (threads.c:mono_thread_cleanup) pending.
(gdb) break threads.c:mono_thread_current
No source file named threads.c in loaded symbols.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 2 (threads.c:mono_thread_current) pending.
(gdb) disable breakpoints 2
(gdb) info breakpoints
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   <PENDING>  threads.c:mono_thread_cleanup
2       breakpoint     keep n   <PENDING>  threads.c:mono_thread_current
(gdb) run
Starting program: D:\cygwin\usr\local\bin/mono.exe mdoc
[New thread 3360.0x2058]
mono_thread_init: Allocated current_object_key 0x18
[New thread 3360.0x7a0]
Cannot open assembly 'mdoc': No such file or directory.


Breakpoint 1, mono_thread_cleanup () at threads.c:2344
2344            mono_thread_hazardous_try_free_all ();
(gdb) backtrace
#0  mono_thread_cleanup () at threads.c:2344
#1  0x68fb81ff in mono_runtime_cleanup (domain=<incomplete type>)
    at appdomain.c:299
#2  0x68ec8b66 in mini_cleanup (domain=0xb84f00) at mini.c:5465
#3  0x68f20cdd in mono_main (argc=2, argv=0x3f2ab0) at driver.c:1608
#4  0x00401392 in main () at main.c:25
(gdb) enable breakpoint 2
(gdb) cont
Continuing.
[Switching to thread 3360.0x7a0]


Breakpoint 2, mono_thread_current () at threads.c:1275
1275    {       printf ("%s: mono_thread_current calling GET_CURRENT_OBJECT
key:
 0x%x \n", __func__, current_object_key);
(gdb) backtrace
#0  mono_thread_current () at threads.c:1275
#1  0x68faf7ec in mono_thread_pop_appdomain_ref () at threads.c:2981
#2  0x68faf9ab in thread_cleanup (thread=0xb84d00) at threads.c:528
#3  0x68fb17cd in start_wrapper (data=0xbcd200) at threads.c:639
#4  0x6901a02a in thread_start (arg=0x1144ff8) at win32_threads.c:531
#5  0x7c80b713 in KERNEL32!GetModuleFileNameA ()
   from C:\WINDOWS\system32\kernel32.dll
#6  0x00000000 in ?? ()
(gdb) cont
Continuing.
mono_thread_cleanup: TlsFree current_object_key 0x18
mono_thread_current: mono_thread_current calling GET_CURRENT_OBJECT key: 0x18
Error: dll starting at 0xe00000 not found.


Breakpoint 2, mono_thread_current () at threads.c:1275
1275    {       printf ("%s: mono_thread_current calling GET_CURRENT_OBJECT
key:
 0x%x \n", __func__, current_object_key);
(gdb) backtrace
#0  mono_thread_current () at threads.c:1275
#1  0x68ec3ead in mini_thread_cleanup (thread=0xb84d00) at mini.c:2241
#2  0x68faf997 in thread_cleanup (thread=0xbcd290) at threads.c:541
#3  0x68fb17cd in start_wrapper (data=0xbcd200) at threads.c:639
#4  0x6901a02a in thread_start (arg=0x1144ff8) at win32_threads.c:531
#5  0x7c80b713 in KERNEL32!GetModuleFileNameA ()
   from C:\WINDOWS\system32\kernel32.dll
#6  0x00000000 in ?? ()
(gdb) cont
Continuing.
mono_thread_current: mono_thread_current calling GET_CURRENT_OBJECT key: 0x18


Breakpoint 2, mono_thread_current () at threads.c:1275
1275    {       printf ("%s: mono_thread_current calling GET_CURRENT_OBJECT
key:
 0x%x \n", __func__, current_object_key);
(gdb) backtrace
#0  mono_thread_current () at threads.c:1275
#1  0x68fb16bb in mono_thread_cleanup_apartment_state () at threads.c:3730
#2  0x68fb17d2 in start_wrapper (data=0xbcd200) at threads.c:646
#3  0x6901a02a in thread_start (arg=0x1144ff8) at win32_threads.c:531
#4  0x7c80b713 in KERNEL32!GetModuleFileNameA ()
   from C:\WINDOWS\system32\kernel32.dll
#5  0x00000000 in ?? ()
(gdb) cont
Continuing.
mono_thread_current: mono_thread_current calling GET_CURRENT_OBJECT key: 0x18


Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to thread 3360.0x2058]
0x7c90e4df in ntdll!LdrAlternateResourcesEnabled ()
   from C:\WINDOWS\system32\ntdll.dll
(gdb) ba
#0  0x7c90e4df in ntdll!LdrAlternateResourcesEnabled ()
   from C:\WINDOWS\system32\ntdll.dll
#1  0x7c90e4f4 in ntdll!LdrAccessOutOfProcessResource ()
   from C:\WINDOWS\system32\ntdll.dll
#2  0x7c90cfdc in ntdll!ZwClose () from C:\WINDOWS\system32\ntdll.dll
#3  0x7c809c1b in KERNEL32!CloseHandle ()
   from C:\WINDOWS\system32\kernel32.dll
#4  0x690198fd in GC_delete_gc_thread (thr=0x690bc7fc) at win32_threads.c:180
#5  0x6901a124 in GC_DllMain (inst=0x68ec0000, reason=0, reserved=0x1)
    at win32_threads.c:810
#6  0x68f1f070 in DllMain (module_handle=0x68ec0000, reason=0, reserved=0x1)
    at driver.c:1181
#7  0x68ec1086 in DllMainCRTStartup at 12 ()
   from D:\cygwin\usr\local\bin\mono.dll
#8  0x7c90118a in ntdll!LdrSetAppCompatDllRedirectionCallback ()
   from C:\WINDOWS\system32\ntdll.dll
#9  0x68ec0000 in ?? ()
#10 0x00000000 in ?? ()
(gdb) cont
Continuing.

Program exited with code 02.
(gdb)
]]

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


More information about the mono-bugs mailing list