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

[Bug] 100% CPU from LOG_REQUEST_LIST #22998

Open
dakejahl opened this issue Apr 10, 2024 · 1 comment
Open

[Bug] 100% CPU from LOG_REQUEST_LIST #22998

dakejahl opened this issue Apr 10, 2024 · 1 comment

Comments

@dakejahl
Copy link
Contributor

dakejahl commented Apr 10, 2024

Describe the bug

When receiving a LOG_REQUEST_LIST message the CPU will peg at 100% in mavlink_receiver. I did a little bit of debugging and it appears that this is happening inside of the _mavlink_log_handler.send() function within the mavlink_receiver.cpp main loop.

_init_list_helper(): takes 300ms
_get_entry(): takes variable amount of time depending on how many logs you have. It takes roughly 5 seconds to send out 171 log entries, at which point mavlink_receiver is blocking and hogging CPU.

To Reproduce

Send LOG_REQUEST_LIST

Expected behavior

Doesn't hog CPU

Screenshot / Media

image

Flight Log

https://review.px4.io/plot_app?log=e8d4f344-0f1d-4358-afbe-498d235ac71c

Software Version

main

Flight controller

ark_fmu-v6x_default

Vehicle type

None

How are the different components wired up (including port information)

No response

Additional context

No response

@muramura
Copy link
Contributor

I am using PIXHAWK6X-RT.
It reboots after downloading a 370 megabyte log file.
The transfer rate was 900 kilobytes/second, so I set the maximum bytes from 256 to 1024 kilobytes and it did not reboot.

The PIXHAWK6X-RT has a 1 GHz MPU.

CPU load is 50% during download, usually in the 26% range.

Screenshot from 2024-04-21 13-35-06

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

No branches or pull requests

2 participants