Skip to content

program dumps core when getpeername() returns EINVAL #1085

Closed
@jkryl

Description

@jkryl

I was running an application using libzmq on solaris and it was dumping core when starting. I traced the problem to zmq::get_peer_ip_address() in ip.cpp, where getpeername() libc function fails with errno set to EINVAL. libzmq considers EINVAL to be consequence of a bug in its implementation thus it dumps core. However open group specification explicitly mentions EINVAL among valid errno codes for getpeername and it should be generated when the peer has closed the connection (http://pubs.opengroup.org/onlinepubs/009695399/functions/getpeername.html).

It seems to me that libzmq should be fixed and EINVAL should be taken out from the assert in get_peer_ip_address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions