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 in LineReader #72

ppwwyyxx opened this Issue Aug 31, 2018 · 1 comment


None yet
2 participants

ppwwyyxx commented Aug 31, 2018

The LineReader has the following logic at to check whether the file ends with "\n":

                        while(buffer[line_end] != '\n' && line_end != data_end){


                        if(buffer[line_end] == '\n'){
                                buffer[line_end] = '\0';
                                // some files are missing the newline at the end of the
                                // last line
                                buffer[line_end] = '\0';

However this is wrong in the following conditions:

  1. there is a missing "\n" at the end of the last line in the file
  2. buffer[line_end] (which contains uninitialized random memory data) happens to be "\n"

In the above case, data_end is not correctly incremented, and cause an assertion error later.

ppwwyyxx added a commit to facebookresearch/House3D that referenced this issue Aug 31, 2018


This comment has been minimized.


ben-strasser commented Sep 30, 2018

I believe this is fixed with the latest commit. If not, please reopen.

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