Bug 32276 - [4.3/4.4/4.5/4.6 Regression]: libmudflap.c++/pass41-frag.cxx
Summary: [4.3/4.4/4.5/4.6 Regression]: libmudflap.c++/pass41-frag.cxx
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libmudflap (show other bugs)
Version: 4.3.0
: P5 normal
Target Milestone: 4.6.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 35048 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-10 16:49 UTC by H.J. Lu
Modified: 2010-05-15 19:43 UTC (History)
9 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-03-30 17:17:44


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2007-06-10 16:49:27 UTC
FAIL: libmudflap.c++/pass41-frag.cxx execution test
FAIL: libmudflap.c++/pass41-frag.cxx (-O2) execution test
FAIL: libmudflap.c++/pass41-frag.cxx (-O3) execution test
FAIL: libmudflap.c++/pass41-frag.cxx ( -O) execution test
FAIL: libmudflap.c++/pass41-frag.cxx (-static) execution test
Comment 1 Rob 2007-06-12 11:24:38 UTC
These bug were first mentioned in report:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31681


Confirmed for similar target: 
Results for 4.3.0 20070611 (experimental) testsuite on i686-pc-linux-gnu
http://gcc.gnu.org/ml/gcc-testresults/2007-06/msg00573.html


--- My Notes ---

Screen output:

                === libmudflap tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /root/downloads/gcc-4_3-trunk/libmudflap/testsuite/config/default.exp as tool-and-target-specific interface file.
Running /root/downloads/gcc-4_3-trunk/libmudflap/testsuite/libmudflap.c/cfrags.exp ...
Running /root/downloads/gcc-4_3-trunk/libmudflap/testsuite/libmudflap.c/externs.exp ...
Running /root/downloads/gcc-4_3-trunk/libmudflap/testsuite/libmudflap.c++/c++frags.exp ...
FAIL: libmudflap.c++/pass41-frag.cxx execution test
FAIL: libmudflap.c++/pass41-frag.cxx (-static) execution test
FAIL: libmudflap.c++/pass41-frag.cxx ( -O) execution test
FAIL: libmudflap.c++/pass41-frag.cxx (-O2) execution test
FAIL: libmudflap.c++/pass41-frag.cxx (-O3) execution test
Running /root/downloads/gcc-4_3-trunk/libmudflap/testsuite/libmudflap.c++/ctors.exp ...
Running /root/downloads/gcc-4_3-trunk/libmudflap/testsuite/libmudflap.cth/cthfrags.exp ...

                === libmudflap Summary ===

# of expected passes            1985
# of unexpected failures        5



Log file "i686-pc-linux-gnu/libmudflap/testsuite/libmudflap.log" output:


mudflap violation 1 (check/read): time=1181641131.727908 ptr=0x401fd640 size=4
pc=0x40027c0d location=`/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include/ostream:546 (main)'
      /opt/gcc-4_3-build/i686-pc-linux-gnu/./libmudflap/.libs/libmudflap.so.0(__mf_check+0x3d) [0x40027c0d]
      ./pass41-frag.exe(main+0x2bb) [0x8048f7b]
      /opt/gcc-4_3-build/i686-pc-linux-gnu/./libmudflap/.libs/libmudflap.so.0(__wrap_main+0x4f) [0x4002745f]
number of nearby objects: 0
FAIL: libmudflap.c++/pass41-frag.cxx execution test


mudflap violation 1 (check/read): time=1181641140.406737 ptr=0x80fb280 size=4
pc=0x804b3d0 location=`/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include/ostream:546 (main)'
      [0x804b3d0]
      [0x804851b]
      [0x804b416]
number of nearby objects: 0
FAIL: libmudflap.c++/pass41-frag.cxx (-static) execution test


mudflap violation 1 (check/read): time=1181641147.350329 ptr=0x401fd640 size=4
pc=0x40027c0d location=`/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include/ostream:546 (main)'
      /opt/gcc-4_3-build/i686-pc-linux-gnu/./libmudflap/.libs/libmudflap.so.0(__mf_check+0x3d) [0x40027c0d]
      ./pass41-frag.exe(main+0x1b1) [0x8048e65]
      /opt/gcc-4_3-build/i686-pc-linux-gnu/./libmudflap/.libs/libmudflap.so.0(__wrap_main+0x4f) [0x4002745f]
number of nearby objects: 0
FAIL: libmudflap.c++/pass41-frag.cxx ( -O) execution test


mudflap violation 1 (check/read): time=1181641153.350016 ptr=0x401fd640 size=4
pc=0x40027c0d location=`/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include/ostream:546 (main)'
      /opt/gcc-4_3-build/i686-pc-linux-gnu/./libmudflap/.libs/libmudflap.so.0(__mf_check+0x3d) [0x40027c0d]
      ./pass41-frag.exe(main+0x2bb) [0x8048f7b]
      /opt/gcc-4_3-build/i686-pc-linux-gnu/./libmudflap/.libs/libmudflap.so.0(__wrap_main+0x4f) [0x4002745f]
number of nearby objects: 0
FAIL: libmudflap.c++/pass41-frag.cxx (-O2) execution test


mudflap violation 1 (check/read): time=1181641160.020512 ptr=0x401fd640 size=4
pc=0x40027c0d location=`/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include/ostream:546 (main)'
      /opt/gcc-4_3-build/i686-pc-linux-gnu/./libmudflap/.libs/libmudflap.so.0(__mf_check+0x3d) [0x40027c0d]
      ./pass41-frag.exe(main+0x2bb) [0x8049f7b]
      /opt/gcc-4_3-build/i686-pc-linux-gnu/./libmudflap/.libs/libmudflap.so.0(__wrap_main+0x4f) [0x4002745f]
number of nearby objects: 0
FAIL: libmudflap.c++/pass41-frag.cxx (-O3) execution test



All the log entries show "number of nearby objects: 0". Does this mean that it is
not the test itself that is failing but instead something other than the test - IE:
GXX is compiling incorrect code or the libraries are incorrectly written.



# cat /root/downloads/gcc-4_3-trunk/libmudflap/testsuite/libmudflap.c++/pass41-frag.cxx
#include <string>
#include <iostream>

int
main (int argc, char *argv[])
{
    std::string myStr = "Hello, World!";
    std::cout << myStr << std::endl;
    return 0;
}


/opt/gcc-4_3-build/./gcc/g++ -shared-libgcc -B/opt/gcc-4_3-build/./gcc -nostdinc++ -L/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/src -L/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -B/usr/test/i686-pc-linux-gnu/bin/ -B/usr/test/i686-pc-linux-gnu/lib/ -isystem /usr/test/i686-pc-linux-gnu/include -isystem /usr/test/i686-pc-linux-gnu/sys-include -ffloat-store -mfpmath=sse -march=athlon-xp -msse2 -ggdb3 -DDEBUG_ASSERT -g -O2 -D_GLIBCXX_ASSERT -ffunction-sections -fdata-sections -fmessage-length=0 -g -O2 -ffloat-store -mfpmath=sse -march=athlon-xp -msse2 -D_GNU_SOURCE -I/root/downloads/gcc-4_3-trunk/libmudflap/testsuite -I/root/downloads/gcc-4_3-trunk/libmudflap/testsuite/.. -I.. -nostdinc++ -I/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu -I/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include -I/root/downloads/gcc-4_3-trunk/libstdc++-v3/libsupc++ -I/root/downloads/gcc-4_3-trunk/libstdc++-v3/include/backward -I/root/downloads/gcc-4_3-trunk/libstdc++-v3/testsuite/util -L/opt/gcc-4_3-build/i686-pc-linux-gnu/./libmudflap/.libs /root/downloads/gcc-4_3-trunk/libmudflap/testsuite/libmudflap.c++/pass41-frag.cxx  -O3 -fmudflap -lmudflap  -L/opt/gcc-4_3-build/i686-pc-linux-gnu/./libmudflap/testsuite -ldl -lm   -o ./pass41-frag.exe



This turns off the cause of libmudflap's error:

# export MUDFLAP_OPTIONS="-ignore-reads"

# ./pass41-frag.exe
Hello, World!



Normal libmudflap operation (doesn't seem to show much wrong):

# export -n MUDFLAP_OPTIONS        

# ./pass41-frag.exe
*******
mudflap violation 1 (check/read): time=1181640311.137456 ptr=0xb7dd5740 size=4
pc=0xb7deb11d location=`/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include/ostream:546 (main)'
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__mf_check+0x3d) [0xb7deb11d]
      ./pass41-frag.exe(main+0x2bb) [0x8049eeb]
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__wrap_main+0x49) [0xb7deabf9]
number of nearby objects: 0
Hello, World!



