accessibility-oscilloscope / buildroot

accessibility oscilloscope buildroot config
0 stars 0 forks source link

potential race condition in program initialization #10

Closed jleightcap closed 2 years ago

jleightcap commented 2 years ago

our programs look something like

// program p1.
int main(void) {
   mkfifo("p1-fifo");
   open("p1-fifo", O_RDONLY); // fine

   open("p2-fifo", O_WRONLY); // does that FIFO exist yet?
}

the open on a fifo that has not yet been created blocks, and does not unblock when the FIFO is subsequently made.

the init script forks the programs in reverse order, such that a FIFO might be created before it's used.

jleightcap commented 2 years ago

potential solutions, or at least seeing if this is a problem:

cnorthway commented 2 years ago

fixed in 2396c31d7a8d3af9dce269213c8f1af459185a87, factored out FIFO creation into a separate step in init