ArduPilot / ArduPilot/ardupilot
thread unsafe use of `errno` under networking and filesystem
- Dominant language
- C++
- Stars
- 15.9k
- Forks
- 21.4k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 119
Description
## Bug report
**Issue details**
`errno` global variable is being used in Ardupilot in multithreaded context. The issue was discovered while connecting to Mission Planner to CubeRed over Network and it occasionally getting spurious errno EWOULDBLOCK at the end of Param download over FTP. This results in the Mission Planner falling back to legacy param download. This is one of the symptoms of using `errno` like this. There are possibly other unexpected behaviours that can be expected while doing file operations from different threads, e.g. FS calls from Lua Scripts.
**Version**
ArduPilot 4.6 with Networking enabled
**Platform**
[ x ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
**Hardware type**
CubeRed
Contributor guide
Research direction
Start by tracing errno usage in the networking and filesystem paths involved in the FTP parameter download, then reproduce the issue with networking enabled on the reported setup. Done means concurrent filesystem and network operations no longer produce spurious EWOULDBLOCK results or force the Mission Planner fallback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot, networking, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100