------- Comment #1 from rob1weld at aol dot com  2007-06-12 11:24 -------
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


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32276

Reply via email to