diff mbox

PATCH: PR other/58374: Wrong target check in configure.ac in libvtv

Message ID 20130909184825.GA4841@intel.com
State New
Headers show

Commit Message

H.J. Lu Sept. 9, 2013, 6:48 p.m. UTC
configure.tgt in libvtv only recognizes canonical targets.  This patch
moves the VTV_SUPPORTED check after AC_CANONICAL_SYSTEM for targets
like i686-linux or x86_64-linux.  OK to install?

Thanks.


H.J.
---

Comments

Caroline Tice Sept. 9, 2013, 8:56 p.m. UTC | #1
The patch looks good to me, but somebody else needs to approve it.

-- Caroline Tice
cmtice@google.com

On Mon, Sep 9, 2013 at 11:48 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> configure.tgt in libvtv only recognizes canonical targets.  This patch
> moves the VTV_SUPPORTED check after AC_CANONICAL_SYSTEM for targets
> like i686-linux or x86_64-linux.  OK to install?
>
> Thanks.
>
>
> H.J.
> ---
> diff --git a/libvtv/ChangeLog b/libvtv/ChangeLog
> index 20092f4..3c344f9 100644
> --- a/libvtv/ChangeLog
> +++ b/libvtv/ChangeLog
> @@ -1,3 +1,9 @@
> +2013-09-09  H.J. Lu  <hongjiu.lu@intel.com>
> +
> +       PR other/58374
> +       * configure.ac: Move VTV_SUPPORTED check after AC_CANONICAL_SYSTEM.
> +       * configure: Regenerated.
> +
>  2013-09-08  Caroline Tice  <cmtice@google.com>
>
>         * testsuite/event-main.cc:  Move to libvtv.cc subdirectory.
> diff --git a/libvtv/configure b/libvtv/configure
> index bb56cb0..0bd614a 100755
> --- a/libvtv/configure
> +++ b/libvtv/configure
> @@ -2339,22 +2339,6 @@ fi
>  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $version_specific_libs" >&5
>  $as_echo "$version_specific_libs" >&6; }
>
> -# See if supported.
> -unset VTV_SUPPORTED
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for host support for vtable verification" >&5
> -$as_echo_n "checking for host support for vtable verification... " >&6; }
> -. ${srcdir}/configure.tgt
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VTV_SUPPORTED" >&5
> -$as_echo "$VTV_SUPPORTED" >&6; }
> -
> -# Decide if it's usable.
> -use_vtable_verify=no
> -if test "x$VTV_SUPPORTED" = "xyes"; then
> -  use_vtable_verify=yes
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: using vtable verification" >&5
> -$as_echo "$as_me: using vtable verification" >&6;}
> -fi
> -
>  # Do not delete or change the following two lines.  For why, see
>  # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
>  ac_aux_dir=
> @@ -2522,6 +2506,22 @@ esac
>
>
>
> +# See if supported.
> +unset VTV_SUPPORTED
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for host support for vtable verification" >&5
> +$as_echo_n "checking for host support for vtable verification... " >&6; }
> +. ${srcdir}/configure.tgt
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VTV_SUPPORTED" >&5
> +$as_echo "$VTV_SUPPORTED" >&6; }
> +
> +# Decide if it's usable.
> +use_vtable_verify=no
> +if test "x$VTV_SUPPORTED" = "xyes"; then
> +  use_vtable_verify=yes
> +  { $as_echo "$as_me:${as_lineno-$LINENO}: using vtable verification" >&5
> +$as_echo "$as_me: using vtable verification" >&6;}
> +fi
> +
>  am__api_version='1.11'
>
>  # Find a good install program.  We prefer a C program (faster),
> diff --git a/libvtv/configure.ac b/libvtv/configure.ac
> index 6db97dc..e3fb92f 100644
> --- a/libvtv/configure.ac
> +++ b/libvtv/configure.ac
> @@ -20,6 +20,13 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
>  [version_specific_libs=no])
>  AC_MSG_RESULT($version_specific_libs)
>
> +# Do not delete or change the following two lines.  For why, see
> +# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
> +AC_CANONICAL_SYSTEM
> +target_alias=${target_alias-$host_alias}
> +AC_SUBST(target_alias)
> +GCC_LIBSTDCXX_RAW_CXX_FLAGS
> +
>  # See if supported.
>  unset VTV_SUPPORTED
>  AC_MSG_CHECKING([for host support for vtable verification])
> @@ -33,13 +40,6 @@ if test "x$VTV_SUPPORTED" = "xyes"; then
>    AC_MSG_NOTICE(using vtable verification)
>  fi
>
> -# Do not delete or change the following two lines.  For why, see
> -# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
> -AC_CANONICAL_SYSTEM
> -target_alias=${target_alias-$host_alias}
> -AC_SUBST(target_alias)
> -GCC_LIBSTDCXX_RAW_CXX_FLAGS
> -
>  AM_INIT_AUTOMAKE(foreign no-dist)
>  AM_ENABLE_MULTILIB(, ..)
>  AM_MAINTAINER_MODE
Jakub Jelinek Sept. 10, 2013, 10:17 a.m. UTC | #2
On Mon, Sep 09, 2013 at 01:56:29PM -0700, Caroline Tice wrote:
> The patch looks good to me, but somebody else needs to approve it.

