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

Parser IO error is ignored if map include is a directory #7043

Open
PPazderski opened this issue Mar 7, 2024 · 0 comments
Open

Parser IO error is ignored if map include is a directory #7043

PPazderski opened this issue Mar 7, 2024 · 0 comments

Comments

@PPazderski
Copy link
Contributor

PPazderski commented Mar 7, 2024

If map file parsing fails with an IO error this error is (at least sometimes; maybe always) ignored.

This issue is not very sever because often some other code will report an error instead. I found only one path were a read error from the parser is fully ignored.

See emptyinclude.zip for a minimal example. It has an INCLUDE with empty argument which basically is the same as if the argument is './'.
For this issue it is only relevant that the include file is actually a directory.

If the include file cannot be opened for any reason the lexer will report an error but a directory can be opened but the next read in the YY_INPUT macro will set an error.
But this error is more or less ignored and processing continues and if the include file is not essential for the map file it will report no error at all.

I assume this is related to 05d44e6. I had some crashes with empty INCLUDE arguments in version 8.0.0 and while I tried to find the reason I stumbled upon this. I could not reproduce my crashes with the latest version anymore.

The example I provided shows that the lexer calls msSetError -- it can be seen with debug enabled -- but without debug enabled nothing indicates a problem.

Because it no longer crashes I don't care whether this bug (if you see it as bug at all) is fixed or ignored.

emptyinclude.zip

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

1 participant