ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.81k stars 17.27k forks source link

AP_Param: Setting the maximum value of AP_INT32 causes SIGFPE exception #20784

Open muramura opened 2 years ago

muramura commented 2 years ago

Bug report

Issue details Please describe the problem

In SITL, I set BRD_SERIAL_NUM to the maximum AP_INT32 value of 2147483647, which caused a SIGFPE exception.

Version What version was the issue encountered with

ArduCopter V4.3.0-dev (1090a881)

Platform [X] All [ ] AntennaTracker [ ] Copter [ ] Plane [ ] Rover [ ] Submarine

Airframe type What type of airframe (flying wing, glider, hex, Y6, octa etc)

Copter

Hardware type What autopilot hardware was used? (Pixhawk, Cube, Pixracer, Navio2, etc)

SITL

Logs Please provide a link to any relevant logs that show the issue

GDB Screenshot from 2022-05-18 07-26-48

GCS Screenshot from 2022-05-18 07-26-35

hendjoshsr71 commented 2 years ago

Anything above 24-bits is not guaranteed to work.

See the comment here from the PR of yours. https://github.com/ArduPilot/ardupilot/pull/19854#issuecomment-1020276604

I did check on CubeOrange with INT32_MAX and of course the 2^24 limits set in the new parameter description. Neither crashed.

For the SITL side I only had issues very close to INT32_MAX.

Not sure what we can do about it?

muramura commented 2 years ago

ardupilot is suppressing stm32 exceptions and will continue processing. The value of the explanation was ok for me too.