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

A bug which results in throwing "out_of_range" exception #2138

Closed
lipeng28 opened this issue Dec 11, 2017 · 2 comments
Closed

A bug which results in throwing "out_of_range" exception #2138

lipeng28 opened this issue Dec 11, 2017 · 2 comments

Comments

@lipeng28
Copy link

Hi Sergio

Baidu X-Lab found a bug which results in throwing "'std::out_of_range'" exception, please see the attachment for your reference.

bug2.zip

Best,
Peng

@SergioRAgostinho SergioRAgostinho added the needs: code review Specify why not closed/merged yet label Dec 11, 2017
@taketwo
Copy link
Member

taketwo commented Jan 27, 2018

The PCD file is clearly malformed. @SergioRAgostinho what do you think? Is it okay to throw if a bad file is given?

#@.PON 0.7
FIELDS x y z
SIZE 4 4 4
TYPE F F F
COUNT 1 1 1
WIDTH POINT 0 0 0 0 0
POINTS 51
DAT000001 0
0.31 -0.01010880423

@SergioRAgostinho
Copy link
Member

In general, the things Peng "throws at us" are intentionally corrupted PCDs. I have the idea that they're using PCL for their Apollo project and they're "stress testing" PCL against potentially bad inputs from their users.

In the two other bug submissions I worked on, the idea was to detect that the PCD header is malformed as early as possible, abort and return an error, to prevent throwing exceptions down the road. That has been my mindset so far.

Therefore it's not ok let it go all the way up to the "'std::out_of_range'" exception mentioned, assuming that there's of course a way to detect in advance that the file is malformed.

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

No branches or pull requests

3 participants