public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/66343] New: "Error: .Lubsan_type3 already defined" with UBSan and precompiled headers
@ 2015-05-30 12:56 andrey.vihrov at gmail dot com
  2015-08-24 20:21 ` [Bug sanitizer/66343] " rogero at howzatt dot demon.co.uk
  0 siblings, 1 reply; 2+ messages in thread
From: andrey.vihrov at gmail dot com @ 2015-05-30 12:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66343
           Summary: "Error: .Lubsan_type3 already defined" with UBSan and
                    precompiled headers
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andrey.vihrov at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Using this source as test.cpp:

#include <iostream>

int arr[2];

int main()
{
    int d, i = 0;
    std::cin >> d;
    int x = arr[i] - arr[i+1];
    int res = (d - 1) / d;
}

and compiling with

g++ -o stdc++.h.gch -x c++-header
/usr/include/c++/5.1.0/x86_64-unknown-linux-gnu/32/bits/stdc++.h -m32
-fsanitize=undefined && g++ -o test test.cpp -I. -include stdc++.h -m32
-fsanitize=undefined -Winvalid-pch

(this command precompiles <bits/stdc++.h> as stdc++.h.gch, then uses it with
the above program), the result is

/tmp/ccw5nd8W.s: Assembler messages:
/tmp/ccw5nd8W.s:86: Error: symbol `.Lubsan_type3' is already defined

I'm not attaching a preprocessed source because this problem appears only with
precompiled headers.

gcc -v:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc-multilib/src/gcc-5-20150519/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --enable-multilib --disable-werror
--enable-checking=release --with-default-libstdcxx-abi=c++98
Thread model: posix
gcc version 5.1.0 (GCC)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug sanitizer/66343] "Error: .Lubsan_type3 already defined" with UBSan and precompiled headers
  2015-05-30 12:56 [Bug sanitizer/66343] New: "Error: .Lubsan_type3 already defined" with UBSan and precompiled headers andrey.vihrov at gmail dot com
@ 2015-08-24 20:21 ` rogero at howzatt dot demon.co.uk
  0 siblings, 0 replies; 2+ messages in thread
From: rogero at howzatt dot demon.co.uk @ 2015-08-24 20:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Roger Orr <rogero at howzatt dot demon.co.uk> ---
Fails for me (with a very slightly different label: Lubsan_type0) on gcc-trunk
(as of 2015-08-22) without needing the -m32:

$ /usr/share/gcc-trunk/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/share/gcc-trunk/bin/gcc
COLLECT_LTO_WRAPPER=/usr/share/gcc-trunk/libexec/gcc/x86_64-unknown-cygwin/6.0.0/lto-wrapper.exe
Target: x86_64-unknown-cygwin
Configured with: /cygdrive/c/projects/gcc/objdir/../gcctrunk/configure
--enable-languages=c,c++ --prefix=/usr/share/gcc-trunk : (reconfigured)
../gcctrunk/configure --prefix=/usr/share/gcc-trunk/ : (reconfigured)
../gcctrunk/configure --prefix=/usr/share/gcc-trunk/ --enable-languages=c,c++
Thread model: single
gcc version 6.0.0 20150822 (experimental) (GCC)

$ /usr/share/gcc-trunk/bin/g++ -o stdc++.h.gch -x c++-header /usr/share/gcc-tru
nk/include/c++/6.0.0/x86_64-unknown-cygwin/bits/stdc++.h -fsanitize=undefined

$ /usr/share/gcc-trunk/bin/g++ -o test test.cpp -I. -include stdc++.h
 -fsanitize=undefined -Winvalid-pch   gwin
/tmp/ccJdB2eu.s: Assembler messages:
/tmp/ccJdB2eu.s:171: Error: symbol `.Lubsan_type0' is already defined


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-24 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-30 12:56 [Bug sanitizer/66343] New: "Error: .Lubsan_type3 already defined" with UBSan and precompiled headers andrey.vihrov at gmail dot com
2015-08-24 20:21 ` [Bug sanitizer/66343] " rogero at howzatt dot demon.co.uk

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).