[Bug lto/96969] New: ODR violations do not list the translation unit

2020-09-08 Thread alan at octopull dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96969

Bug ID: 96969
   Summary: ODR violations do not list the translation unit
   Product: gcc
   Version: 9.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: alan at octopull dot co.uk
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

ODR violations can occur in structures defined in headers whose contents depend
on the inclusion context. For example:

./include/platform/mir/graphics/egl_extensions.h:164:12: error: type ‘struct
PlatformBaseEXT’ violates the C++ One Definition Rule [-Werror=odr]
./include/platform/mir/graphics/egl_extensions.h:164:12: note: a different type
is defined in another translation unit
./include/platform/mir/graphics/egl_extensions.h:168:47: note: the first
difference of corresponding definitions is field ‘eglGetPlatformDisplay’
./include/platform/mir/graphics/egl_extensions.h:168:47: note: a field with
different name is defined in another translation unit

The debug info in the .o should include the name of the "top level" file for
the translation unit, even if the path from that file to a specific location in
a header isn't stored. Alternatively, the name of the .o file would be helpful.

Please add some information to the diagnostic messages that identifies the
translation units that cause the ODR violation.

[Bug c++/83372] New: Compiler segfaults

2017-12-11 Thread alan at octopull dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83372

Bug ID: 83372
   Summary: Compiler segfaults
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: alan at octopull dot co.uk
  Target Milestone: ---

Created attachment 42839
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42839&action=edit
build log including gcc dump

g++7.2.0 on Ubuntu Artful AMD64:
https://launchpadlibrarian.net/348583139/buildlog_ubuntu-artful-amd64.mir_0.29.0~rc7-g165e6e8886-0ubuntu17.10_BUILDING.txt.gz

(Alse seen with g++7.2.1 on Fedora 27 x86_64:
https://copr-be.cloud.fedoraproject.org/results/ngompa/mir-prerel-fedora/fedora-27-x86_64/00685833-mir/builder-live.log)

Various other compiler versions and architectures built successfully. 

/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/server/frontend/wayland/wayland_connector.cpp:2275:1:
internal compiler error: Segmentation fault
 }
 ^
Please submit a full bug report


Preprocessed source stored into /tmp/cczHUc1t.out file, please attach this to
your bugreport.

[Bug c++/83372] Compiler segfaults

2017-12-11 Thread alan at octopull dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83372

--- Comment #2 from Alan Griffiths  ---
Created attachment 42841
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42841&action=edit
Preprocessed source

