Skip to content

sendto() returns undocumented return code #74

@afindling

Description

@afindling

Description of Problem:
One of our Customers has recently upgrade its Linux to:
Linux demchdc178x 4.12.14-122.60-default #1 SMP Mon Feb 1 20:52:25 UTC 2021 (cb56da1) x86_64 x86_64 x86_64 GNU/Linux
From old 4.12.14-122.46-default

Now he experiences a strange new behavior with our Product that he hasn’t seen before the Linux update.
Our product uses the C system call sendto() (on a UDP socket) in order to communicate between multiple threads internally (receiver is within same process).
This function is called very often (hundreds times per sec) successfully, but from time to time this function returns an unexpected and undocumented return code EPERM
We can see this from our Exception Logging like

Logging: sendto (s: 20, msg: 0x7f240a1f97e8, len: 4, flags: 0, to: 0x10090d60, tolen: 16) = -1 - errno = EPERM(1)
msg: 0000 70 00 00 1F p...............
to: 0000 02 00 BF EB 7F 00 00 01 00 00 00 00 00 00 00 00 ..........

Now, as this is an unexpected return-code, the sender does not know how to react and therefore throws an exception and exits the process.
This means that the service is broken.
The customer reports that this happened about 150times a day and is not very happy about it.
Questions:

  1. What exactly does EPERM mean in the context of sendto() ?
  2. Why is this return-code not documented?
  3. How shall the caller proceed when this EPERM is returned.

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