Why?  You are listed as libvtv maintainer, the patch is fully contained in
libvtv, thus you can review it and approve.

On an unrelated note, what kind of testing was performed on libvtv
testsuite?
I'm seeing very bad results on both x86_64-linux and i686-linux, like
                === libvtv Summary ===

# of expected passes            92
# of unexpected failures        44
# of unresolved testcases       40

Many of the errors seem to be related to missing vtv_start_preinit.o
not being found (why do those actually live in libgcc rather than libvtv?),
libvtv/Makefile.am has only rules for vtv_start.c etc., but not
vtv_start_preinit.c.

But I also see complains from glibc about corrupted malloc state in some
tests, tests with such undefined behavior IMHO don't belong into the
testsuite, unless you can prevent the corruption before it happens.

	Jakub
Caroline Tice Sept. 10, 2013, 3:55 p.m. UTC | #3
On Tue, Sep 10, 2013 at 3:17 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Mon, Sep 09, 2013 at 01:56:29PM -0700, Caroline Tice wrote:
>> The patch looks good to me, but somebody else needs to approve it.
>
> Why?  You are listed as libvtv maintainer, the patch is fully contained in
> libvtv, thus you can review it and approve.
>

There was a bit of communication confusion and I originally
misunderstood things.  I thought I was the libvtv maintainer,  but so
far i have only been proposed (am being proposed?) to the steering
committee to be the libvtv maintainer.    Until the steering committee
officially approves that, I am not actually the maintainer, and I do
not have the authority to approve patches.


> On an unrelated note, what kind of testing was performed on libvtv
> testsuite?
> I'm seeing very bad results on both x86_64-linux and i686-linux, like
>                 === libvtv Summary ===
>
> # of expected passes            92
> # of unexpected failures        44
> # of unresolved testcases       40
>
> Many of the errors seem to be related to missing vtv_start_preinit.o
> not being found (why do those actually live in libgcc rather than libvtv?),
> libvtv/Makefile.am has only rules for vtv_start.c etc., but not
> vtv_start_preinit.c.
>

Actually I performed a lot of testing of this testsuite, but it was
all on my linux x86_64 system.    I consistently get it passing all
the tests:

=== libvtv tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/local/share/dejagnu/baseboards/unix.exp as board
description file for target.
Using /usr/local/share/dejagnu/config/unix.exp as generic interface
file for target.
Using /usr/local/google2/cmtice/gcc-fsf/libvtv/testsuite/config/default.exp
as tool-and-target-specific interface file.
Running /usr/local/google2/cmtice/gcc-fsf/libvtv/testsuite/libvtv.cc/vtv.exp ...
Running /usr/local/google2/cmtice/gcc-fsf/libvtv/testsuite/libvtv.mempool.cc/mempool.exp
...
Running /usr/local/google2/cmtice/gcc-fsf/libvtv/testsuite/libvtv.mt.cc/mt.exp
...

=== libvtv Summary ===