So far, I've only seen the error on "builders" where I don't have access (i.e.
I've so far failed to reproduce "locally"). The attached preprocessed source
comes from adapting the compile command shown in the build log and running that
locally.

I'm told the error also appears on Fedora 27 32bit builds, but intermittently.

[Bug c++/83372] Compiler segfaults

2017-12-11 Thread alan at octopull dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83372

Alan Griffiths  changed:

   What|Removed |Added

  Attachment #42841|0   |1
is obsolete||

--- Comment #4 from Alan Griffiths  ---
Created attachment 42843
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42843&action=edit
Preprocessed source as dumped by a failing build

I finally found a way to reproduce (using mock). Updated source from that.

[Bug c++/83372] Compiler segfaults

2017-12-11 Thread alan at octopull dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83372

--- Comment #5 from Alan Griffiths  ---
It isn't clear why, but the problem seems to be provoked by this function:

int mf::WaylandConnector::client_socket_fd() const
{
enum { server, client, size };
int socket_fd[size];

if (socketpair(AF_LOCAL, SOCK_STREAM, 0, socket_fd))
{
BOOST_THROW_EXCEPTION((std::system_error{
errno,
std::system_category(),
"Could not create socket pair"}));
}

if (!wl_client_create(display.get(), socket_fd[server]))
{
BOOST_THROW_EXCEPTION((std::system_error{
errno,
std::system_category(),
"Failed to add server end of socketpair to Wayland display"}));
}

return socket_fd[client];
}

Reworking to have just one throw site avoids the segfault. (But I've not yet
found a simpler example exhibiting the problem.)

[Bug c++/83372] Compiler segfaults

2017-12-11 Thread alan at octopull dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83372

--- Comment #7 from Alan Griffiths  ---
cd
/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/x86_64-redhat-linux-gnu/src/server/frontend/wayland
&& /usr/bin/c++  -DLOG_NDEBUG=1 -DMESA_EGL_NO_X11_HEADERS
-DMIR_DRMMODEADDFB_HAS_CONST_SIGNATURE
-DMIR_LOG_COMPONENT_FALLBACK=\"mirserver\"
-DMIR_SERVER_EGL_OPENGL_API=EGL_OPENGL_ES_API
-DMIR_SERVER_EGL_OPENGL_BIT=EGL_OPENGL_ES2_BIT
-DMIR_SERVER_GLEXT_H="" -DMIR_SERVER_GL_H=""
-DMIR_SERVER_GRAPHICS_PLATFORM_VERSION=\"MIR_GRAPHICS_PLATFORM_0.27\"
-DMIR_SERVER_INPUT_PLATFORM_VERSION=\"MIR_INPUT_PLATFORM_0.27\"
-DMIR_SERVER_PLATFORM_PATH=\"/usr/lib64/mir/server-platform\"
-DMIR_VERSION=\"0.29.0\" -DMIR_VERSION_MAJOR=0 -DMIR_VERSION_MICRO=0
-DMIR_VERSION_MINOR=29 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/core
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/common
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/cookie
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/common
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/x86_64-redhat-linux-gnu/src/capnproto
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/x86_64-redhat-linux-gnu/src/protobuf
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/platform
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/client
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/server
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/renderer
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/renderers/gl
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/renderers/sw
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/platform
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/client
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/server
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/cookie
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -O2 -g -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -pthread -g
-std=c++14 -Werror -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor
-Wextra -fPIC -Wno-psabi -flto -ffat-lto-objects   -o
CMakeFiles/mirfrontend-wayland.dir/wayland_connector.cpp.o -c
/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/server/frontend/wayland/wayland_connector.cpp
-v
Using built-in specs.
Reading specs from /usr/lib/rpm/redhat/redhat-hardened-cc1
COLLECT_GCC=/usr/bin/c++
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.2.1 20170915 (Red Hat 7.2.1-2) (GCC) 
COLLECT_GCC_OPTIONS='-D' 'LOG_NDEBUG=1' '-D' 'MESA_EGL_NO_X11_HEADERS' '-D'
'MIR_DRMMODEADDFB_HAS_CONST_SIGNATURE' '-D'
'MIR_LOG_COMPONENT_FALLBACK="mirserver"' '-D'
'MIR_SERVER_EGL_OPENGL_API=EGL_OPENGL_ES_API' '-D'
'MIR_SERVER_EGL_OPENGL_BIT=EGL_OPENGL_ES2_BIT' '-D'
'MIR_SERVER_GLEXT_H=' '-D' 'MIR_SERVER_GL_H=' '-D'
'MIR_SERVER_GRAPHICS_PLATFORM_VERSION="MIR_GRAPHICS_PLATFORM_0.27"' '-D'
'MIR_SERVER_INPUT_PLATFORM_VERSION="MIR_INPUT_PLATFORM_0.27"' '-D'
'MIR_SERVER_PLATFORM_PATH="/usr/lib64/mir/server-platform"' '-D'
'MIR_VERSION="0.29.0"' '-D' 'MIR_VERSION_MAJOR=0' '-D' 'MIR_VERSION_MICRO=0'
'-D' 'MIR_VERSION_MINOR=29' '-D' '_FILE_OFFSET_BITS=64' '-D' '_GNU_SOURCE' '-I'
'/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/core'
'-I'
'/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/common'
'-I'
'/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/cookie'
'-I'
'/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/common'
'-I'
'/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/x86_64-redhat-linux-gnu/src/capnproto'
'-I'
'/builddir/build/BUILD/mir-5500595

[Bug c++/83372] Compiler segfaults

2017-12-11 Thread alan at octopull dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83372

--- Comment #10 from Alan Griffiths  ---
It took me some time and effort to reproduce too. :(

Building in my normal development environments showed no problems. And I've yet
to reproduce on Ubuntu (although the builders we use fail building for 17.10).

The steps I took (on Fedora 27):

$ sudo dnf install mock
$ sudo usermod -a -G mock $USER
$ wget
https://copr-be.cloud.fedoraproject.org/results/ngompa/mir-prerel-fedora/fedora-27-x86_64/00685833-mir/mir-0.29~git20171208.1.5500595-0.fc27.1.src.rpm
$ mock -r fedora-27-x86_64 mir-0.29~git20171208.1.5500595-0.fc27.1.src.rpm
$ mock -r fedora-27-x86_64 --shell
# cd
/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/x86_64-redhat-linux-gnu/src/server/frontend/wayland
&& /usr/bin/c++  -DLOG_NDEBUG=1 -DMESA_EGL_NO_X11_HEADERS
-DMIR_DRMMODEADDFB_HAS_CONST_SIGNATURE
-DMIR_LOG_COMPONENT_FALLBACK=\"mirserver\"
-DMIR_SERVER_EGL_OPENGL_API=EGL_OPENGL_ES_API
-DMIR_SERVER_EGL_OPENGL_BIT=EGL_OPENGL_ES2_BIT
-DMIR_SERVER_GLEXT_H="" -DMIR_SERVER_GL_H=""
-DMIR_SERVER_GRAPHICS_PLATFORM_VERSION=\"MIR_GRAPHICS_PLATFORM_0.27\"
-DMIR_SERVER_INPUT_PLATFORM_VERSION=\"MIR_INPUT_PLATFORM_0.27\"
-DMIR_SERVER_PLATFORM_PATH=\"/usr/lib64/mir/server-platform\"
-DMIR_VERSION=\"0.29.0\" -DMIR_VERSION_MAJOR=0 -DMIR_VERSION_MICRO=0
-DMIR_VERSION_MINOR=29 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/core
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/common
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/cookie
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/common
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/x86_64-redhat-linux-gnu/src/capnproto
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/x86_64-redhat-linux-gnu/src/protobuf
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/platform
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/client
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/server
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/renderer
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/renderers/gl
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/include/renderers/sw
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/platform
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/client
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/server
-I/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/include/cookie
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -O2 -g -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -pthread -g
-std=c++14 -Werror -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor
-Wextra -fPIC -Wno-psabi -flto -ffat-lto-objects   -o
CMakeFiles/mirfrontend-wayland.dir/wayland_connector.cpp.o -c
/builddir/build/BUILD/mir-5500595810c28c150a3bd9edf19b392c2aeab932/src/server/frontend/wayland/wayland_connector.cpp