mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
e82f41785f
This commit introduces heap-use-after-free detected by ASan. Here is the output for one of several tests that detect it: ******************** TEST 'LLVM :: Linker/AppendingLinkage.ll' FAILED ******************** Command Output (stderr): -- ================================================================= ==2122==ERROR: AddressSanitizer: heap-use-after-free on address 0x60c00000b9c8 at pc 0x0000005d05d1 bp 0x7fff64ed27c0 sp 0x7fff64ed27b8 READ of size 4 at 0x60c00000b9c8 thread T0 #0 0x5d05d0 in llvm::GlobalValue::setUnnamedAddr(bool) /usr/local/google/home/chandlerc/src/llvm/build/../include/llvm/IR/GlobalValue.h:115:35 #1 0x69fff1 in (anonymous namespace)::ModuleLinker::linkGlobalValueProto(llvm::GlobalValue*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1041:5 #2 0x697229 in (anonymous namespace)::ModuleLinker::run() /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1485:9 #3 0x696542 in llvm::Linker::linkInModule(llvm::Module*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1621:10 #4 0x4a2db7 in main /usr/local/google/home/chandlerc/src/llvm/build/../tools/llvm-link/llvm-link.cpp:116:9 #5 0x7f4ae61e5ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287 #6 0x41eb71 in _start (/usr/local/google/home/chandlerc/src/llvm/build/bin/llvm-link+0x41eb71) 0x60c00000b9c8 is located 72 bytes inside of 128-byte region [0x60c00000b980,0x60c00000ba00) freed by thread T0 here: #0 0x4a1e6b in operator delete(void*) /usr/local/google/home/chandlerc/src/llvm/opt-build/../projects/compiler-rt/lib/asan/asan_new_delete.cc:94:3 #1 0x5d1a7a in llvm::iplist<llvm::GlobalVariable, llvm::ilist_traits<llvm::GlobalVariable> >::erase(llvm::ilist_iterator<llvm::GlobalVariable>) /usr/local/google/home/chandlerc/src/llvm/build/../inclu de/llvm/ADT/ilist.h:466:5 #2 0x5d1980 in llvm::GlobalVariable::eraseFromParent() /usr/local/google/home/chandlerc/src/llvm/build/../lib/IR/Globals.cpp:204:3 #3 0x6a8a4d in (anonymous namespace)::ModuleLinker::linkAppendingVarProto(llvm::GlobalVariable*, llvm::GlobalVariable const*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules. cpp:980:3 #4 0x6a7403 in (anonymous namespace)::ModuleLinker::linkGlobalVariableProto(llvm::GlobalVariable const*, llvm::GlobalValue*, bool) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkMod ules.cpp:1074:11 #5 0x69ff4e in (anonymous namespace)::ModuleLinker::linkGlobalValueProto(llvm::GlobalValue*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1028:13 #6 0x697229 in (anonymous namespace)::ModuleLinker::run() /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1485:9 #7 0x696542 in llvm::Linker::linkInModule(llvm::Module*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1621:10 #8 0x4a2db7 in main /usr/local/google/home/chandlerc/src/llvm/build/../tools/llvm-link/llvm-link.cpp:116:9 #9 0x7f4ae61e5ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287 previously allocated by thread T0 here: #0 0x4a192b in operator new(unsigned long) /usr/local/google/home/chandlerc/src/llvm/opt-build/../projects/compiler-rt/lib/asan/asan_new_delete.cc:62:35 #1 0x61d85c in llvm::User::operator new(unsigned long, unsigned int) /usr/local/google/home/chandlerc/src/llvm/build/../lib/IR/User.cpp:57:19 #2 0x6a7525 in (anonymous namespace)::ModuleLinker::linkGlobalVariableProto(llvm::GlobalVariable const*, llvm::GlobalValue*, bool) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkMod ules.cpp:1100:3 #3 0x69ff4e in (anonymous namespace)::ModuleLinker::linkGlobalValueProto(llvm::GlobalValue*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1028:13 #4 0x697229 in (anonymous namespace)::ModuleLinker::run() /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1485:9 #5 0x696542 in llvm::Linker::linkInModule(llvm::Module*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1621:10 #6 0x4a2db7 in main /usr/local/google/home/chandlerc/src/llvm/build/../tools/llvm-link/llvm-link.cpp:116:9 #7 0x7f4ae61e5ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287 SUMMARY: AddressSanitizer: heap-use-after-free /usr/local/google/home/chandlerc/src/llvm/build/../include/llvm/IR/GlobalValue.h:115 llvm::GlobalValue::setUnnamedAddr(bool) Shadow bytes around the buggy address: 0x0c187fff96e0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c187fff96f0: 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa 0x0c187fff9700: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa 0x0c187fff9710: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c187fff9720: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa =>0x0c187fff9730: fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd 0x0c187fff9740: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c187fff9750: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa 0x0c187fff9760: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c187fff9770: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c187fff9780: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac ASan internal: fe ==2122==ABORTING git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221096 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
Inputs | ||
2002-07-17-GlobalFail.ll | ||
2002-07-17-LinkTest2.ll | ||
2002-08-20-ConstantExpr.ll | ||
2003-01-30-LinkerRename.ll | ||
2003-01-30-LinkerTypeRename.ll | ||
2003-04-23-LinkOnceLost.ll | ||
2003-04-26-NullPtrLinkProblem.ll | ||
2003-05-15-TypeProblem.ll | ||
2003-05-31-LinkerRename.ll | ||
2003-06-02-TypeResolveProblem2.ll | ||
2003-06-02-TypeResolveProblem.ll | ||
2003-08-20-OpaqueTypeResolve.ll | ||
2003-08-23-GlobalVarLinking.ll | ||
2003-08-23-RecursiveOpaqueTypeResolve.ll | ||
2003-08-24-InheritPtrSize.ll | ||
2003-08-28-TypeResolvesGlobal2.ll | ||
2003-08-28-TypeResolvesGlobal3.ll | ||
2003-08-28-TypeResolvesGlobal.ll | ||
2003-10-27-LinkOncePromote.ll | ||
2003-11-18-TypeResolution.ll | ||
2004-02-17-WeakStrongLinkage.ll | ||
2004-05-07-TypeResolution1.ll | ||
2004-05-07-TypeResolution2.ll | ||
2004-12-03-DisagreeingType.ll | ||
2005-02-12-ConstantGlobals-2.ll | ||
2005-02-12-ConstantGlobals.ll | ||
2005-12-06-AppendingZeroLengthArrays.ll | ||
2006-01-19-ConstantPacked.ll | ||
2006-06-15-GlobalVarAlignment.ll | ||
2008-03-05-AliasReference2.ll | ||
2008-03-05-AliasReference.ll | ||
2008-03-07-DroppedSection_a.ll | ||
2008-03-07-DroppedSection_b.ll | ||
2008-06-13-LinkOnceRedefinition.ll | ||
2008-06-26-AddressSpace.ll | ||
2008-07-06-AliasFnDecl2.ll | ||
2008-07-06-AliasFnDecl.ll | ||
2008-07-06-AliasWeakDest2.ll | ||
2008-07-06-AliasWeakDest.ll | ||
2009-09-03-mdnode2.ll | ||
2009-09-03-mdnode.ll | ||
2011-08-04-DebugLoc2.ll | ||
2011-08-04-DebugLoc.ll | ||
2011-08-04-Metadata2.ll | ||
2011-08-04-Metadata.ll | ||
2011-08-18-unique-class-type2.ll | ||
2011-08-18-unique-class-type.ll | ||
2011-08-18-unique-debug-type2.ll | ||
2011-08-18-unique-debug-type.ll | ||
2011-08-22-ResolveAlias2.ll | ||
2011-08-22-ResolveAlias.ll | ||
alias.ll | ||
AppendingLinkage2.ll | ||
AppendingLinkage.ll | ||
available_externally_a.ll | ||
available_externally_b.ll | ||
basiclink.ll | ||
comdat2.ll | ||
comdat3.ll | ||
comdat4.ll | ||
comdat5.ll | ||
comdat6.ll | ||
comdat7.ll | ||
comdat8.ll | ||
comdat9.ll | ||
comdat.ll | ||
ConstantGlobals.ll | ||
constructor-comdat.ll | ||
ctors.ll | ||
datalayout.ll | ||
DbgDeclare2.ll | ||
DbgDeclare.ll | ||
debug-info-version-a.ll | ||
debug-info-version-b.ll | ||
dllstorage-a.ll | ||
dllstorage-b.ll | ||
func-attrs-a.ll | ||
func-attrs-b.ll | ||
global_ctors.ll | ||
inlineasm.ll | ||
link-global-to-func.ll | ||
link-type-names.ll | ||
linkage2.ll | ||
linkage.ll | ||
linkmdnode2.ll | ||
linkmdnode.ll | ||
linknamedmdnode2.ll | ||
linknamedmdnode.ll | ||
LinkOnce.ll | ||
metadata-a.ll | ||
metadata-b.ll | ||
module-flags-1-a.ll | ||
module-flags-1-b.ll | ||
module-flags-2-a.ll | ||
module-flags-2-b.ll | ||
module-flags-3-a.ll | ||
module-flags-3-b.ll | ||
module-flags-4-a.ll | ||
module-flags-4-b.ll | ||
module-flags-5-a.ll | ||
module-flags-5-b.ll | ||
module-flags-6-a.ll | ||
module-flags-6-b.ll | ||
module-flags-7-a.ll | ||
module-flags-7-b.ll | ||
module-flags-8-a.ll | ||
module-flags-8-b.ll | ||
multiple-merged-structs.ll | ||
partial-type-refinement-link.ll | ||
partial-type-refinement.ll | ||
PR8300.ll | ||
prefixdata.ll | ||
redefinition.ll | ||
targettriple.ll | ||
testlink1.ll | ||
testlink2.ll | ||
transitive-lazy-link.ll | ||
type-unique-inheritance.ll | ||
type-unique-odr-a.ll | ||
type-unique-odr-b.ll | ||
type-unique-simple2-a.ll | ||
type-unique-simple2-b.ll | ||
type-unique-simple2.ll | ||
type-unique-simple-a.ll | ||
type-unique-simple-b.ll | ||
type-unique-type-array-a.ll | ||
type-unique-type-array-b.ll | ||
unnamed-addr1-a.ll | ||
unnamed-addr1-b.ll | ||
unnamed-addr-err-a.ll | ||
unnamed-addr-err-b.ll | ||
visibility.ll | ||
weakextern.ll |