#368 closed defect (fixed)
matreshka and gnat-gpl-2014
Reported by: | Maxim Reznik | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 0.7.0 |
Component: | Matreshka - League | Version: | |
Keywords: | gpl 2014 | Cc: |
Description
Some xml tests fails on gnat-gpl-2014.
Reproducer:
with League.Strings; procedure Aaa is Lit : constant Wide_Wide_String := "11" & Wide_Wide_Character'Val (16#8FFFF#) & "22"; Text : League.Strings.Universal_String := League.Strings.To_Universal_String (Lit); begin Text.Replace (5, 5, "
"); Text.Replace (4, 4, "
"); end Aaa;
It crash on linux x86_64:
gprbuild -j0 -O0 -P aaa.gpr ./aaa *** Error in `./aaa': double free or corruption (fasttop): 0x0000000000607100 *** ... raised PROGRAM_ERROR : aaa.adb:3 finalize/adjust raised exception
Valgrind error:
==24991== Invalid free() / delete / delete[] / realloc() ==24991== at 0x4C2B37C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==24991== by 0x58BFB44: __gnat_free (in /home/max/local/gpl-2014/lib/gcc/x86_64-pc-linux-gnu/4.7.4/rts-native/adalib/libgnat-2014.so) ==24991== by 0x51AD4CD: matreshka__internals__strings__dereference (matreshka-internals-strings.adb:211) ==24991== by 0x513FEE4: league__strings__finalize__2 (league-strings.adb:837) ==24991== by 0x404461: aaa___finalizer.2565 (in /tmp/aaa) ==24991== by 0x404735: _ada_aaa (in /tmp/aaa) ==24991== by 0x404EAA: main (in /tmp/aaa) ==24991== Address 0x6686270 is 0 bytes inside a block of size 40 free'd ==24991== at 0x4C2B37C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==24991== by 0x58BFB44: __gnat_free (in /home/max/local/gpl-2014/lib/gcc/x86_64-pc-linux-gnu/4.7.4/rts-native/adalib/libgnat-2014.so) ==24991== by 0x511DA5B: matreshka__internals__strings__operations__replace (matreshka-internals-strings-operations.adb:338) ==24991== by 0x5142E8E: league__strings__replace (league-strings.adb:1786) ==24991== by 0x5142F43: league__strings__replace__2 (league-strings.adb:1799) ==24991== by 0x404724: _ada_aaa (in /tmp/aaa) ==24991== by 0x404EAA: main (in /tmp/aaa)
Change History (4)
comment:1 by , 6 years ago
comment:3 by , 6 years ago
Component: | Matreshka → Matreshka - League |
---|---|
Resolution: | → fixed |
Status: | new → closed |
This is bug in GNAT GPL 2014 compiler, it deallocates object but doesn't reset member to null.
Note:
See TracTickets
for help on using tickets.
Project file (aaa.gpr)
Program fails even when built with -O0