Show what is set or reset in libmudflap:

# export MUDFLAP_OPTIONS="-help"

# ./pass41-frag.exe
This is a single-threaded thread-unaware GCC "mudflap" memory-checked binary.
Mudflap is Copyright (C) 2002-2004 Free Software Foundation, Inc.

The mudflap code can be controlled by an environment variable:

$ export MUDFLAP_OPTIONS='<options>'
$ <mudflapped_program>

where <options> is a space-separated list of 
any of the following options.  Use `-no-OPTION' to disable options.

-mode-nop                mudflaps do nothing
-mode-populate           mudflaps populate object tree
-mode-check              mudflaps check for memory violations [active]
-mode-violate            mudflaps always cause violations (diagnostic)
-viol-nop                violations do not change program execution [active]
-viol-abort              violations cause a call to abort()
-viol-segv               violations are promoted to SIGSEGV signals
-viol-gdb                violations fork a gdb process attached to current program
-trace-calls             trace calls to mudflap runtime library
-verbose-trace           trace internal events within mudflap runtime library
-collect-stats           collect statistics on mudflap's operation
-sigusr1-report          print report upon SIGUSR1
-internal-checking       perform more expensive internal checking
-print-leaks             print any memory leaks at program shutdown
-check-initialization    detect uninitialized object reads
-verbose-violations      print verbose messages when memory violations occur [active]
-abbreviate              abbreviate repetitive listings [active]
-timestamps              track object lifetime timestamps [active]
-ignore-reads            ignore read accesses - assume okay
-wipe-stack              wipe stack objects at unwind
-wipe-heap               wipe heap objects at free
-heur-proc-map           support /proc/self/map heuristics
-heur-stack-bound        enable a simple upper stack bound heuristic
-heur-start-end          support _start.._end heuristics
-heur-stdlib             register standard library data (argv, errno, stdin, ...) [active]
-free-queue-length=N     queue N deferred free() calls before performing them [4]
-persistent-count=N      keep a history of N unregistered regions [100]
-crumple-zone=N          surround allocations with crumple zones of N bytes [32]
-lc-adapt=N              adapt mask/shift parameters after N cache misses [1000003]
-backtrace=N             keep an N-level stack trace of each call context [4]



Modified libmudflap operation (seems to show much more problems):


# export MUDFLAP_OPTIONS="-check-initialization"

# ./pass41-frag.exe
*******
mudflap violation 1 (check/read): time=1181642670.810917 ptr=0x80ce238 size=4
pc=0xb7ee011d location=`/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:609 (main)'
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__mf_check+0x3d) [0xb7ee011d]
      ./pass41-frag.exe(main+0x3d5) [0x804a005]
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__wrap_main+0x49) [0xb7edfbf9]
Nearby object 1: checked region begins 0B into and ends 3B into
mudflap object 0x80ce278: name=`malloc region'
bounds=[0x80ce238,0x80ce251] size=26 area=heap check=1r/0w liveness=1
alloc time=1181642670.810782 pc=0xb7edfb9d
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__mf_register+0x3d) [0xb7edfb9d]
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__real_malloc+0xde) [0xb7ee105e]
      /usr/lib/gcc/4.2.0/libstdc++.so.6(_Znwj+0x29) [0xb7e9feb9]
      /usr/lib/gcc/4.2.0/libstdc++.so.6(_ZNSs4_Rep9_S_createEjjRKSaIcE+0x35) [0xb7e7cec5]
Nearby object 2: checked region begins 3727B after and ends 3730B after
mudflap dead object 0x80cd3f0: name=`malloc region'
bounds=[0x80cd3a8,0x80cd3a9] size=2 area=heap check=0r/0w liveness=0
alloc time=1181642670.809614 pc=0xb7edfb9d
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__mf_register+0x3d) [0xb7edfb9d]
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__real_malloc+0xde) [0xb7ee105e]
      /lib/libc.so.6(__strdup+0x30) [0xb7ce4740]
      /usr/lib/gcc/4.2.0/libstdc++.so.6(_ZNSt5ctypeIcEC1EPKtbj+0x77) [0xb7e36a47]
