Bug 67494 - xsinfo sanitizer detects overlapping strings in assignment statement
Summary: xsinfo sanitizer detects overlapping strings in assignment statement
Status: RESOLVED DUPLICATE of bug 64057
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 5.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-08 14:02 UTC by Vittorio Zecca
Modified: 2016-06-29 10:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2015-12-06 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vittorio Zecca 2015-09-08 14:02:16 UTC
The sanitizer detects overlapping strings in the assignemnt statement 

DR.Data (1 .. Source'Length) := Source;

in a-strunb.adb:1456.

The following is the sanitizer snapshot during gcc build

(cd ada/bldtools/sinfo; gnatmake -q xsinfo ; ./xsinfo sinfo.h )

Check for field name consistency
     OK

Check for function consistency
     OK

Check for missing functions
     OK

Check for set procedure consistency
     OK

Check for missing set procedures
     OK

Check pragma Inlines are all for existing subprograms
=================================================================
==7358==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x60400001329c,0x6040000132aa) and [0x6040000132a0, 0x6040000132ae) overlap
    #0 0x2adcc5f71762 in __asan_memcpy ../../../../gcc-5.2.0/libsanitizer/asan/asan_interceptors.cc:365
    #1 0x42bed0 in ada__strings__unbounded__set_unbounded_string /home/vitti/gcc-5.2.0-obj/gcc/ada/rts/a-strunb.adb:1456
    #2 0x442c2a in gnat__spitbol__patterns__xmatch /home/vitti/gcc-5.2.0-obj/gcc/ada/rts/g-spipat.adb:4066
    #3 0x4435ba in gnat__spitbol__patterns__match /home/vitti/gcc-5.2.0-obj/gcc/ada/rts/g-spipat.adb:2806
    #4 0x40ae6e in _ada_csinfo (/home/vitti/1tb/vitti/gcc-5.2.0-undefined/gcc/ada/bldtools/sinfo/xsinfo+0x40ae6e)
    #5 0x41ba7f in _ada_xsinfo (/home/vitti/1tb/vitti/gcc-5.2.0-undefined/gcc/ada/bldtools/sinfo/xsinfo+0x41ba7f)
    #6 0x402b05 in main (/home/vitti/1tb/vitti/gcc-5.2.0-undefined/gcc/ada/bldtools/sinfo/xsinfo+0x402b05)
    #7 0x390da1ffdf in __libc_start_main (/lib64/libc.so.6+0x390da1ffdf)
    #8 0x4025f3  (/home/vitti/1tb/vitti/gcc-5.2.0-undefined/gcc/ada/bldtools/sinfo/xsinfo+0x4025f3)

0x60400001329c is located 12 bytes inside of 48-byte region [0x604000013290,0x6040000132c0)
allocated by thread T0 here:
    #0 0x2adcc5f7d509 in __interceptor_malloc ../../../../gcc-5.2.0/libsanitizer/asan/asan_malloc_linux.cc:38
    #1 0x458a10 in __gnat_malloc /home/vitti/gcc-5.2.0-obj/gcc/ada/rts/s-memory.adb:92
    #2 0x60600006157f  (<unknown module>)

0x6040000132a0 is located 16 bytes inside of 48-byte region [0x604000013290,0x6040000132c0)
allocated by thread T0 here:
    #0 0x2adcc5f7d509 in __interceptor_malloc ../../../../gcc-5.2.0/libsanitizer/asan/asan_malloc_linux.cc:38
    #1 0x458a10 in __gnat_malloc /home/vitti/gcc-5.2.0-obj/gcc/ada/rts/s-memory.adb:92
    #2 0x60600006157f  (<unknown module>)

SUMMARY: AddressSanitizer: memcpy-param-overlap ../../../../gcc-5.2.0/libsanitizer/asan/asan_interceptors.cc:365 __asan_memcpy
==7358==ABORTING
/home/vitti/gcc-5.2.0/gcc/ada/Make-generated.in:42: recipe for target 'ada/sinfo.h' failed
Comment 1 Eric Botcazou 2015-12-06 20:40:26 UTC
Interesting, this will need to be investigated.
Comment 2 Vittorio Zecca 2016-04-28 07:01:05 UTC
Any update on this issue?
Comment 3 Eric Botcazou 2016-04-28 07:09:44 UTC
No, it's low priority, the SPITBOL-like units are rarely used in practice.
Comment 4 Eric Botcazou 2016-06-29 10:27:20 UTC
Previously reported.

*** This bug has been marked as a duplicate of bug 64057 ***