This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/83372] Compiler segfaults
- From: "alan at octopull dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Dec 2017 19:04:46 +0000
- Subject: [Bug c++/83372] Compiler segfaults
- Auto-submitted: auto-generated
- References: <bug-83372-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83372
--- Comment #5 from Alan Griffiths <alan at octopull dot co.uk> ---
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.)