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

Addresses open file handles when parse errors occur in include files (Issue #5942) #6050

Merged
merged 11 commits into from Jul 21, 2020

Conversation

sdlime
Copy link
Member

@sdlime sdlime commented Apr 15, 2020

No description provided.

@jmckenna jmckenna added the backport branch-7-6 To backport a pull request to branch-7-6 label Apr 15, 2020
@rouault
Copy link
Contributor

rouault commented Apr 15, 2020

An addition in msautotest might be useful

@sdlime
Copy link
Member Author

sdlime commented Apr 16, 2020

A specific test would need to take the form of something that would show the number of open file handles after a process closed. I'm not sure how that would be done or how it could be included in the test suite.

@rouault
Copy link
Contributor

rouault commented Apr 16, 2020

A specific test would need to take the form of something that would show the number of open file handles after a process closed

I had presumed that the CI config that runs with Address Sanitizer enabled (PHP_7.2_WITH_ASAN) would warn about unclosed files as a memory leak, but on a small test case, I see this isn't the case unfortunately. Valgrind can see this with --leak-check=full --show-leak-kinds=all however

==27735== 552 bytes in 1 blocks are still reachable in loss record 1 of 1
==27735==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27735==    by 0x4EA7CDC: __fopen_internal (iofopen.c:69)
==27735==    by 0x40053C: main (leak.c:4)

However I think there's still a merit in having such a test case: at least this makes sure that the error code paths are hit and don't cause crash (I'm sure they don't now :-), but it might if someone later touches it)

@sdlime
Copy link
Member Author

sdlime commented Apr 16, 2020 via email

@sdlime sdlime requested a review from dmorissette April 23, 2020 14:10
@sdlime
Copy link
Member Author

sdlime commented May 11, 2020

Bump, @dmorissette or @alexbrault, do you have time to test this fix? --Steve

@jmckenna
Copy link
Member

No response on testing, but am merging this now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport branch-7-6 To backport a pull request to branch-7-6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants