This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/81068] Sanitizer memory leak in codecvt_utf8
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 14 Sep 2017 15:47:10 +0000
- Subject: [Bug sanitizer/81068] Sanitizer memory leak in codecvt_utf8
- Auto-submitted: auto-generated
- References: <bug-81068-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81068
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2017-09-14
Ever confirmed|0 |1
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I would doubt w/ sanitizer one can have it working:
$ clang++ pr81068.cpp -std=c++11 && ./a.out
terminate called after throwing an instance of 'std::range_error'
what(): wstring_convert::from_bytes
Aborted (core dumped)
$ clang++ --version
clang version 4.0.1 (tags/RELEASE_401/final 305264)
$ g++ pr81068.cpp -std=c++11 && ./a.out
terminate called after throwing an instance of 'std::range_error'
what(): wstring_convert::from_bytes
Aborted (core dumped)
$ g++ --version
g++ (SUSE Linux) 7.1.1 20170802 [gcc-7-branch revision 250825]
$ valgrind ./a.out
==18712== Memcheck, a memory error detector
==18712== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==18712== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==18712== Command: ./a.out
==18712==
terminate called after throwing an instance of 'std::range_error'
what(): wstring_convert::from_bytes
==18712==
==18712== Process terminating with default action of signal 6 (SIGABRT):
dumping core
==18712== at 0x5758B30: raise (raise.c:51)
==18712== by 0x575A110: abort (abort.c:79)
==18712== by 0x4ED2234: __gnu_cxx::__verbose_terminate_handler() (in
/usr/lib64/libstdc++.so.6.0.24)
==18712== by 0x4ED0025: ??? (in /usr/lib64/libstdc++.so.6.0.24)
==18712== by 0x4ED0070: std::terminate() (in /usr/lib64/libstdc++.so.6.0.24)
==18712== by 0x4ED02B2: __cxa_throw (in /usr/lib64/libstdc++.so.6.0.24)
==18712== by 0x4EF89BE: std::__throw_range_error(char const*) (in
/usr/lib64/libstdc++.so.6.0.24)
==18712== by 0x401A16:
std::__cxx11::wstring_convert<std::codecvt_utf8<char16_t, 1114111ul,
(std::codecvt_mode)0>, char16_t, std::allocator<char16_t>, std::allocator<char>
>::from_bytes(char const*, char const*) (in
/home/marxin/Programming/testcases/a.out)
==18712== by 0x40146C: main (in /home/marxin/Programming/testcases/a.out)
Can you please verify that it's a valid code?