Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mavsdk_server crashes when a geofence is uploaded #871

Closed
JonasVautherin opened this issue Oct 3, 2019 · 8 comments
Closed

mavsdk_server crashes when a geofence is uploaded #871

JonasVautherin opened this issue Oct 3, 2019 · 8 comments
Labels

Comments

@JonasVautherin
Copy link
Collaborator

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

Steps to reproduce:

  1. Build mavsdk_server from Enable geofence in mavsdk_server #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? 😊.

@coderkalyan
Copy link
Contributor

@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.

@JonasVautherin
Copy link
Collaborator Author

JonasVautherin commented Jan 24, 2020

@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 🤔.

@julianoes
Copy link
Collaborator

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.

@coderkalyan
Copy link
Contributor

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

@julianoes
Copy link
Collaborator

I'm working on it: #964.

@coderkalyan
Copy link
Contributor

@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 :(

@julianoes
Copy link
Collaborator

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

@coderkalyan
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants