News for hackers. Stuff that matters.
Re:Poll on macOS 10.12 is broken by gpderetta on Tuesday October 11, 2016 @08:36AM (#12683759)
The worst part is that sometimes in the past OSX had actually passed Unix conformance. It only shows that those conformance tests are worth nothing.

edit: iOS->OSX

Re:Poll on macOS 10.12 is broken by geofft on Tuesday October 11, 2016 @10:17AM (#12684543)
macOS still does pass conformance tests, apparently. Or at least has a license to the UNIX trademark. http://www.opengroup.org/openbrand/register/apple.htm

I wonder if the Open Group will accept a bug report? From http://www.opengroup.org/openbrand/ : "Anyone buying a Registered Product is guaranteed that: The product conforms to the identified Product Standard. ... The product will continue to conform. ... Any conformance problem will be fixed within the prescribed timescale."

The poll issue is a clear violation of the UNIX spec. http://pubs.opengroup.org/onlinepubs/7908799/xsh/poll.html

Re:Poll on macOS 10.12 is broken by gpderetta on Tuesday October 11, 2016 @11:53AM (#12685542)
To be honest, I'm not 100% sure this poll issue violates the the letter of the standard, although possibly the spirit. Per POSIX, fds must point to an array of pollfds, passing null is a precondition violation and POSIX explicitly says that is UB.
Re:Poll on macOS 10.12 is broken by JdeBP on Tuesday October 11, 2016 @06:47PM (#12689141)
Ironically, given all of the commentary about whether it's conformant for an array passed to a function to have NULL as its starting address, that is not actually the bug here. The bug, as indirectly explained by the headlined article, is actually to do with the array length being zero.
Re:Poll on macOS 10.12 is broken by gpderetta on Tuesday October 11, 2016 @08:00PM (#12689472)
Possibly, but that's not what' exercised by the minimal test case, supposedley demonstrating the issue in the article.

Returning immediately with a non null fds, a zero lenght and non zero timeout is unarguably a bug.

Re:Poll on macOS 10.12 is broken by JdeBP on Tuesday October 11, 2016 @11:40PM (#12690292)
The array length is zero in that code.
Re:Poll on macOS 10.12 is broken by gpderetta on Wednesday October 12, 2016 @04:17AM (#12691166)
which is irrelevant, as the null pointer passed to poll triggers UB before the length of the array enters into the picture.
Re:Poll on macOS 10.12 is broken by JdeBP on Wednesday October 12, 2016 @10:57AM (#12693413)
To repeat: The NULL pointer is not the locus of the bug, and this was explained by the detailed discussion from the headlined article. The NULL pointer for the array base is passed to copyin() and copyout() without incident, and those are its only uses by poll().
Re:Poll on macOS 10.12 is broken by gpderetta on Wednesday October 12, 2016 @11:09AM (#12693539)
To repeat: my point is that the test case shown in the article and described in the bug cannot be used to reliably identify a broken poll as passing NULL for fds is, strictly speaking, UB.

I'm not making any claim about the actual source of the poll bug here.

Re:Poll on macOS 10.12 is broken by JdeBP on Tuesday October 18, 2016 @10:54AM (#12734990)
At https://news.ycombinator.com/item?id=12689472 that's exactly what you stated, and you were wrong. The test case has a zero length array; that it what it is exercising; and that is the locus of the bug, as the headlined article's detailed discussion makes clear.
Re:Poll on macOS 10.12 is broken by Tepix on Tuesday October 11, 2016 @09:30AM (#12684165)
What does iOS have to do with this?
Re:Poll on macOS 10.12 is broken by gpderetta on Tuesday October 11, 2016 @09:51AM (#12684330)
sorry I meant OSX obviously.