Mavsdk: mavsdk_server crashes when a geofence is uploaded

Created on 3 Oct 2019  路  8Comments  路  Source: mavlink/MAVSDK

mavsdk_server gets a segmentation fault when uploading a geofence over gRPC.

Steps to reproduce:

  1. Build mavsdk_server from #870.
  2. Checkout MAVSDK-Python into the python geofence PR
  3. Run jmavsim and the mavsdk_server built in 1 above.
  4. Run examples/geofence.py in MAVSDK-Python fetched in 2 above.
  5. The geofence is uploaded successfully, but mavsdk_server crashes.

@coderkalyan: Would you mind having a look at this? :blush:.

bug

All 8 comments

@JonasVautherin Sorry I forgot about this. I will look into it ASAP. I was having trouble recreating the error, but now that my friend bbworld1 is having the same problem I have something to go off of.

@coderkalyan I've been debugging that, and my observation is that the callback given to send_geofence_async(...) is called twice: once with result Success, and another time with result Timeout (which doesn't make sense to me if it succeeded before).

mavsdk_server crashes on the second call (with Timeout), because it expects the callback to be called exactly once.

Would you mind investigating why the timeout is called after a Success result is sent?

More specifically, the mission plugin unregisters the timeout on receive_command_result, and maybe this mechanism is missing in the geofence plugin :thinking:.

It could be that it is something stupid in the geofence plugin with all the callbacks and locks happening there. I'm planning to refactor the mission and geofence plugin to clean these up, hopefully next week.

@julianoes please keep me updated when you're done with that, so I can add the changes to this!

I'm working on it: #964.

@julianoes Does your refactoring change anything about geofence that I should know about? Still trying to fix this PR.

@JonasVautherin any suggestions are appreciated, I still can't find the source of the problem :(

@coderkalyan good question. I would have to look into it and try it out.

@julianoes This can be closed, I think, the autogenerated backend from the latest release has AFAIK solved the problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yusufozben picture yusufozben  路  4Comments

hamishwillee picture hamishwillee  路  5Comments

hamishwillee picture hamishwillee  路  6Comments

uccsoft picture uccsoft  路  7Comments

julianoes picture julianoes  路  3Comments