We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
AP_MSP::loop
Issue details
While some detailed build configuration, There are potential stack overflow in thread function named AP_MSP::loop.
ardupilot/libraries/AP_MSP/AP_MSP.cpp
Lines 114 to 121 in 92693e0
In this line, AP_MSP::loop Allows 1024 stack size.
However, after manually checking stack, it might have 1096 Bytes in with some detailed configurations.
Steps to reproduce Step to reproduce is quite same as #28374 and #27937
boards.py
# In 224 line.. env.CFLAGS += [ ++ '-fstack-usage', '-ffunction-sections', '-fdata-sections', '-fsigned-char', ... # In 343 line... env.CXXFLAGS += [ ++ '-fstack-usage', '-std=gnu++11', '-fdata-sections',
This will help you automatically calculating stack size of each function.
./waf configure --board r9pilot -g --check-verbose --disable-Werror --toolchain=arm-none-eabi --notests --enable-scripting --enable-opendroneid --enable-check-firmware --enable-custom-controller --enable-gps-logging --enable-header-checks --enable-stats ./waf -v copter
Now we can get stack usage file (*.su) for each source file, So we can manually check stack size of each function.
In case of AP_MSP::loop:
There are large call stack with this flow:
AP_MSP::loop() => 32 byte AP_MSP_Telem_Backend::hide_osd_items() => 64 byte AP_MSP_Telem_Backend::get_rssi => 8 byte AP_RSSI::read_receiver_rssi => 8 byte AP_RSSI::read_pwm_pin_rssi => 8 byte AP_HAL::PWMSource::set_pin => 40 byte GCS::send_text => 0 byte GCS::send_textv => 160 byte GCS::service_statustext => 24 byte GCS_MAVLINK::service_statustext => 120 byte _mav_finalize_message_chan_send => 88 byte mavlink_sign_packet => 136 byte mavlink_sha256_update => 416 byte => SUM: 1096
So, there are potentially occur stack overflow in AP_SmartAudio::loop Thread function.
AP_SmartAudio::loop
I only check with R9Pilot with copter, but it seems that there are lots of any other configurations that potentially make thread stack overflow.
R9Pilot
copter
Version
Ardupilot latest version (commit 92693e0)
Platform [ ] All [ ] AntennaTracker [ x ] Copter [ ] Plane [ ] Rover [ ] Submarine
Hardware type R9Pilot
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug report
Issue details
While some detailed build configuration, There are potential stack overflow in thread function named
AP_MSP::loop
.ardupilot/libraries/AP_MSP/AP_MSP.cpp
Lines 114 to 121 in 92693e0
In this line,
AP_MSP::loop
Allows 1024 stack size.However, after manually checking stack, it might have 1096 Bytes in with some detailed configurations.
Steps to reproduce
Step to reproduce is quite same as #28374 and #27937
boards.py
, Add this line:This will help you automatically calculating stack size of each function.
Now we can get stack usage file (*.su) for each source file, So we can manually check stack size of each function.
In case of
AP_MSP::loop
:There are large call stack with this flow:
So, there are potentially occur stack overflow in
AP_SmartAudio::loop
Thread function.I only check with
R9Pilot
withcopter
, but it seems that there are lots of any other configurations that potentially make thread stack overflow.Version
Ardupilot latest version (commit 92693e0)
Platform
[ ] All
[ ] AntennaTracker
[ x ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
Hardware type
R9Pilot
The text was updated successfully, but these errors were encountered: