This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug gcov/profile/26570] -fprofile-generate -fprofile-use cause memory corruption immediately
- From: "ahu at ds9a dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Mar 2006 23:42:27 -0000
- Subject: [Bug gcov/profile/26570] -fprofile-generate -fprofile-use cause memory corruption immediately
- References: <bug-26570-7094@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from ahu at ds9a dot nl 2006-03-05 23:42 -------
Thanks Nicholas,
I can run the command you suggest without errors (I saved the file as
exploit.cc). However, if I compile first with -fprofile-generate, then run it
once, and then add -fprofile-use, it reports:
$ g++ -O2 -fprofile-use -fprofile-generate exploit.cc -o exploit
*** glibc detected *** double free or corruption (fasttop): 0x085c7e78 ***
exploit.cc: In function â_ForwardIterator2 std::swap_ranges(_ForwardIterator1,
_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = int*,
_ForwardIterator2 = int*]â:
exploit.cc:14: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
This w/o any profiling information present:
ahu@intel:~/work/pdns/pdns/pdns$ rm exploit.gc*
ahu@intel:~/work/pdns/pdns/pdns$ g++ -O2 -fprofile-use -fprofile-generate
exploit.cc -o exploit
exploit.cc: In function âvoid std::iter_swap(_ForwardIterator1,
_ForwardIterator2) [with _ForwardIterator1 = int*, _ForwardIterator2 = int*]â:
exploit.cc:14: note: file exploit.gcda not found, execution counts estimated
*** glibc detected *** double free or corruption (fasttop): 0x085f2438 ***
exploit.cc: In function â_ForwardIterator2 std::swap_ranges(_ForwardIterator1,
_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = int*,
_ForwardIterator2 = int*]â:
exploit.cc:14: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26570