This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70570] Assembler error "symbol already defined" from nested lambdas and function-static variable


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

Jesse Haber-Kucharsky <jhaberku at scylladb dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jhaberku at scylladb dot com

--- Comment #2 from Jesse Haber-Kucharsky <jhaberku at scylladb dot com> ---
I believe this bug manifested itself in Seastar
(https://github.com/scylladb/seastar/commit/3d21ef5959bedb3ea15032d1632b0b2d7012044a).

The original snippet from Nick causes the error on Fedora 23:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array
--disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC)

and on Ubuntu 16.04:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-5 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

On both platforms, the error is the same:

g++ -std=c++14 test.cc -o test
/tmp/ccTNkOnu.s: Assembler messages:
/tmp/ccTNkOnu.s:34: Error: symbol `_ZL1x' is already defined


On gcc 7.1.1, the error is not present:

Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-libmpx
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 7.1.1 20170622 (Red Hat 7.1.1-3) (GCC)

To reproduce the exact compilation error with Seastar:

docker pull fedora:23
docker run -it --rm fedora:23 bash
dnf install -y git
cd opt && git clone https://github.com/scylladb/seastar
git checkout a2be7a4f312a62c67c79cf818970d0c954f5fc15
git submodule update --init
./install-dependencies.sh
./configure.py --mode=debug
ninja-build build/debug/tests/lowres_clock_test.o

The error:

g++ -MD -MT build/debug/tests/lowres_clock_test.o -MF
build/debug/tests/lowres_clock_test.o.d -fsanitize=address -fsanitize=leak
-fsanitize=undefined -fno-sanitize=vptr -DASAN_ENABLED -O0 -DDEBUG
-DDEBUG_SHARED_PTR -DDEFAULT_ALLOCATOR -DSEASTAR_THREAD_STACK_GUARDS
-I/opt/seastar/build/debug/gen -I/opt/seastar/build/debug/c-ares -std=gnu++1y
-g  -Wall -Werror -Wno-error=deprecated-declarations -fvisibility=hidden 
-pthread -I/opt/seastar -U_FORTIFY_SOURCE  -I/opt/seastar/fmt
-DBOOST_TEST_DYN_LINK -Wno-overloaded-virtual -Wno-maybe-uninitialized
-DFMT_HEADER_ONLY -DHAVE_HWLOC -DHAVE_NUMA -DHAVE_LZ4_COMPRESS_DEFAULT -c -o
build/debug/tests/lowres_clock_test.o tests/lowres_clock_test.cc
/tmp/cch6C9Km.s: Assembler messages:
/tmp/cch6C9Km.s:19986: Error: symbol `_ZL14sleep_duration' is already defined


I've attached the lowres_clock_test.ii file.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]