dealloc time=1181642670.809891 pc=0xb7edfb46
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__mf_unregister+0x36) [0xb7edfb46]
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__real_free+0x88) [0xb7ee0918]
      /usr/lib/gcc/4.2.0/libstdc++.so.6(_ZNSt5ctypeIcEC1EPKtbj+0xc9) [0xb7e36a99]
      /usr/lib/gcc/4.2.0/libstdc++.so.6(_ZNSt6locale5_ImplC1Ej+0xc8) [0xb7e3e198]
number of nearby objects: 2
*******
mudflap violation 2 (check/read): time=1181642670.812129 ptr=0xb7eca740 size=4
pc=0xb7ee011d location=`/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include/ostream:546 (main)'
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__mf_check+0x3d) [0xb7ee011d]
      ./pass41-frag.exe(main+0x2bb) [0x8049eeb]
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__wrap_main+0x49) [0xb7edfbf9]
number of nearby objects: 0
Hello, World!
*******
mudflap violation 3 (check/read): time=1181642670.812286 ptr=0x80ce238 size=12
pc=0xb7ee011d location=`/opt/gcc-4_3-build/i686-pc-linux-gnu/libstdc++-v3/include/ext/atomicity.h:69 (main)'
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__mf_check+0x3d) [0xb7ee011d]
      ./pass41-frag.exe(main+0x319) [0x8049f49]
      /usr/lib/gcc/4.2.0/libmudflap.so.0(__wrap_main+0x49) [0xb7edfbf9]
Nearby object 1: checked region begins 0B into and ends 11B into
mudflap object 0x80ce278: name=`malloc region'
Nearby object 2: checked region begins 3727B after and ends 3738B after
mudflap dead object 0x80cd3f0: name=`malloc region'
number of nearby objects: 2


The errors don't seem to come from "pass41-frag.cxx", the errors seem to come from:
libstdc++-v3/include/bits/basic_string.h:609
libstdc++-v3/include/ostream:546
libstdc++-v3/include/ext/atomicity.h:69
Comment 2 H.J. Lu 2007-07-13 00:55:55 UTC
On Linux/x86-64, Gcc 4.3 revision 120783 is OK:

http://gcc.gnu.org/ml/gcc-testresults/2007-01/msg00613.html

and revision 120903 fails.
Comment 3 H.J. Lu 2007-07-19 19:19:07 UTC
Jan, we verified that your patch

http://gcc.gnu.org/ml/gcc-cvs/2007-01/msg00538.html

caused this regression. Can you take a look? Thanks.
Comment 4 John David Anglin 2007-12-08 01:25:19 UTC
Tests also on hppa-unknown-linux-gnu:

Executing on host: /home/dave/gnu/gcc-4.3/objdir/./gcc/g++ -shared-libgcc -B/home/dave/gnu/gcc-4.3/objdir/./gcc -nostdinc++ -L/home/dave/gnu/gcc-4.3/objdir/hppa-linux/libstdc++-v3/src -L/home/dave/gnu/gcc-4.3/objdir/hppa-linux/libstdc++-v3/
src/.libs -B/home/dave/opt/gnu/gcc/gcc-4.3.0/hppa-linux/bin/ -B/home/dave/opt/gn
u/gcc/gcc-4.3.0/hppa-linux/lib/ -isystem /home/dave/opt/gnu/gcc/gcc-4.3.0/hppa-l
inux/include -isystem /home/dave/opt/gnu/gcc/gcc-4.3.0/hppa-linux/sys-include -ggdb3 -DDEBUG_ASSERT -g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0 -ffunction-secti
ons -fdata-sections -g -O2 -D_GNU_SOURCE -I/home/dave/gnu/gcc-4.3/gcc/libmudflap
/testsuite -I/home/dave/gnu/gcc-4.3/gcc/libmudflap/testsuite/.. -I.. -nostdinc++
 -I/home/dave/gnu/gcc-4.3/objdir/hppa-linux/libstdc++-v3/include/hppa-linux -I/h
