-
Notifications
You must be signed in to change notification settings - Fork 9
Description
For some reason, the change on this line in the CAN FD PR is causing an invalid argument error (errno 22) to be thrown when drain(int fd) is called while creating a socket. This crash only seems to happen if there are no nodes present on the bus at startup. I'm also not using a CAN-FD compatible device, which is likely causing this crash.
I think it could make sense to add a paramter to the function for whether or not an FD frame should be read, since the size of the frame structs is different for a regular CAN frame vs an FD frame.
Debug Findings:
-
After further testing, that line doesn't seem to be the exact cause of the issue, it seems to be a bit inconsistent on when the error is happening. I'll try and look into it as much as I can (I have limited knowledge on the low level CAN socket APIs), but this seems like a strange but important issue to resolve
-
It also looks like if I initially open the socket with a node connected, and later on disconnect the node, and restart the socket (close and reopen) while the node is disconnected, it doesn't seem to run into any issues
-
If I add the previously mentioned line in a "retry" block, it succeeds 100% of the time after 2 tries