Hi since couple of day I introspect a bug that my application have on specifically on MacM1. All of this is code in C on a Mac Monterey (begun on Big Sure but updated recently).
In nutshell we allow user to send some custom command to OS. In practice what does we do: Create 2 pair pipe (and a thirds one for error but not pertinent here).
input parent were the command will be wrote -> output child where the command will read the command. input child where we the child will wrote the output of command-> output parent where we will read the return value.
We configure them with "close on exec", "non blocking", "asynchronous" and "FIOSETOWN" raise a signal when data are ready.
Forking send the command from child. And then we wait in parent with poll that data is ready in output parent. And this pattern work like a charm on all of our supported platform (including mac x64 Monterey with xcode 14 and an Unix A64v8). But on Mac M1 (tested on big sure, Monterey with xcode 13 an 14), it look like poll never go in state "some datas are ready to be read", even when there are datas ready to read.
One of the possible conflict that I can see here, is that our application heavily use SIGIO for other purpose that force us to ignore the EINTR error and just wait that poll successfully return. if that poll basically return the EINTR error as the File descriptor signal the interrupt before poll returning, but the next poll should be instantaneous and success as the data are still ready. So I assume that not the issue here.
But there are probably something that I miss. So here is some questions, are there any significant known difference between poll() on x64 or x86, and m1 ?
Are there some known issue with poll behaviours on MacM1 ?
What can we possibility miss here ?