mavsdk_server gets a segmentation fault when uploading a geofence over gRPC.
Steps to reproduce:
mavsdk_server from #870.mavsdk_server built in 1 above.examples/geofence.py in MAVSDK-Python fetched in 2 above.mavsdk_server crashes.@coderkalyan: Would you mind having a look at this? :blush:.
@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.