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

Enforce check to avoid memory corruption #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danieldugas
Copy link

Ubuntu 16.04, ROS Kinetic.

gmapping kept crashing when I published high resolution laser scans, it took me a while to figure out why.

The cause of the crash was especially hard to find since memory corruption caused the program to terminate much later than where the corruption occured. Finally, we traced it down to this.

if the laserscan has more beams than LASER_MAXBEAMS, the memcpy operation here leads to memory corruption.

Of course, there is an assert a few lines above. However it did not get triggered (is NDEBUG defined somewhere?). I believe this is not specific to me, as I am using the debian distributed ros version of openslam_gmapping.

I'm convinced replacing the assert with an inexpensive if, verbose message, and exit(-1) would be one way to ensure this error does not inconvenience anymore users, though this much is up to you.

Cheers

@k-okada k-okada changed the base branch from master to melodic-devel September 30, 2021 02:12
@k-okada k-okada changed the base branch from melodic-devel to master September 30, 2021 02:13
Copy link
Contributor

@k-okada k-okada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danieldugas could you create new PR against melodic-devel branch? we have switched from master to melodic-branch when we changed licence to BSD

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

Successfully merging this pull request may close these issues.

2 participants