https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81068

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
If the relevant libstdc++ source file is instrumented there are no errors:

tmp$ g++ -fsanitize=address,undefined conv.cc  
tmp$ ./a.out
/home/jwakely/gcc/8/include/c++/8.0.0/bits/locale_conv.h:68:48: runtime error:
member call on address 0x603000000010 which does not point to an object of type
'__codecvt_abstract_base'
0x603000000010: note: object is of type 'std::codecvt_utf8<char16_t, 1114111ul,
(std::codecvt_mode)0>'
 01 00 00 33  e0 f9 40 00 00 00 00 00  00 00 00 00 be be be be  ff ff 10 00 00
00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'std::codecvt_utf8<char16_t, 1114111ul,
(std::codecvt_mode)0>'
/home/jwakely/gcc/8/include/c++/8.0.0/bits/codecvt.h:220:36: runtime error:
member call on address 0x603000000010 which does not point to an object of type
'__codecvt_abstract_base'
0x603000000010: note: object is of type 'std::codecvt_utf8<char16_t, 1114111ul,
(std::codecvt_mode)0>'
 01 00 00 33  e0 f9 40 00 00 00 00 00  00 00 00 00 be be be be  ff ff 10 00 00
00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'std::codecvt_utf8<char16_t, 1114111ul,
(std::codecvt_mode)0>'
/home/jwakely/gcc/8/include/c++/8.0.0/bits/codecvt.h:202:32: runtime error:
member call on address 0x603000000010 which does not point to an object of type
'__codecvt_abstract_base'
0x603000000010: note: object is of type 'std::codecvt_utf8<char16_t, 1114111ul,
(std::codecvt_mode)0>'
 01 00 00 33  e0 f9 40 00 00 00 00 00  00 00 00 00 be be be be  ff ff 10 00 00
00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'std::codecvt_utf8<char16_t, 1114111ul,
(std::codecvt_mode)0>'

=================================================================
==17730==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 384 byte(s) in 6 object(s) allocated from:
    #0 0x7f102afbdc40 in realloc (/lib64/libasan.so.4+0xdec40)
    #1 0x7f102abe8aaa  (/lib64/libstdc++.so.6+0x92aaa)

SUMMARY: AddressSanitizer: 384 byte(s) leaked in 6 allocation(s).
tmp$ g++ -fsanitize=address,undefined conv.cc 
~/src/gcc/gcc/libstdc++-v3/src/c++11/codecvt.cc 
tmp$ ./a.out
tmp$

Reply via email to