public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jy38 at zips dot uakron.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/66530] New: libstdc++ testsuite links to incorrect shared libstdc++ library
Date: Sat, 13 Jun 2015 20:36:00 -0000	[thread overview]
Message-ID: <bug-66530-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 66530
           Summary: libstdc++ testsuite links to incorrect shared
                    libstdc++ library
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jy38 at zips dot uakron.edu
  Target Milestone: ---
              Host: x86_64-pc-cygwin
            Target: x86_64-pc-cygwin
             Build: x86_64-pc-cygwin

While running the testsuite for libstdc++, I noticed that the generated test
programs do not appear to be linking to the "correct" libstdc++ shared library
(that is, the libstdc++ that was generated in the build tree). As a result, the
testsuite generates erroneous test results even though I have modified various
files in the local source tree so that it should not.

Here's an excerpt from libstdc++.log containing the command-line used to
generate test program "hexfloat"
(27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc) and its subsequent
failure:

extra_tool_flags are:
 -std=gnu++11
Executing on host: /cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/./gcc/xg++
-shared-libgcc -B/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/./gcc -nostdinc++
-L/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/src
-L/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/src/.libs
-L/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/libsupc++/.libs
-B/usr/local/x86_64-pc-cygwin/bin/ -B/usr/local/x86_64-pc-cygwin/lib/ -isystem
/usr/local/x86_64-pc-cygwin/include -isystem
/usr/local/x86_64-pc-cygwin/sys-include
-B/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/./libstdc++-v3/src/.libs
-D_GLIBCXX_ASSERT -fmessage-length=0 -ffunction-sections -fdata-sections -g -O2
-DLOCALEDIR="." -nostdinc++
-I/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/include/x86_64-pc-cygwin
-I/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/include
-I/cygdrive/c/Users/yaoj3/Code/gcc/trunk/libstdc++-v3/libsupc++
-I/cygdrive/c/Users/yaoj3/Code/gcc/trunk/libstdc++-v3/include/backward
-I/cygdrive/c/Users/yaoj3/Code/gcc/trunk/libstdc++-v3/testsuite/util
/cygdrive/c/Users/yaoj3/Code/gcc/trunk/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc
  -std=gnu++11 ./libtestc++.a -Wl,--gc-sections -liconv
-L/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/src/filesystem/.libs
    -o ./hexfloat.exe    (timeout = 600)
spawn /cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/./gcc/xg++ -shared-libgcc
-B/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/./gcc -nostdinc++
-L/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/src
-L/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/src/.libs
-L/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/libsupc++/.libs
-B/usr/local/x86_64-pc-cygwin/bin/ -B/usr/local/x86_64-pc-cygwin/lib/ -isystem
/usr/local/x86_64-pc-cygwin/include -isystem
/usr/local/x86_64-pc-cygwin/sys-include
-B/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/./libstdc++-v3/src/.libs
-D_GLIBCXX_ASSERT -fmessage-length=0 -ffunction-sections -fdata-sections -g -O2
-DLOCALEDIR="." -nostdinc++
-I/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/include/x86_64-pc-cygwin
-I/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/include
-I/cygdrive/c/Users/yaoj3/Code/gcc/trunk/libstdc++-v3/libsupc++
-I/cygdrive/c/Users/yaoj3/Code/gcc/trunk/libstdc++-v3/include/backward
-I/cygdrive/c/Users/yaoj3/Code/gcc/trunk/libstdc++-v3/testsuite/util
/cygdrive/c/Users/yaoj3/Code/gcc/trunk/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc
-std=gnu++11 ./libtestc++.a -Wl,--gc-sections -liconv
-L/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/libstdc++-v3/src/filesystem/.libs
-o ./hexfloat.exe
PASS: 27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc (test for
excess errors)
Setting LD_LIBRARY_PATH to
:/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/gcc:/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/./libstdc++-v3/src/.libs::/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/gcc:/cygdrive/c/Users/yaoj3/Code/gcc/build/trunk/x86_64-pc-cygwin/./libstdc++-v3/src/.libs
spawn [open ...]
assertion "os && std::stod(os.str()) == d" failed: file
"/cygdrive/c/Users/yaoj3/Code/gcc/trunk/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc",
line 53, function: void test01()
FAIL: 27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc execution test

I've confirmed that the problem persists even with a separate test program
outside of the testsuite (compiled and run with pretty much the same flags and
LD_LIBRARY_PATH seen above). More tellingly, compiling with an additional
-static-libstdc++ flag causes the problem to vanish entirely, with the test
program exhibiting the desired behavior.

My hypothesis (and please correct me if I'm wrong) is that the libstdc++ that
is being loaded at runtime is the preexisting (unaltered/unpatched) library in
the install tree, rather than the altered/patched library in the build tree. Of
course, I could presumably install the library in order to obtain the expected
test results... however, the behavior that I've described would appear to
violate the GNU Makefile conventions for the "check" target (as described by
the manual for GNU make, which reads: "Perform self-tests (if any). The user
must build the program before running the tests, but need not install the
program; you should write the self-tests so that they work when the program is
built but not installed").

FYI, the output of xg++ -v:

Using built-in specs.
COLLECT_GCC=./gcc/build/trunk/gcc/xg++
Target: x86_64-pc-cygwin
Configured with: ../../trunk/configure --docdir=/usr/local/share/doc/gcc
--htmldir=/usr/local/share/doc/gcc/html -C --build=x86_64-pc-cygwin
--enable-shared --enable-shared-libgcc --enable-static
--enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit
--with-dwarf2 --with-tune=generic --enable-languages=c,c++ --enable-graphite
--enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm
--enable-libquadmath --enable-libquadmath-support --enable-libssp
--disable-libada --disable-libgcj --disable-libgcj-sublibs --disable-java-awt
--disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld
--with-gnu-as --with-cloog-include=/usr/include/cloog-isl
--without-libiconv-prefix --without-libintl-prefix --with-system-zlib
--enable-linker-build-id
Thread model: posix
gcc version 6.0.0 20150610 (experimental) (GCC)


             reply	other threads:[~2015-06-13 20:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-13 20:36 jy38 at zips dot uakron.edu [this message]
2015-06-15 10:35 ` [Bug libstdc++/66530] " redi at gcc dot gnu.org
2015-06-16  2:17 ` jy38 at zips dot uakron.edu
2015-06-16  9:07 ` redi at gcc dot gnu.org
2015-06-16  9:53 ` redi at gcc dot gnu.org
2015-06-16  9:58 ` redi at gcc dot gnu.org
2015-06-16 18:18 ` [Bug testsuite/66530] " jy38 at zips dot uakron.edu
2015-09-17 12:16 ` jenny.hyphen.fa at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-66530-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).