[llvm-bugs] [Bug 27021] New: WinASan should use TerminateProcess instead of ExitProcess in internal__exit

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 21 16:10:43 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27021

            Bug ID: 27021
           Summary: WinASan should use TerminateProcess instead of
                    ExitProcess in internal__exit
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Otherwise we can get into an infinite loop in AsanDie. See my stack:

0:000> k
 # ChildEBP RetAddr  
00 0033e828 00346509 dll_cerr_cc!__asan::AsanDie+0x12
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_rtl.cc @ 46]
01 0033e830 0034ed38 dll_cerr_cc!__sanitizer::Die+0x19
[d:\src\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_common.cc @
142]
02 0033e83c 00350b85
dll_cerr_cc!__asan::ScopedInErrorReport::~ScopedInErrorReport+0xc8
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_report.cc @ 713]
03 0033ece0 0035b94c dll_cerr_cc!__asan::ReportFreeNotMalloced+0x125
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_report.cc @ 859]
04 (Inline) -------- dll_cerr_cc!__asan::Allocator::ReportInvalidFree+0x1b
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_allocator.cc @ 577]
05 (Inline) --------
dll_cerr_cc!__asan::Allocator::AtomicallySetQuarantineFlagIfAllocated+0x35
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_allocator.cc @ 469]
06 (Inline) -------- dll_cerr_cc!__asan::Allocator::Deallocate+0x55
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_allocator.cc @ 533]
07 0033ed00 00352c17 dll_cerr_cc!__asan::asan_free+0x5c
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_allocator.cc @ 717]
08 0033f128 0038d09c dll_cerr_cc!free+0xb7
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_malloc_win.cc @ 43]
09 0033f138 77df95c1 dll_cerr_cc!destroy_fls+0x1b
[d:\th\minkernel\crts\ucrt\src\appcrt\internal\per_thread_data.cpp @ 195]
WARNING: Stack unwind information not available. Following frames may be wrong.
0a 0033f154 77e19eee ntdll!RtlIsCurrentThreadAttachExempt+0x5f
0b 0033f1ec 77e19e3a ntdll!LdrShutdownProcess+0x97
0c 0033f200 76bf79ed ntdll!RtlExitUserProcess+0x74
0d 0033f214 0034888c kernel32!ExitProcess+0x15
0e 0033f220 0034652d dll_cerr_cc!__sanitizer::internal__exit+0xc
[d:\src\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc @ 620]
0f 0033f22c 0034ed38 dll_cerr_cc!__sanitizer::Die+0x3d
[d:\src\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_common.cc @
148]
10 0033f238 00350b85
dll_cerr_cc!__asan::ScopedInErrorReport::~ScopedInErrorReport+0xc8
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_report.cc @ 713]
11 0033f6dc 0035b94c dll_cerr_cc!__asan::ReportFreeNotMalloced+0x125
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_report.cc @ 859]
12 (Inline) -------- dll_cerr_cc!__asan::Allocator::ReportInvalidFree+0x1b
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_allocator.cc @ 577]
13 (Inline) --------
dll_cerr_cc!__asan::Allocator::AtomicallySetQuarantineFlagIfAllocated+0x35
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_allocator.cc @ 469]
14 (Inline) -------- dll_cerr_cc!__asan::Allocator::Deallocate+0x55
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_allocator.cc @ 533]
15 0033f6fc 00352c17 dll_cerr_cc!__asan::asan_free+0x5c
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_allocator.cc @ 717]
16 0033fb24 0037187d dll_cerr_cc!free+0xb7
[d:\src\llvm\projects\compiler-rt\lib\asan\asan_malloc_win.cc @ 43]
17 0033fb30 00387c64 dll_cerr_cc!__acrt_uninitialize_stdio+0x42
[d:\th\minkernel\crts\ucrt\src\appcrt\stdio\_file.cpp @ 132]
18 0033fb4c 00387e42 dll_cerr_cc!_initterm+0x43
[d:\th\minkernel\crts\ucrt\src\appcrt\startup\initterm.cpp @ 16]
19 0033fb88 0038805d dll_cerr_cc!common_exit+0xb9
[d:\th\minkernel\crts\ucrt\src\appcrt\startup\exit.cpp @ 230]
1a 0033fb9c 00364d46 dll_cerr_cc!exit+0x11
[d:\th\minkernel\crts\ucrt\src\appcrt\startup\exit.cpp @ 282]
1b 0033fbdc 76bf338a dll_cerr_cc!__scrt_common_main_seh+0x11a
[f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 275]
1c 0033fbe8 77df9a02 kernel32!BaseThreadInitThunk+0x12
1d 0033fc28 77df99d5 ntdll!RtlInitializeExceptionChain+0x63

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160321/578128bd/attachment.html>


More information about the llvm-bugs mailing list