# of expected passes 176
make[1]: Leaving directory
`/usr/local/google2/cmtice/gcc-fsf.obj/x86_64-unknown-linux-gnu/libvtv/testsuite'


Based on the errors you are reporting, my guess is that you did not
configure with --enable-vtable-verifiy.  The testsuite in libvtv will
not pass without vtable verification enabled.  If you DID configure
with --enable-vtable-verify, then please send me the rest of your
configure command so that I can try to reproduce your failures.



> But I also see complains from glibc about corrupted malloc state in some
> tests, tests with such undefined behavior IMHO don't belong into the
> testsuite, unless you can prevent the corruption before it happens.
>

I have never seen that; if you could forward the complaints/errors to
me I would appreciate it.

-- Caroline Tice
cmtice@google.com

>         Jakub
H.J. Lu Sept. 10, 2013, 4:03 p.m. UTC | #4
On Tue, Sep 10, 2013 at 8:55 AM, Caroline Tice <cmtice@google.com> wrote:
> On Tue, Sep 10, 2013 at 3:17 AM, Jakub Jelinek <jakub@redhat.com> wrote:
>> On Mon, Sep 09, 2013 at 01:56:29PM -0700, Caroline Tice wrote:
>>> The patch looks good to me, but somebody else needs to approve it.
>>
>> Why?  You are listed as libvtv maintainer, the patch is fully contained in
>> libvtv, thus you can review it and approve.
>>
>
> There was a bit of communication confusion and I originally
> misunderstood things.  I thought I was the libvtv maintainer,  but so
> far i have only been proposed (am being proposed?) to the steering
> committee to be the libvtv maintainer.    Until the steering committee
> officially approves that, I am not actually the maintainer, and I do
> not have the authority to approve patches.

I saw

libvtv                  Caroline Tice        cmtice@google.com

in MAINTAINERS and I checked my fix in.

>
>> On an unrelated note, what kind of testing was performed on libvtv
>> testsuite?
>> I'm seeing very bad results on both x86_64-linux and i686-linux, like
>>                 === libvtv Summary ===
>>
>> # of expected passes            92
>> # of unexpected failures        44
>> # of unresolved testcases       40
>>
>> Many of the errors seem to be related to missing vtv_start_preinit.o
>> not being found (why do those actually live in libgcc rather than libvtv?),
>> libvtv/Makefile.am has only rules for vtv_start.c etc., but not
>> vtv_start_preinit.c.
>>
>
> Actually I performed a lot of testing of this testsuite, but it was
> all on my linux x86_64 system.    I consistently get it passing all
> the tests:
>
> Based on the errors you are reporting, my guess is that you did not
> configure with --enable-vtable-verifiy.  The testsuite in libvtv will
> not pass without vtable verification enabled.  If you DID configure
> with --enable-vtable-verify, then please send me the rest of your
> configure command so that I can try to reproduce your failures.
>

I didn't configure GCC with --enable-vtable-verify and libvtv is built.
Should we not to build libvtv if vtable-verify is disabled?
Jakub Jelinek Sept. 10, 2013, 4:10 p.m. UTC | #5
On Tue, Sep 10, 2013 at 08:55:35AM -0700, Caroline Tice wrote:
> Based on the errors you are reporting, my guess is that you did not
> configure with --enable-vtable-verifiy.  The testsuite in libvtv will

I'm not, but it doesn't make sense if you don't configure gcc in certain
non-default way, you get dozens of FAILs during the make check.
If libvtv doesn't work at all without --enable-vtable-verify, perhaps it
shouldn't be built, or at least make check shouldn't be run?
Does --enable-vtable-verify affect anything but the 4 extra objects built in
libgcc subdir that aren't actually linked into libgcc / libgcc_s?

> I have never seen that; if you could forward the complaints/errors to
> me I would appreciate it.

E.g.
Running /usr/src/gcc/libvtv/testsuite/libvtv.cc/vtv.exp ...
*** Potential vtable pointer corruption detected!!
 ***: ./template-list-iostream.exe terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f2cda8134d7]
/usr/src/gcc/obj716/x86_64-unknown-linux-gnu/./libvtv/.libs/libvtv.so.0(+0x3289)[0x7f2cdb2dd289]
/usr/src/gcc/obj716/x86_64-unknown-linux-gnu/./libvtv/.libs/libvtv.so.0(+0x338f)[0x7f2cdb2dd38f]
/usr/src/gcc/obj716/x86_64-unknown-linux-gnu/./libvtv/.libs/libvtv.so.0(_Z24__VLTVerifyVtablePointerPPvPKv+0xb0)[0x7f2cdb2dd570]
./template-list-iostream.exe[0x4012c2]
./template-list-iostream.exe[0x401366]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f2cda72b735]
./template-list-iostream.exe[0x401131]
======= Memory map: ========
00400000-00404000 r-xp 00000000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
00603000-00604000 rw-p 00003000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
00604000-00605000 r--p 00004000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
00605000-00606000 rw-p 00005000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
01867000-01888000 rw-p 00000000 00:00 0                                  [heap]
7f2cda70a000-7f2cda8b6000 r-xp 00000000 fd:00 2884204                    /usr/lib64/libc-2.15.so
7f2cda8b6000-7f2cdaab6000 ---p 001ac000 fd:00 2884204                    /usr/lib64/libc-2.15.so
7f2cdaab6000-7f2cdaaba000 r--p 001ac000 fd:00 2884204                    /usr/lib64/libc-2.15.so
7f2cdaaba000-7f2cdaabc000 rw-p 001b0000 fd:00 2884204                    /usr/lib64/libc-2.15.so
7f2cdaabc000-7f2cdaac1000 rw-p 00000000 00:00 0 
7f2cdaac1000-7f2cdaad6000 r-xp 00000000 fd:02 17643616                   /usr/src/gcc/obj716/gcc/libgcc_s.so.1
7f2cdaad6000-7f2cdacd5000 ---p 00015000 fd:02 17643616                   /usr/src/gcc/obj716/gcc/libgcc_s.so.1
7f2cdacd5000-7f2cdacd6000 rw-p 00014000 fd:02 17643616                   /usr/src/gcc/obj716/gcc/libgcc_s.so.1
7f2cdacd6000-7f2cdadd0000 r-xp 00000000 fd:00 2901742                    /usr/lib64/libm-2.15.so
7f2cdadd0000-7f2cdafcf000 ---p 000fa000 fd:00 2901742                    /usr/lib64/libm-2.15.so
7f2cdafcf000-7f2cdafd0000 r--p 000f9000 fd:00 2901742                    /usr/lib64/libm-2.15.so
7f2cdafd0000-7f2cdafd1000 rw-p 000fa000 fd:00 2901742                    /usr/lib64/libm-2.15.so
7f2cdafd1000-7f2cdb0bc000 r-xp 00000000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
7f2cdb0bc000-7f2cdb2bb000 ---p 000eb000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
7f2cdb2bb000-7f2cdb2c3000 r--p 000ea000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
7f2cdb2c3000-7f2cdb2c5000 rw-p 000f2000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
7f2cdb2c5000-7f2cdb2da000 rw-p 00000000 00:00 0 
7f2cdb2da000-7f2cdb2e2000 r-xp 00000000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
7f2cdb2e2000-7f2cdb4e1000 ---p 00008000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
7f2cdb4e1000-7f2cdb4e2000 rw-p 00007000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
7f2cdb4e2000-7f2cdb4e4000 r--p 00008000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
7f2cdb4e4000-7f2cdb4e5000 rw-p 0000a000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
7f2cdb4e5000-7f2cdb505000 r-xp 00000000 fd:00 2884197                    /usr/lib64/ld-2.15.so
7f2cdb6ed000-7f2cdb6f2000 rw-p 00000000 00:00 0 
7f2cdb6f4000-7f2cdb6f6000 rw-p 00000000 00:00 0 
7f2cdb6f6000-7f2cdb701000 r--p 00000000 00:00 0 
7f2cdb701000-7f2cdb704000 rw-p 00000000 00:00 0 
7f2cdb704000-7f2cdb705000 r--p 0001f000 fd:00 2884197                    /usr/lib64/ld-2.15.so
7f2cdb705000-7f2cdb706000 rw-p 00020000 fd:00 2884197                    /usr/lib64/ld-2.15.so
7f2cdb706000-7f2cdb707000 rw-p 00000000 00:00 0 
7fff6ef04000-7fff6ef26000 rw-p 00000000 00:00 0                          [stack]
7fff6ef51000-7fff6ef53000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
FAIL: libvtv.cc/template-list-iostream.cc -O0 -fvtable-verify=std execution test

	Jakub
Caroline Tice Sept. 10, 2013, 4:17 p.m. UTC | #6
On Tue, Sep 10, 2013 at 9:10 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Tue, Sep 10, 2013 at 08:55:35AM -0700, Caroline Tice wrote:
>> Based on the errors you are reporting, my guess is that you did not
>> configure with --enable-vtable-verifiy.  The testsuite in libvtv will
>
> I'm not, but it doesn't make sense if you don't configure gcc in certain
> non-default way, you get dozens of FAILs during the make check.
> If libvtv doesn't work at all without --enable-vtable-verify, perhaps it
> shouldn't be built, or at least make check shouldn't be run?

I didn't realize the testsuite in libvtv would be run unless
explicitly requested.  I agree that there should be a test to see
whether --enable-vtable-verify was set before attempting to run the
libvtv testsuite.  This is not my area of expertise and if someone
could point me to an example or show me where/how to put such a
conditional test, I would appreciate it.

> Does --enable-vtable-verify affect anything but the 4 extra objects built in
> libgcc subdir that aren't actually linked into libgcc / libgcc_s?
>

--enable-vtable-verify also affects how libstdc++ is built. That is
for sure what is causing the error you are seeing below.  That
particular test case (template-list-iostream) tests whether a
particular libstdc++ class passes verification.  If libstdc++ was not
built with vtable verification, then it will fail exactly as shown
below.

>> I have never seen that; if you could forward the complaints/errors to
>> me I would appreciate it.
>
> E.g.
> Running /usr/src/gcc/libvtv/testsuite/libvtv.cc/vtv.exp ...
> *** Potential vtable pointer corruption detected!!
>  ***: ./template-list-iostream.exe terminated
> ======= Backtrace: =========
> /lib64/libc.so.6(__fortify_fail+0x37)[0x7f2cda8134d7]
> /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/./libvtv/.libs/libvtv.so.0(+0x3289)[0x7f2cdb2dd289]
> /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/./libvtv/.libs/libvtv.so.0(+0x338f)[0x7f2cdb2dd38f]
> /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/./libvtv/.libs/libvtv.so.0(_Z24__VLTVerifyVtablePointerPPvPKv+0xb0)[0x7f2cdb2dd570]
> ./template-list-iostream.exe[0x4012c2]
> ./template-list-iostream.exe[0x401366]
> /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f2cda72b735]
> ./template-list-iostream.exe[0x401131]
> ======= Memory map: ========
> 00400000-00404000 r-xp 00000000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
> 00603000-00604000 rw-p 00003000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
> 00604000-00605000 r--p 00004000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
> 00605000-00606000 rw-p 00005000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
> 01867000-01888000 rw-p 00000000 00:00 0                                  [heap]
> 7f2cda70a000-7f2cda8b6000 r-xp 00000000 fd:00 2884204                    /usr/lib64/libc-2.15.so
> 7f2cda8b6000-7f2cdaab6000 ---p 001ac000 fd:00 2884204                    /usr/lib64/libc-2.15.so
> 7f2cdaab6000-7f2cdaaba000 r--p 001ac000 fd:00 2884204                    /usr/lib64/libc-2.15.so
> 7f2cdaaba000-7f2cdaabc000 rw-p 001b0000 fd:00 2884204                    /usr/lib64/libc-2.15.so
> 7f2cdaabc000-7f2cdaac1000 rw-p 00000000 00:00 0
> 7f2cdaac1000-7f2cdaad6000 r-xp 00000000 fd:02 17643616                   /usr/src/gcc/obj716/gcc/libgcc_s.so.1
> 7f2cdaad6000-7f2cdacd5000 ---p 00015000 fd:02 17643616                   /usr/src/gcc/obj716/gcc/libgcc_s.so.1
> 7f2cdacd5000-7f2cdacd6000 rw-p 00014000 fd:02 17643616                   /usr/src/gcc/obj716/gcc/libgcc_s.so.1
> 7f2cdacd6000-7f2cdadd0000 r-xp 00000000 fd:00 2901742                    /usr/lib64/libm-2.15.so
> 7f2cdadd0000-7f2cdafcf000 ---p 000fa000 fd:00 2901742                    /usr/lib64/libm-2.15.so
> 7f2cdafcf000-7f2cdafd0000 r--p 000f9000 fd:00 2901742                    /usr/lib64/libm-2.15.so
> 7f2cdafd0000-7f2cdafd1000 rw-p 000fa000 fd:00 2901742                    /usr/lib64/libm-2.15.so
> 7f2cdafd1000-7f2cdb0bc000 r-xp 00000000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
> 7f2cdb0bc000-7f2cdb2bb000 ---p 000eb000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
> 7f2cdb2bb000-7f2cdb2c3000 r--p 000ea000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
> 7f2cdb2c3000-7f2cdb2c5000 rw-p 000f2000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
> 7f2cdb2c5000-7f2cdb2da000 rw-p 00000000 00:00 0
> 7f2cdb2da000-7f2cdb2e2000 r-xp 00000000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
> 7f2cdb2e2000-7f2cdb4e1000 ---p 00008000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
> 7f2cdb4e1000-7f2cdb4e2000 rw-p 00007000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
> 7f2cdb4e2000-7f2cdb4e4000 r--p 00008000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
> 7f2cdb4e4000-7f2cdb4e5000 rw-p 0000a000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
> 7f2cdb4e5000-7f2cdb505000 r-xp 00000000 fd:00 2884197                    /usr/lib64/ld-2.15.so
> 7f2cdb6ed000-7f2cdb6f2000 rw-p 00000000 00:00 0
> 7f2cdb6f4000-7f2cdb6f6000 rw-p 00000000 00:00 0
> 7f2cdb6f6000-7f2cdb701000 r--p 00000000 00:00 0
> 7f2cdb701000-7f2cdb704000 rw-p 00000000 00:00 0
> 7f2cdb704000-7f2cdb705000 r--p 0001f000 fd:00 2884197                    /usr/lib64/ld-2.15.so
> 7f2cdb705000-7f2cdb706000 rw-p 00020000 fd:00 2884197                    /usr/lib64/ld-2.15.so
> 7f2cdb706000-7f2cdb707000 rw-p 00000000 00:00 0
> 7fff6ef04000-7fff6ef26000 rw-p 00000000 00:00 0                          [stack]
> 7fff6ef51000-7fff6ef53000 r-xp 00000000 00:00 0                          [vdso]
> ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
> FAIL: libvtv.cc/template-list-iostream.cc -O0 -fvtable-verify=std execution test
>
>         Jakub


-- Caroline
cmtice@google.com
Caroline Tice Sept. 10, 2013, 7:16 p.m. UTC | #7
I believe I know how to fix this problem; I am in the middle of
testing my patch.  I should be able to submit the patch either late
today or early tomorrow.  In the meantime, if this is impacting your
ability to make progress, you can configure gcc with --disable-libvtv
and that should remove the problem.

-- Caroline
cmtice@google.com


On Tue, Sep 10, 2013 at 9:17 AM, Caroline Tice <cmtice@google.com> wrote:
> On Tue, Sep 10, 2013 at 9:10 AM, Jakub Jelinek <jakub@redhat.com> wrote:
>> On Tue, Sep 10, 2013 at 08:55:35AM -0700, Caroline Tice wrote:
>>> Based on the errors you are reporting, my guess is that you did not
>>> configure with --enable-vtable-verifiy.  The testsuite in libvtv will
>>
>> I'm not, but it doesn't make sense if you don't configure gcc in certain
>> non-default way, you get dozens of FAILs during the make check.
>> If libvtv doesn't work at all without --enable-vtable-verify, perhaps it
>> shouldn't be built, or at least make check shouldn't be run?
>
> I didn't realize the testsuite in libvtv would be run unless
> explicitly requested.  I agree that there should be a test to see
> whether --enable-vtable-verify was set before attempting to run the
> libvtv testsuite.  This is not my area of expertise and if someone
> could point me to an example or show me where/how to put such a
> conditional test, I would appreciate it.
>
>> Does --enable-vtable-verify affect anything but the 4 extra objects built in
>> libgcc subdir that aren't actually linked into libgcc / libgcc_s?
>>
>
> --enable-vtable-verify also affects how libstdc++ is built. That is
> for sure what is causing the error you are seeing below.  That
> particular test case (template-list-iostream) tests whether a
> particular libstdc++ class passes verification.  If libstdc++ was not
> built with vtable verification, then it will fail exactly as shown
> below.
>
>>> I have never seen that; if you could forward the complaints/errors to
>>> me I would appreciate it.
>>
>> E.g.
>> Running /usr/src/gcc/libvtv/testsuite/libvtv.cc/vtv.exp ...
>> *** Potential vtable pointer corruption detected!!
>>  ***: ./template-list-iostream.exe terminated
>> ======= Backtrace: =========
>> /lib64/libc.so.6(__fortify_fail+0x37)[0x7f2cda8134d7]
>> /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/./libvtv/.libs/libvtv.so.0(+0x3289)[0x7f2cdb2dd289]
>> /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/./libvtv/.libs/libvtv.so.0(+0x338f)[0x7f2cdb2dd38f]
>> /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/./libvtv/.libs/libvtv.so.0(_Z24__VLTVerifyVtablePointerPPvPKv+0xb0)[0x7f2cdb2dd570]
>> ./template-list-iostream.exe[0x4012c2]
>> ./template-list-iostream.exe[0x401366]
>> /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f2cda72b735]
>> ./template-list-iostream.exe[0x401131]
>> ======= Memory map: ========
>> 00400000-00404000 r-xp 00000000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
>> 00603000-00604000 rw-p 00003000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
>> 00604000-00605000 r--p 00004000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
>> 00605000-00606000 rw-p 00005000 fd:02 18150808                           /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/testsuite/template-list-iostream.exe
>> 01867000-01888000 rw-p 00000000 00:00 0                                  [heap]
>> 7f2cda70a000-7f2cda8b6000 r-xp 00000000 fd:00 2884204                    /usr/lib64/libc-2.15.so
>> 7f2cda8b6000-7f2cdaab6000 ---p 001ac000 fd:00 2884204                    /usr/lib64/libc-2.15.so
>> 7f2cdaab6000-7f2cdaaba000 r--p 001ac000 fd:00 2884204                    /usr/lib64/libc-2.15.so
>> 7f2cdaaba000-7f2cdaabc000 rw-p 001b0000 fd:00 2884204                    /usr/lib64/libc-2.15.so
>> 7f2cdaabc000-7f2cdaac1000 rw-p 00000000 00:00 0
>> 7f2cdaac1000-7f2cdaad6000 r-xp 00000000 fd:02 17643616                   /usr/src/gcc/obj716/gcc/libgcc_s.so.1
>> 7f2cdaad6000-7f2cdacd5000 ---p 00015000 fd:02 17643616                   /usr/src/gcc/obj716/gcc/libgcc_s.so.1
>> 7f2cdacd5000-7f2cdacd6000 rw-p 00014000 fd:02 17643616                   /usr/src/gcc/obj716/gcc/libgcc_s.so.1
>> 7f2cdacd6000-7f2cdadd0000 r-xp 00000000 fd:00 2901742                    /usr/lib64/libm-2.15.so
>> 7f2cdadd0000-7f2cdafcf000 ---p 000fa000 fd:00 2901742                    /usr/lib64/libm-2.15.so
>> 7f2cdafcf000-7f2cdafd0000 r--p 000f9000 fd:00 2901742                    /usr/lib64/libm-2.15.so
>> 7f2cdafd0000-7f2cdafd1000 rw-p 000fa000 fd:00 2901742                    /usr/lib64/libm-2.15.so
>> 7f2cdafd1000-7f2cdb0bc000 r-xp 00000000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
>> 7f2cdb0bc000-7f2cdb2bb000 ---p 000eb000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
>> 7f2cdb2bb000-7f2cdb2c3000 r--p 000ea000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
>> 7f2cdb2c3000-7f2cdb2c5000 rw-p 000f2000 fd:02 18130055                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.19
>> 7f2cdb2c5000-7f2cdb2da000 rw-p 00000000 00:00 0
>> 7f2cdb2da000-7f2cdb2e2000 r-xp 00000000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
>> 7f2cdb2e2000-7f2cdb4e1000 ---p 00008000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
>> 7f2cdb4e1000-7f2cdb4e2000 rw-p 00007000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
>> 7f2cdb4e2000-7f2cdb4e4000 r--p 00008000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
>> 7f2cdb4e4000-7f2cdb4e5000 rw-p 0000a000 fd:02 18130772                   /usr/src/gcc/obj716/x86_64-unknown-linux-gnu/libvtv/.libs/libvtv.so.0.0.0
>> 7f2cdb4e5000-7f2cdb505000 r-xp 00000000 fd:00 2884197                    /usr/lib64/ld-2.15.so
>> 7f2cdb6ed000-7f2cdb6f2000 rw-p 00000000 00:00 0
>> 7f2cdb6f4000-7f2cdb6f6000 rw-p 00000000 00:00 0
>> 7f2cdb6f6000-7f2cdb701000 r--p 00000000 00:00 0
>> 7f2cdb701000-7f2cdb704000 rw-p 00000000 00:00 0
>> 7f2cdb704000-7f2cdb705000 r--p 0001f000 fd:00 2884197                    /usr/lib64/ld-2.15.so
>> 7f2cdb705000-7f2cdb706000 rw-p 00020000 fd:00 2884197                    /usr/lib64/ld-2.15.so
>> 7f2cdb706000-7f2cdb707000 rw-p 00000000 00:00 0
>> 7fff6ef04000-7fff6ef26000 rw-p 00000000 00:00 0                          [stack]
>> 7fff6ef51000-7fff6ef53000 r-xp 00000000 00:00 0                          [vdso]
>> ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
>> FAIL: libvtv.cc/template-list-iostream.cc -O0 -fvtable-verify=std execution test
>>
>>         Jakub
>
>
> -- Caroline
> cmtice@google.com
diff mbox

Patch

diff --git a/libvtv/ChangeLog b/libvtv/ChangeLog
index 20092f4..3c344f9 100644
--- a/libvtv/ChangeLog
+++ b/libvtv/ChangeLog
@@ -1,3 +1,9 @@ 
+2013-09-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR other/58374
+	* configure.ac: Move VTV_SUPPORTED check after AC_CANONICAL_SYSTEM.
+	* configure: Regenerated.
+
 2013-09-08  Caroline Tice  <cmtice@google.com>
 
 	* testsuite/event-main.cc:  Move to libvtv.cc subdirectory.
diff --git a/libvtv/configure b/libvtv/configure
index bb56cb0..0bd614a 100755
--- a/libvtv/configure
+++ b/libvtv/configure
@@ -2339,22 +2339,6 @@  fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $version_specific_libs" >&5
 $as_echo "$version_specific_libs" >&6; }
 
-# See if supported.
-unset VTV_SUPPORTED
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for host support for vtable verification" >&5
-$as_echo_n "checking for host support for vtable verification... " >&6; }
-. ${srcdir}/configure.tgt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VTV_SUPPORTED" >&5
-$as_echo "$VTV_SUPPORTED" >&6; }
-
-# Decide if it's usable.
-use_vtable_verify=no
-if test "x$VTV_SUPPORTED" = "xyes"; then
-  use_vtable_verify=yes
-  { $as_echo "$as_me:${as_lineno-$LINENO}: using vtable verification" >&5
-$as_echo "$as_me: using vtable verification" >&6;}
-fi
-
 # Do not delete or change the following two lines.  For why, see
 # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
 ac_aux_dir=
@@ -2522,6 +2506,22 @@  esac
 
 
 
+# See if supported.
+unset VTV_SUPPORTED
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for host support for vtable verification" >&5
+$as_echo_n "checking for host support for vtable verification... " >&6; }
+. ${srcdir}/configure.tgt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VTV_SUPPORTED" >&5
+$as_echo "$VTV_SUPPORTED" >&6; }
+
+# Decide if it's usable.
+use_vtable_verify=no
+if test "x$VTV_SUPPORTED" = "xyes"; then
+  use_vtable_verify=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: using vtable verification" >&5
+$as_echo "$as_me: using vtable verification" >&6;}
+fi
+
 am__api_version='1.11'
 
 # Find a good install program.  We prefer a C program (faster),
diff --git a/libvtv/configure.ac b/libvtv/configure.ac
index 6db97dc..e3fb92f 100644
--- a/libvtv/configure.ac
+++ b/libvtv/configure.ac
@@ -20,6 +20,13 @@  AC_ARG_ENABLE(version-specific-runtime-libs,
 [version_specific_libs=no])
 AC_MSG_RESULT($version_specific_libs)
 
+# Do not delete or change the following two lines.  For why, see
+# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
+AC_CANONICAL_SYSTEM
+target_alias=${target_alias-$host_alias}
+AC_SUBST(target_alias)
+GCC_LIBSTDCXX_RAW_CXX_FLAGS
+
 # See if supported.
 unset VTV_SUPPORTED
 AC_MSG_CHECKING([for host support for vtable verification])
@@ -33,13 +40,6 @@  if test "x$VTV_SUPPORTED" = "xyes"; then
   AC_MSG_NOTICE(using vtable verification)
 fi 
 
-# Do not delete or change the following two lines.  For why, see
-# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
-AC_CANONICAL_SYSTEM
-target_alias=${target_alias-$host_alias}
-AC_SUBST(target_alias)
-GCC_LIBSTDCXX_RAW_CXX_FLAGS
-
 AM_INIT_AUTOMAKE(foreign no-dist)
 AM_ENABLE_MULTILIB(, ..)
 AM_MAINTAINER_MODE