Bug 24720

Summary: Crash when freeing COM callable wrappers
Product: [Mono] Runtime Reporter: daspits
Component: InteropAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono, mono-bugs+runtime, vargaz
Priority: ---    
Version: 3.4.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description daspits 2014-11-21 04:15:44 UTC
Occasionally, a crash occurs when attempting to free a CCW. The crash occurs in the "mono_marshal_free_ccw" function. It seems to be caused by an invalid pointer to the CCW list for an object returned from the ccw_hash hashtable. The CCW list pointer becomes invalid when the first item in a CCW list is removed. The hashtable holds the pointer to the first item in the list, so the pointer it holds becomes invalid in that case. The fix would be to re-add the CCW list to the hashtable when the first item in the list is removed.
Comment 1 Zoltan Varga 2015-01-08 05:05:31 UTC
Applied a fix to mono master a568b19c13fc2ea713f8ac2d9f2126214cae4ff7.