Repository navigation
Conversation
dba_close() looked up the persistent entry with connection->info after dba_close_connection() had cleared it, so the entry was never removed and the database file and its lock stayed held. Count the connections on the entry's refcount again, as PHP 8.3 did, and close the handle when dba_close() releases the last one, unless another persistent handle to the same file shares its stream. Lock conflict checks now also see persistent handles still in use, since closing one of two connections with the same key removed the other's DBA_G(connections) entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dba_close()never closed adba_popen()connection: it looked up the persistent entry afterdba_close_connection()had clearedconnection->info, so the file and its lock stayed held until shutdown.Connections now count on the entry's refcount, as in PHP 8.3, so the last
dba_close()closes the handle. A handle whose stream another persistent handle shares (modesrlandrdon one file) stays open, as today. Lock checks also see persistent handles in use, which closing a second connection with the same key used to hide.Found from Girgias's comment on php#25155. Red/green with flatfile, inifile and cdb; dba015.phpt and the new test pass under valgrind.