EIDRM
Linux / POSIXERRORNotableIPCHIGH confidence

Identifier Removed

Production Risk

Indicates race condition in IPC resource lifecycle management.

What this means

EIDRM (errno 43) is returned when an IPC resource (message queue, semaphore, or shared memory segment) has been deleted while a process was waiting on or operating with it.

Why it happens
  1. 1The IPC resource was deleted with msgctl(IPC_RMID) while another process was blocked in msgrcv()
  2. 2Semaphore set removed while semop() was waiting
How to reproduce

Another process removes the message queue while this process waits.

trigger — this will error
trigger — this will error
// Process A removes the queue
msgctl(msqid, IPC_RMID, NULL);
// Process B (blocked in msgrcv) gets EIDRM

expected output

msgrcv: Identifier removed (EIDRM)

Fix

Handle EIDRM in blocked IPC calls

WHEN When multiple processes share an IPC resource

Handle EIDRM in blocked IPC calls
if (msgrcv(msqid, &buf, sz, 0, 0) == -1) {
  if (errno == EIDRM) {
    // Queue was deleted — exit or reconnect
  }
}

Why this works

Treat EIDRM as a shutdown signal. Coordinate resource lifetime across processes.

Sources
Official documentation ↗

Linux Programmer Manual msgrcv(2)

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Linux / POSIX errors