Skip to content

Fix ASAN mismatch - #73549

Merged
hoyosjs merged 2 commits into
dotnet:mainfrom
HJLeee:asan-mismatch
Aug 9, 2022
Merged

Fix ASAN mismatch#73549
hoyosjs merged 2 commits into
dotnet:mainfrom
HJLeee:asan-mismatch

Conversation

@HJLeee

Copy link
Copy Markdown
Contributor

ASAN alloc-dealloc mismatch is detected during dump creation.
Detection happens on .NET 6 but the code is the same with main branch.

@ghostghost added area-Diagnostics-coreclr community-contribution Indicates that the PR has been added by a community member labels Aug 8, 2022
@ghost

ghost commented Aug 8, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

ASAN alloc-dealloc mismatch is detected during dump creation.
Detection happens on .NET 6 but the code is the same with main branch.

Author:HJLeee
Assignees:-
Labels:

area-Diagnostics-coreclr

Milestone:-

@HJLeee

Copy link
Copy Markdown
ContributorAuthor

daccess

==minicoredumper==1213==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x007f92d13fc0
#0 0x7f9758a4a4 in operator delete(void*) ../../../../libsanitizer/asan/asan_new_delete.cpp:215
#1 0x7f90f2d204 in Exception::operator delete(void*) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/utilcode/ex.cpp:78
in ~HRException /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/inc/ex.h:367
#2 0x7f90ee4908 in Exception__Delete(Exception*) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/inc/ex.h:287
in FunctionBase<Exception*, &(void DoNothing<Exception*>(Exception*)), &(Exception__Delete(Exception*))>::DoRelease() /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/inc/holder.h:716
in BaseHolder<Exception*, FunctionBase<Exception*, &(void DoNothing<Exception*>(Exception*)), &(Exception__Delete(Exception*))>, 0ul, &(int CompareDefault<Exception*>(Exception*, Exception*))>::Release() /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/inc/holder.h:293
in ~BaseHolder /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/inc/holder.h:261
in Thread::EnumMemoryRegions(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/vm/threads.cpp:8428
#3 0x7f90eb1380 in ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1206
#4 0x7f90eb4680 in ClrDataAccess::EnumMemoryRegionsWorkerSkinny(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1617
#5 0x7f90eb6378 in ClrDataAccess::EnumMemoryRegionsWrapper(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1872
#6 0x7f90eb65c8 in ClrDataAccess::EnumMemoryRegions(ICLRDataEnumMemoryRegionsCallback*, unsigned int, CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1984
#7 0x7f942e0508 in CrashInfo::EnumerateMemoryRegionsWithDAC(_MINIDUMP_TYPE) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/crashinfo.cpp:321
#8 0x7f942e5d10 in prepare_crash_info(int, elf_prstatus**, int, DUMP_TYPE, ReleaseHolder<CrashInfo>&) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/dnetmemoryenumlib.cpp:83
#9 0x7f942e5e40 in DotNetMemoryWriteDump /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/dnetmemoryenumlib.cpp:113
#10 0x557005b814 (/usr/sbin/minicoredumper+0x1b814)
#11 0x557005be38 (/usr/sbin/minicoredumper+0x1be38)
#12 0x557005c360 (/usr/sbin/minicoredumper+0x1c360)
#13 0x557005c938 (/usr/sbin/minicoredumper+0x1c938)
#14 0x557005db90 (/usr/sbin/minicoredumper+0x1db90)
#15 0x7f97277ff0 in __libc_start_main ../csu/libc-start.c:308
#16 0x5570049260 (/usr/sbin/minicoredumper+0x9260)
0x007f92d13fc0 is located 0 bytes inside of 24-byte region [0x007f92d13fc0,0x007f92d13fd8)
allocated by thread T0 here:
#0 0x7f97589cec in operator new[](unsigned long) ../../../../libsanitizer/asan/asan_new_delete.cpp:106
#1 0x7f90f2b850 in operator new[](unsigned long, NoThrow const&) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/utilcode/clrhost_nodependencies.cpp:373
#2 0x7f90e7d1c8 in AllocDbiMemory(unsigned long) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/dacdbiimpl.cpp:167
#3 0x7f90ea6b64 in DacError /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/dacfn.cpp:116
#4 0x7f90ec4ec0 DacGetThreadContext(Thread*, _CONTEXT*) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/reimpl.cpp:?
#5 0x7f90ee0540 in ClrDataStackWalk::Init() /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/stack.cpp:473
#6 0x7f90ee4794 in ClrDataTask::CreateStackWalk(unsigned int, IXCLRDataStackWalk**) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/task.cpp:358
#7 0x7f90eb1380 in ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1206
#8 0x7f90eb4680 in ClrDataAccess::EnumMemoryRegionsWorkerSkinny(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1617
#9 0x7f90eb6378 in ClrDataAccess::EnumMemoryRegionsWrapper(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1872
#10 0x7f90eb65c8 in ClrDataAccess::EnumMemoryRegions(ICLRDataEnumMemoryRegionsCallback*, unsigned int, CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1984
#11 0x7f942e0508 in CrashInfo::EnumerateMemoryRegionsWithDAC(_MINIDUMP_TYPE) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/crashinfo.cpp:321
#12 0x7f942e5d10 in prepare_crash_info(int, elf_prstatus**, int, DUMP_TYPE, ReleaseHolder<CrashInfo>&) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/dnetmemoryenumlib.cpp:83
#13 0x7f942e5e40 in DotNetMemoryWriteDump /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/dnetmemoryenumlib.cpp:113
#14 0x557005b814 (/usr/sbin/minicoredumper+0x1b814)
#15 0x557005be38 (/usr/sbin/minicoredumper+0x1be38)
#16 0x557005c360 (/usr/sbin/minicoredumper+0x1c360)
#17 0x557005c938 (/usr/sbin/minicoredumper+0x1c938)
#18 0x557005db90 (/usr/sbin/minicoredumper+0x1db90)
#19 0x7f97277ff0 in __libc_start_main ../csu/libc-start.c:308
#20 0x5570049260 (/usr/sbin/minicoredumper+0x9260)
SUMMARY: AddressSanitizer: alloc-dealloc-mismatch ../../../../libsanitizer/asan/asan_new_delete.cpp:215 in operator delete(void*)
==minicoredumper==1213==HINT: if you don't care about these errors you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0
Command: /usr/sbin/minicoredumper -d /opt/usr/share/crash/temp//crash.AgiujL/org.tizen.oobe_1131_20220805173124 -o org.tizen.oobe_1131_20220805173124.coredump -P 8 1131 5001 100 11 1659688284 localhost Oobe.dll /etc/minicoredumper/minicoredumper.cfg.json

@HJLeee

Copy link
Copy Markdown
ContributorAuthor

dacdbiimpl

==minicoredumper==1210==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x007fba313f60
#0 0x7fbebd04a4 in operator delete(void*) ../../../../libsanitizer/asan/asan_new_delete.cpp:215
#1 0x7fb852d204 in Exception::operator delete(void*) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/utilcode/ex.cpp:78
#2 0x7fb852d204 in HRException::~HRException() /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/inc/ex.h:367
#3 0x7fb84e4908 in Exception__Delete(Exception*) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/inc/ex.h:287
#4 0x7fb84e4908 in FunctionBase<Exception*, &(void DoNothing<Exception*>(Exception*)), &(Exception__Delete(Exception*))>::DoRelease() /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/inc/holder.h:716
#5 0x7fb84e4908 in BaseHolder<Exception*, FunctionBase<Exception*, &(void DoNothing<Exception*>(Exception*)), &(Exception__Delete(Exception*))>, 0ul, &(int CompareDefault<Exception*>(Exception*, Exception*))>::Release() /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/inc/holder.h:293
#6 0x7fb84e4908 in BaseHolder<Exception*, FunctionBase<Exception*, &(void DoNothing<Exception*>(Exception*)), &(Exception__Delete(Exception*))>, 0ul, &(int CompareDefault<Exception*>(Exception*, Exception*))>::~BaseHolder() /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/inc/holder.h:261
#7 0x7fb84e4908 in ClrDataTask::CreateStackWalk(unsigned int, IXCLRDataStackWalk**) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/task.cpp:379
#8 0x7fb84b1380 in ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1206
#9 0x7fb84b4680 in ClrDataAccess::EnumMemoryRegionsWorkerSkinny(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1617
#10 0x7fb84b6378 in ClrDataAccess::EnumMemoryRegionsWrapper(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1872
#11 0x7fb84b65c8 in ClrDataAccess::EnumMemoryRegions(ICLRDataEnumMemoryRegionsCallback*, unsigned int, CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1984
#12 0x7fbba4d508 in CrashInfo::EnumerateMemoryRegionsWithDAC(_MINIDUMP_TYPE) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/crashinfo.cpp:321
#13 0x7fbba52d10 in prepare_crash_info(int, elf_prstatus**, int, DUMP_TYPE, ReleaseHolder<CrashInfo>&) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/dnetmemoryenumlib.cpp:83
#14 0x7fbba52e40 in DotNetMemoryWriteDump /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/dnetmemoryenumlib.cpp:113
#15 0x55853eb814 (/usr/sbin/minicoredumper+0x1b814)
#16 0x55853ebe38 (/usr/sbin/minicoredumper+0x1be38)
#17 0x55853ec360 (/usr/sbin/minicoredumper+0x1c360)
#18 0x55853ec938 (/usr/sbin/minicoredumper+0x1c938)
#19 0x55853edb90 (/usr/sbin/minicoredumper+0x1db90)
#20 0x7fbe8bdff0 in __libc_start_main ../csu/libc-start.c:308
#21 0x55853d9260 (/usr/sbin/minicoredumper+0x9260)
0x007fba313f60 is located 0 bytes inside of 24-byte region [0x007fba313f60,0x007fba313f78)
allocated by thread T0 here:
#0 0x7fbebcfcec in operator new[](unsigned long) ../../../../libsanitizer/asan/asan_new_delete.cpp:106
#1 0x7fb852b850 in operator new[](unsigned long, NoThrow const&) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/utilcode/clrhost_nodependencies.cpp:373
#2 0x7fb847d1c8 in AllocDbiMemory(unsigned long) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/dacdbiimpl.cpp:167
#3 0x7fb84a6b64 in DacError /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/dacfn.cpp:116
#4 0x7fb84c4ec0 in DacGetThreadContext(Thread*, _CONTEXT*) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/reimpl.cpp
#5 0x7fb84e0540 in ClrDataStackWalk::Init() /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/stack.cpp:473
#6 0x7fb84e4794 in ClrDataTask::CreateStackWalk(unsigned int, IXCLRDataStackWalk**) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/task.cpp:358
#7 0x7fb84b1380 in ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1206
#8 0x7fb84b4680 in ClrDataAccess::EnumMemoryRegionsWorkerSkinny(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1617
#9 0x7fb84b6378 in ClrDataAccess::EnumMemoryRegionsWrapper(CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1872
#10 0x7fb84b65c8 in ClrDataAccess::EnumMemoryRegions(ICLRDataEnumMemoryRegionsCallback*, unsigned int, CLRDataEnumMemoryFlags) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/daccess/enummem.cpp:1984
#11 0x7fbba4d508 in CrashInfo::EnumerateMemoryRegionsWithDAC(_MINIDUMP_TYPE) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/crashinfo.cpp:321
#12 0x7fbba52d10 in prepare_crash_info(int, elf_prstatus**, int, DUMP_TYPE, ReleaseHolder<CrashInfo>&) /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/dnetmemoryenumlib.cpp:83
#13 0x7fbba52e40 in DotNetMemoryWriteDump /usr/src/debug/coreclr-6.0.0-0.aarch64/src/coreclr/debug/createdump/dnetmemoryenumlib.cpp:113
#14 0x55853eb814 (/usr/sbin/minicoredumper+0x1b814)
#15 0x55853ebe38 (/usr/sbin/minicoredumper+0x1be38)
#16 0x55853ec360 (/usr/sbin/minicoredumper+0x1c360)
#17 0x55853ec938 (/usr/sbin/minicoredumper+0x1c938)
#18 0x55853edb90 (/usr/sbin/minicoredumper+0x1db90)
#19 0x7fbe8bdff0 in __libc_start_main ../csu/libc-start.c:308
#20 0x55853d9260 (/usr/sbin/minicoredumper+0x9260)
SUMMARY: AddressSanitizer: alloc-dealloc-mismatch ../../../../libsanitizer/asan/asan_new_delete.cpp:215 in operator delete(void*)
==minicoredumper==1210==HINT: if you don't care about these errors you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0
Command: /usr/sbin/minicoredumper -d /opt/usr/share/crash/temp//crash.oFFHvG/org.tizen.oobe_1132_20220808124444 -o org.tizen.oobe_1132_20220808124444.coredump -P 8 1132 5001 100 11 1659930284 localhost Oobe.dll /etc/minicoredumper/minicoredumper.cfg.json

@tommcdon

Copy link
Copy Markdown
Member

@mikem8361@hoyosjs

@hoyosjs

Copy link
Copy Markdown
Member

Failure is #73247

@hoyosjs
hoyosjs merged commit b8ffae5 into dotnet:mainAug 9, 2022
@ghostghost locked as resolved and limited conversation to collaborators Sep 8, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Diagnostics-coreclrcommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@HJLeee@tommcdon@hoyosjs@mikem8361