PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

[Sponsored by CubePilot] Try to fix potential mavlink segfaults on USB disconnect

Open julianoes opened this issue 2 weeks ago • 1 comments

This is an attempt at fixing the segfaults we sometimes see when disconnecting USB and stopping the mavlink instance.

There are reports in various places:

  • https://discuss.px4.io/t/hard-fault-when-switching-comms-link/47382
  • https://github.com/PX4/PX4-Autopilot/issues/12502
  • https://github.com/PX4/PX4-Autopilot/issues/19798
  • https://github.com/PX4/PX4-Autopilot/issues/12502
  • https://github.com/PX4/PX4-Autopilot/issues/22239
  • https://github.com/PX4/PX4-Autopilot/issues/24436

Eventually, we still need to refactor the threading mess, of course.

julianoes avatar Dec 11 '25 02:12 julianoes

I wish I could answer your questions. It happens enough to come up again and again, last with 1.15.4, so it might be fixed in the meantime.

And I couldn't reproduce it on the bench yet, unfortunately. I tried for a few hours. That being said, I think the fixes are not wrong, and won't make it worse.

julianoes avatar Dec 11 '25 06:12 julianoes

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/hard-fault-when-switching-comms-link/47382/12

DronecodeBot avatar Dec 13 '25 20:12 DronecodeBot