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

Issue with Master_vehicle crash #11408

Closed
Tony3dr opened this issue Feb 7, 2019 · 7 comments · Fixed by #11411 or #11415
Closed

Issue with Master_vehicle crash #11408

Tony3dr opened this issue Feb 7, 2019 · 7 comments · Fixed by #11411 or #11415

Comments

@Tony3dr
Copy link

Tony3dr commented Feb 7, 2019

Today we tested Master v1.9.0 (beta) (7f3b170) with the Pixracer, Pixhawk 4 mini, Pixhawk 4. Created mission. The vehicle armed good, took off. At 30 meters the vehicle started spinning and came down to the ground. Resulted in a crash. Same behavior for all 3 platforms.

Steps to reproduce the behavior:

  1. Uploaded mission
  2. Drone switched on
  3. Vehicle armed
  4. Took off
  5. Elevated to 30 meters
  6. vehicle started spinning out of control
  7. The vehicle came down and crashed

Pixracer:
https://review.px4.io/plot_app?log=4f0c2692-5f27-4d83-bfbd-765bf48a989e

Pixhawk 4 Mini:
https://review.px4.io/plot_app?log=53fa724b-906d-4e93-87fe-5a4f4c2a50b8

Pixhawk 4:
https://review.px4.io/plot_app?log=69f42b00-6259-4a97-96c1-bd8f06b4d29d

@dagar

@mhkabir
Copy link
Member

mhkabir commented Feb 7, 2019

Potentially #11376

@dagar
Copy link
Member

dagar commented Feb 7, 2019

Wow, ouch. Looking.

@dagar dagar added this to the Release v1.9.0 milestone Feb 7, 2019
@dagar dagar self-assigned this Feb 7, 2019
@dagar
Copy link
Member

dagar commented Feb 8, 2019

In both cases (fmu-v4 and fmu-v5) the pc points to math::max (mathlib/math/Limits.hpp:72) called from navigator MissionBlock::get_time_inside().

https://github.com/PX4/Firmware/blob/c3d6a042e6332792fe85a1121c08fefa7dbfcb43/src/modules/navigator/mission_block.cpp#L480-L491

I think the problem is passing the reference of a packed struct (mission_item) member to the template function. Taking a closer look...

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77388

@dagar
Copy link
Member

dagar commented Feb 8, 2019

This is easy enough to fix once off, but I'm looking for a most exhaustive solution (compiler warning perhaps) otherwise we'll need to be careful around anything packed (mission items, mavlink in general).

https://stackoverflow.com/questions/8568432/is-gccs-attribute-packed-pragma-pack-unsafe/8568441#8568441

@dagar
Copy link
Member

dagar commented Feb 8, 2019

Newer gcc has -Waddress-of-packed-member.

@dagar
Copy link
Member

dagar commented Feb 8, 2019

WIP fixes in #11411

@dagar
Copy link
Member

dagar commented Feb 8, 2019

We need to do a quick pass of packed structure usage looking for anything that might take the address of a member, create a reference, or pass it into a function that does.

This includes navigator (mission_item), mavlink (anything from the mavlink spec), and a few drivers.

dagar added a commit that referenced this issue Feb 8, 2019
 - cleanup Limits.hpp
 - add -Waddress-of-packed-member where available
 - fixes #11408
dagar added a commit that referenced this issue Feb 8, 2019
 - cleanup Limits.hpp
 - add -Waddress-of-packed-member where available
 - fixes #11408
dagar added a commit that referenced this issue Feb 8, 2019
 - cleanup Limits.hpp
 - add -Waddress-of-packed-member where available
 - fixes #11408
dagar added a commit that referenced this issue Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment