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

Segmentation fault / freezing under heavy CPU load #305

Closed
pritzvac opened this issue Feb 9, 2023 · 2 comments · Fixed by #306
Closed

Segmentation fault / freezing under heavy CPU load #305

pritzvac opened this issue Feb 9, 2023 · 2 comments · Fixed by #306
Labels
bug Something isn't working

Comments

@pritzvac
Copy link

pritzvac commented Feb 9, 2023

I'm running OpenVINS on ROS1 with stereo data from the RealSense T265 camera. I experienced sporadic crashing / freezing of the VIO under heavy CPU load.

According to GDB, sometimes a segmentation fault happens at

for (const auto &clone_imu : _clones_IMU) {
(and sometimes the VIO freezes with one of the threads being in the same location). I assume some elements are deleted from the _clones_IMU map by another thread while iterating over it.

Segmentation fault:
Selection_126

Backtrace:
Selection_125

I added mutex locks before the for cycle

for (const auto &clone_imu : _clones_IMU) {
and before the marginalization and element removal in
StateHelper::marginalize(state, state->_clones_IMU.at(marginal_time));
where I assume the elements are being deleted from the map. So far it seems to have fixed the issue (I'm testing it by running OpenVINS along with CPU and fileio benchmarks using sysbench). Should I submit a pull request?

@goldbattle goldbattle added the bug Something isn't working label Feb 14, 2023
@goldbattle
Copy link
Member

Yeah, if you are able to. I need to think a bit more about how to elegantly solve this, but I think your fix would solve things.

@pritzvac
Copy link
Author

Ok, I made the pull request. I tested it on some rosbag from the euroc dataset running along with the CPU benchmark as well and it seems to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants