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++/83372] Compiler segfaults


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

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