-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concurrency runtime operator new variants in /MTd lead to many mismatch errors #1239
Comments
From bruen...@google.com on May 16, 2013 21:13:30 **** TODO identify all the msvc operators? solution: we must have syms to hit this (else won't intercept any of these WARNING: unknown 3+-arg overload of operator new in scheduler-instance.exe @0x0131e1d0 **** TODO still have mismatches, but different, once replacing all Error 0 replace_operator_delete_array [d:\derek\drmemory\git\src\common\alloc_replace.c:2428](0x73975400 <drmemorylib.dll+0x175400) modid:3 1 Concurrency::details::SchedulerProxy::GrantAllocation [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerproxy.cpp:652](0x003b39b4 <scheduler-instance.exe+0x639b4) modid:1 2 Concurrency::details::ResourceManager::PerformAllocation [f:\dd\vctools\crt_bld\self_x86\crt\src\resourcemanager.cpp:1909](0x0038963d <scheduler-instance.exe+0x3963d) modid:1 3 Concurrency::details::ResourceManager::RequestInitialVirtualProcessors [f:\dd\vctools\crt_bld\self_x86\crt\src\resourcemanager.cpp:1147](0x0038790e <scheduler-instance.exe+0x3790e) modid:1 4 Concurrency::details::SchedulerProxy::RequestInitialVirtualProcessors [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerproxy.cpp:156](0x003b293d <scheduler-instance.exe+0x6293d) modid:1 5 Concurrency::details::SchedulerBase::Initialize [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp:421](0x00364ffa <scheduler-instance.exe+0x14ffa) modid:1 6 Concurrency::details::SchedulerBase::GetDefaultScheduler [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp:530](0x0036535f <scheduler-instance.exe+0x1535f) modid:1 7 Concurrency::details::SchedulerBase::CreateContextFromDefaultScheduler [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp:444](0x0036514d <scheduler-instance.exe+0x1514d) modid:1 8 Concurrency::details::SchedulerBase::CurrentContext [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.h:260](0x0035fdd7 <scheduler-instance.exe+0xfdd7) modid:1 9 Concurrency::details::_TaskCollection::_TaskCollection [f:\dd\vctools\crt_bld\self_x86\crt\src\taskcollection.cpp:538](0x003609eb <scheduler-instance.exe+0x109eb) modid:1 code looks good: but that new call is: it seems that the _ConcRTNewMoniker operators don't have [] and thus we **** TODO what about non-libc? but what about the bigger picture: the app defines a bunch of operators and |
From derek.br...@gmail.com on May 17, 2013 07:46:13 This issue was closed by revision r1383 . Status: Fixed |
From bruen...@google.com on May 16, 2013 13:41:52
While investigating issue #1233 I tried to make a smaller example that uses the
Concurrency runtime added in VS2010. I took the example code here: http://msdn.microsoft.com/en-us/library/vstudio/ee513829(v=vs.100).aspx building /MTd has a lot of these:
Error
#1
: INVALID HEAP ARGUMENT: allocated with malloc, freed with operator delete#0 replace_operator_delete [d:\derek\drmemory\git\src\common\alloc_replace.c:2408]
#1 Concurrency::SchedulerPolicy::~SchedulerPolicy [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerpolicybase.cpp:155]
#2 Concurrency::details::ResourceManager::CreateSchedulerProxy [f:\dd\vctools\crt_bld\self_x86\crt\src\resourcemanager.cpp:2561]
#3 Concurrency::details::ResourceManager::RegisterScheduler [f:\dd\vctools\crt_bld\self_x86\crt\src\resourcemanager.cpp:1096]
#4 Concurrency::details::SchedulerBase::Initialize [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp:420]
#5 Concurrency::details::SchedulerBase::GetDefaultScheduler [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp:530]
#6 Concurrency::details::SchedulerBase::CreateContextFromDefaultScheduler [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp:444]
#7 Concurrency::details::SchedulerBase::CurrentContext [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.h:260]
#8 Concurrency::details::_TaskCollection::_TaskCollection [f:\dd\vctools\crt_bld\self_x86\crt\src\taskcollection.cpp:538]
#9 Concurrency::task_group::task_group [c:\program files (x86)\microsoft visual studio 10.0\vc\include\ppl.h:454]
#10 perform_task [d:\derek\dr\test\i1233-concurrency\scheduler\scheduler-instance.cpp:14]
#11 current_scheduler [d:\derek\dr\test\i1233-concurrency\scheduler\scheduler-instance.cpp:27]
#12 wmain [d:\derek\dr\test\i1233-concurrency\scheduler\scheduler-instance.cpp:106]
Note: @0:00:00.929 in thread 2404
Note: memory was allocated here:
Note: # 0 replace_malloc [d:\derek\drmemory\git\src\common\alloc_replace.c:2233]
Note: # 1 operator new [f:\dd\vctools\crt_bld\self_x86\crt\src\dbgnew.cpp:55]
Note: # 2 operator new [f:\dd\vctools\crt_bld\self_x86\crt\src\concrtinternal.h:67]
Note: # 3 Concurrency::SchedulerPolicy::SchedulerPolicy [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerpolicybase.cpp:126]
Note: # 4 Concurrency::details::SchedulerBase::GetPolicy [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp:944]
Note: # 5 Concurrency::details::SchedulerResourceManagement::GetPolicy [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerresourcemanagement.cpp:67]
Note: # 6 Concurrency::details::ResourceManager::CreateSchedulerProxy [f:\dd\vctools\crt_bld\self_x86\crt\src\resourcemanager.cpp:2554]
Note: # 7 Concurrency::details::ResourceManager::RegisterScheduler [f:\dd\vctools\crt_bld\self_x86\crt\src\resourcemanager.cpp:1096]
Note: # 8 Concurrency::details::SchedulerBase::Initialize [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp:420]
Note: # 9 Concurrency::details::SchedulerBase::GetDefaultScheduler [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp:530]
Note:
#10
Concurrency::details::SchedulerBase::CreateContextFromDefaultScheduler [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.cpp:444]Note:
#11
Concurrency::details::SchedulerBase::CurrentContext [f:\dd\vctools\crt_bld\self_x86\crt\src\schedulerbase.h:260]Note:
#12
Concurrency::details::_TaskCollection::_TaskCollection [f:\dd\vctools\crt_bld\self_x86\crt\src\taskcollection.cpp:538]Note:
#13
Concurrency::task_group::task_group [c:\program files (x86)\microsoft visual studio 10.0\vc\include\ppl.h:454]Note:
#14
perform_task [d:\derek\dr\test\i1233-concurrency\scheduler\scheduler-instance.cpp:14]Note:
#15
current_scheduler [d:\derek\dr\test\i1233-concurrency\scheduler\scheduler-instance.cpp:27]Note:
#16
wmain [d:\derek\dr\test\i1233-concurrency\scheduler\scheduler-instance.cpp:106]0:000> x scheduler_instance!operator new*
0012fb30 scheduler_instance!operator new (unsigned int, HeapManager, int)
000cfc90 scheduler_instance!operator new (unsigned int, ConcRTNewMoniker, char, int)
000eaf50 scheduler_instance!operator new (unsigned int, int, char_, int)
000e0560 scheduler_instance!operator new (unsigned int)
000ce1d0 scheduler_instance!operator new (unsigned int, std::DebugHeapTag_t, char_, int)
000c81a0 scheduler_instance!operator new (unsigned int, void_)
000eafd0 scheduler_instance!operator new[](unsigned int, int, char*, int)
00143a60 scheduler_instance!operator new[](unsigned int)
000ce280 scheduler_instance!operator new[](unsigned int, std::_DebugHeapTag_t*, char*, int)
operator new in scheduler-instance.exe @0x0033fc90 generic type=10 => drsyms res=0, 4 args
WARNING: unknown 3+-arg overload of operator new in scheduler-instance.exe @0x0033fc90
operator new is not straight-line so type is unknown
WARNING: unable to determine type of operator new in scheduler-instance.exe @0x0033fc90
/MDd works b/c we feel comfortable assuming it's non-placement there.
0:000> U 000cfc90 L20
scheduler_instance!operator new [f:\dd\vctools\crt_bld\self_x86\crt\src\concrtinternal.h @ 66]:
000cfc90 8bff mov edi,edi
000cfc92 55 push ebp
000cfc93 8bec mov ebp,esp
000cfc95 8b4514 mov eax,[ebp+0x14]
000cfc98 50 push eax
000cfc99 8b4d10 mov ecx,[ebp+0x10]
000cfc9c 51 push ecx
000cfc9d 6a02 push 0x2
000cfc9f 8b5508 mov edx,[ebp+0x8]
000cfca2 52 push edx
000cfca3 e8a8b20100 call scheduler_instance!operator new (000eaf50)
000cfca8 83c410 add esp,0x10
000cfcab 5d pop ebp
000cfcac c3 ret
so issue #1006 is wrong: there is a downside to simply not intercepting a few
operator news. we'll report a mismatch if we are intercepting the
corresponding operator deletes! this is a big negative for replacing as
opposed to wrapping: distinguishing placement new.
Original issue: http://code.google.com/p/drmemory/issues/detail?id=1239
The text was updated successfully, but these errors were encountered: