Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.5.0
-
dd06d036616b3f3de852ea51989d9b4944417c1c
Description
It seems to be possible to create a lockfile of size 0 which is not deleted in the constructor:
In QLockFilePrivate::tryLock_sys() qt_safe_open can succeed and the subsequent can qt_write_loop can fail. As a result t->isLocked will stay at 'false' (that's correct), but the 'unlock' in the destructor will return early without removing the empty file.
I believe in addition to the "error = QLockFile::UnknownError; // partition full" line there should be QFile::remove(d->fileName) or similar to clean up.
Attachments
For Gerrit Dashboard: QTBUG-44771 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
107600,5 | QLockFile: Avoid zero-sized lock file on write error | 5.5 | qt/qtbase | Status: MERGED | +2 | 0 |
110346,6 | QLockFile: fix deadlock when the lock file is corrupted | 5.4 | qt/qtbase | Status: MERGED | +2 | 0 |
125659,3 | QLockFile: sync to disk to avoid leaving an empty lock file on crash | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |