Bug 47762 - EXC_BAD_ACCESS when unloading assembly
Summary: EXC_BAD_ACCESS when unloading assembly
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: 4.8.0 (C9)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Andi McClure
URL:
Depends on:
Blocks:
 
Reported: 2016-11-23 17:27 UTC by Marek Safar
Modified: 2016-11-28 16:22 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
test (6.20 KB, application/zip)
2016-11-23 17:27 UTC, Marek Safar
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Marek Safar 2016-11-23 17:27:24 UTC
Created attachment 18625 [details]
test

* thread #1: tid = 0x3a568c2, 0x0000000100285746 mono`monoeg_g_str_hash(v1=0x00000001014fe41c) + 38 at ghashtable.c:667, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1014fe41c)
    frame #0: 0x0000000100285746 mono`monoeg_g_str_hash(v1=0x00000001014fe41c) + 38 at ghashtable.c:667
   664 		guint hash = 0;
   665 		char *p = (char *) v1;
   666
-> 667 		while (*p++)
   668 			hash = (hash << 5) - (hash + *p);
   669
   670 		return hash;
(lldb) bt
* thread #1: tid = 0x3a568c2, 0x0000000100285746 mono`monoeg_g_str_hash(v1=0x00000001014fe41c) + 38 at ghashtable.c:667, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1014fe41c)
  * frame #0: 0x0000000100285746 mono`monoeg_g_str_hash(v1=0x00000001014fe41c) + 38 at ghashtable.c:667
    frame #1: 0x00000001002849c2 mono`monoeg_g_hash_table_lookup_extended(hash=0x0000000101500880, key=0x00000001014fe41c, orig_key=0x00007fff5fbff430, value=0x00007fff5fbff428) + 130 at ghashtable.c:328
    frame #2: 0x0000000100284915 mono`monoeg_g_hash_table_lookup(hash=0x0000000101500880, key=0x00000001014fe41c) + 37 at ghashtable.c:311
    frame #3: 0x0000000100165157 mono`mono_image_close_except_pools(image=0x000000010700be00) + 311 at image.c:1746 [opt]
    frame #4: 0x00000001001656cd mono`mono_image_close_except_pools + 23 at image.c:1706 [opt]
    frame #5: 0x00000001001656b6 mono`mono_image_close_except_pools(image=<unavailable>) + 1686 at image.c:1911 [opt]
    frame #6: 0x000000010012a72f mono`mono_assembly_close_except_image_pools(assembly=0x000000010070e900) + 239 at assembly.c:3458 [opt]
    frame #7: 0x000000010016522e mono`mono_image_close_except_pools(image=<unavailable>) + 526 at image.c:1780 [opt]
    frame #8: 0x000000010016414e mono`mono_image_close(image=0x0000000103002400) + 14 at image.c:1990 [opt]
    frame #9: 0x00000001001eaa87 mono`mono_cleanup [inlined] mono_close_exe_image + 23 at domain.c:914 [opt]
    frame #10: 0x00000001001eaa74 mono`mono_cleanup + 4 at domain.c:888 [opt]
    frame #11: 0x00000001000119ce mono`mini_cleanup(domain=<unavailable>) + 974 at mini-runtime.c:4186 [opt]
    frame #12: 0x0000000100086b98 mono`mono_main(argc=<unavailable>, argv=<unavailable>) + 8248 at driver.c:2152 [opt]
    frame #13: 0x0000000100001844 mono`main [inlined] mono_main_with_options(argc=<unavailable>, argv=<unavailable>) + 17 at main.c:45 [opt]
    frame #14: 0x0000000100001833 mono`main(argc=2, argv=<unavailable>) + 1843 at main.c:338 [opt]
    frame #15: 0x00007fff8c1bc5ad libdyld.dylib`start + 1
    frame #16: 0x00007fff8c1bc5ad libdyld.dylib`start + 1
Comment 1 Andi McClure 2016-11-23 21:06:14 UTC
Can you give me more information? Does this happen all the time or was it a one time thing? What version of Mono did you see it on? What are the source of these files, are they the unmodified test-multi tests from mono/tests?
Comment 2 Marek Safar 2016-11-24 08:42:41 UTC
Did you try to run attached test case? The output is from same sources but compiled with csc
Comment 3 Zoltan Varga 2016-11-26 21:16:11 UTC
https://github.com/mono/mono/pull/4029
Comment 4 Zoltan Varga 2016-11-28 16:22:40 UTC
Fixed in master.