ome/dave/gnu/gcc-4.3/objdir/hppa-linux/libstdc++-v3/include -I/home/dave/gnu/gcc-4.3/gcc/libstdc++-v3/libsupc++ -I/home/dave/gnu/gcc-4.3/gcc/libstdc++-v3/include/backward -I/home/dave/gnu/gcc-4.3/gcc/libstdc++-v3/testsuite/util -L/home/dave/gnu/gcc-4.3/objdir/hppa-linux/./libmudflap/.libs /home/dave/gnu/gcc-4.3/gcc/libmudflap/testsuite/libmudflap.c++/pass41-frag.cxx   -fmudflap -lmudflap  -L/home/dave/gnu/gcc-4.3/objdir/hppa-linux/./libmudflap/testsuite -ldl -lm   -o ./pass41-frag.exe    (timeout = 300)
PASS: libmudflap.c++/pass41-frag.cxx (test for excess errors)
Setting LD_LIBRARY_PATH to .:/home/dave/gnu/gcc-4.3/objdir/gcc:/home/dave/gnu/gcc-4.3/objdir/hppa-linux/./libstdc++-v3/src/.libs:/home/dave/gnu/gcc-4.3/objdir/hppa-linux/./libmudflap/.libs:.:/home/dave/gnu/gcc-4.3/objdir/gcc:/home/dave/gnu/gcc-4.3/objdir/hppa-linux/./libstdc++-v3/src/.libs:/home/dave/gnu/gcc-4.3/objdir/hppa-linux/./libmudflap/.libs:/home/dave/gnu/gcc-4.3/objdir/hppa-linux/libstdc++-v3/.libs:/home/dave/gnu/gcc-4.3/objdir/hppa-linux/libmudflap/.libs:/home/dave/gnu/gcc-4.3/objdir/hppa-linux/libssp/.libs:/home/dave/gnu/gcc-4.3/objdir/hppa-linux/libgomp/.libs:/home/dave/gnu/gcc-4.3/objdir/./gcc:/home/dave/gnu/gcc-4.3/objdir/./prev-gcc
*******
mudflap violation 1 (check/read): time=1197058746.759483 ptr=0x40787530 size=4
pc=0x40350f57 location=`/home/dave/gnu/gcc-4.3/objdir/hppa-linux/libstdc++-v3/include/ostream:557:46 (main)'
      [0x1]
number of nearby objects: 0
FAIL: libmudflap.c++/pass41-frag.cxx execution test
Comment 5 İsmail Dönmez 2008-01-03 01:51:34 UTC
I think component shouldn't be target because it fails on more than one platform.
Comment 6 Andrew Pinski 2008-02-01 00:16:08 UTC
*** Bug 35048 has been marked as a duplicate of this bug. ***
Comment 7 Joseph S. Myers 2008-03-15 00:40:37 UTC
Update milestone after 4.3.0 release.
Comment 8 Richard Biener 2008-06-06 14:57:28 UTC
4.3.1 is being released, adjusting target milestone.
Comment 9 Joseph S. Myers 2008-08-27 22:02:20 UTC
4.3.2 is released, changing milestones to 4.3.3.
Comment 10 Steve Ellcey 2009-01-22 00:08:38 UTC
Pointer to http://gcc.gnu.org/ml/gcc-patches/2008-07/msg00371.html where Martin Jambor says he has looked at this bug and says he thinks it is a libmudflap bug and not actually related to the patch that caused it to start showing up.  He mentions that -heur-proc-map MUDFLAP option makes it go away.
Comment 11 Richard Biener 2009-01-24 10:19:44 UTC
GCC 4.3.3 is being released, adjusting target milestone.
Comment 12 Richard Biener 2009-08-04 12:28:11 UTC
GCC 4.3.4 is being released, adjusting target milestone.
Comment 13 Kaveh Ghazi 2009-12-20 16:12:51 UTC
Reconfirming on all active branches for x86_64-unknown-linux-gnu:

gcc-4.5: http://gcc.gnu.org/ml/gcc-testresults/2009-12/msg01759.html
gcc-4.4: http://gcc.gnu.org/ml/gcc-testresults/2009-12/msg01486.html
gcc-4.3: http://gcc.gnu.org/ml/gcc-testresults/2009-12/msg00752.html

Comment 14 Kaveh Ghazi 2010-03-30 17:17:44 UTC
Reconfirm
Comment 15 Uroš Bizjak 2010-05-15 19:43:52 UTC
This PR was fixed somewhere between r158731 [1] and r158736 [2].
The only relevant commit in this range is [3, 4].

[1] http://gcc.gnu.org/ml/gcc-testresults/2010-04/msg02458.html
[2] http://gcc.gnu.org/ml/gcc-testresults/2010-04/msg02468.html
[3] http://gcc.gnu.org/ml/gcc-cvs/2010-04/msg00839.html
[4] http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01594.html

Let's mark this PR fixed for 4.6.