[CDRIVER-1407] /Socket/sendv testfailure on FreeBSD Created: 20/Jul/16 Updated: 03/May/17 Resolved: 20/Jan/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | TBD |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Hannes Magnusson | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Description |
consistently fails on FreeBSD 10.3 with the following backtrace
|
| Comments |
| Comment by Githook User [ 20/Jan/17 ] | ||||||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Fixes a timeout in /Socket/sendv test. The test had wrongly assumed that a sendv timeout set socket->errno_, | ||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 20/Jan/17 ] | ||||||||||||||||
|
Later in the /Socket/sendv test, both the client and the server threads execute the next step if and only if errno is set to EAGAIN or EINPROGRESS after a non-blocking call to sendmsg or recv. However, they have no right to expect that errno is set: the test has been passing on Linux and Mac because it was a previous call to accept() (in the server thread) or connect (in the client thread) that has set errno, and errno isn't cleared afterward. On FreeBSD, since accept / connect don't set errno in this test, the test doesn't make progress when it checks errno later, and it times out. | ||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 19/Jan/17 ] | ||||||||||||||||
|
The attached poll-test.c does roughly the same startup steps as /Socket/sendv. It starts a thread to listen on localhost:4321 and, on the main thread, connects to localhost 4321. On Mac it prints:
On FreeBSD 11:
On Mac, connect sets errno to EINPROGRESS, but not on FreeBSD. The difference in connect() behavior to localhost is I think the root cause of the test failure. | ||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 17/Jan/17 ] | ||||||||||||||||
|
Reproduced on a FreeBSD-11 vagrant box. | ||||||||||||||||
| Comment by Hannes Magnusson [ 19/Dec/16 ] | ||||||||||||||||
|
We don't have any FreeBSD instances to properly test and debug this on for the moment. |