www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18190] New: [asan] heap-buffer-overflow in

https://issues.dlang.org/show_bug.cgi?id=18190

          Issue ID: 18190
           Summary: [asan] heap-buffer-overflow in
                    Module.load.checkModFileAlias
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

Created attachment 1674
  --> https://issues.dlang.org/attachment.cgi?id=1674&action=edit
ASan log

Occured while running compilable/test16798.d.

=================================================================
==13718==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x602000005a80 at pc 0x000000f54b01 bp 0x7fff48b01170 sp 0x7fff48b00920
READ of size 21 at 0x602000005a80 thread T0
    #0 0xf54b00 in __interceptor_memcmp.part.76
/build/src/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:773
    #1 0xb12fb8 in
_D3dmd7dmodule6Module4loadRS3dmd7globals3LocPS3dmd4root5array40__T5ArrayTC3dmd10identifier10IdentifierZ5ArrayC3dmd10identifier10IdentifierZ17checkModFileAliasMFNbPxaZv
(/home/dawg/Code/D/DPL/dmd/generated/linux/release/64/dmd+0xb12fb8)
    #2 0xb126cc in Module::load(Loc, Array<Identifier*>*, Identifier*)
(/home/dawg/Code/D/DPL/dmd/generated/linux/release/64/dmd+0xb126cc)

...

0x602000005a80 is located 0 bytes to the right of 16-byte region
[0x602000005a70,0x602000005a80)
allocated by thread T0 here:
    #0 0xf7cab8 in malloc
/build/src/compiler-rt/lib/asan/asan_malloc_linux.cc:67
    #1 0xecbf76 in Mem::xrealloc(void*, unsigned long)
(/home/dawg/Code/D/DPL/dmd/generated/linux/release/64/dmd+0xecbf76)
    #2 0x8e8e15 in Import::load(Scope*)
(/home/dawg/Code/D/DPL/dmd/generated/linux/release/64/dmd+0x8e8e15)
==============================

--
Jan 03