Details
Description
Our projects sends errors returned from the QSaveFile::commit to Crashlytics as Non-fatal events and we see small amount of "Interrupted system call" from our android users.
QSaveFile::commit calls fsync without retrying the call if it fails with EINTR:
https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/io/qfsfileengine_unix.cpp#n186
Posix programming manual includes EINTR in a list of posible errors of fsync:
https://linux.die.net/man/3/fsync
Looks like QFSFileEnginePrivate::nativeSyncToDisk unix implementation misses proper handling of the EINTR.
P.S. We do use fsync directly in our code base and the same monitoring shows that android implementation of fsync do fails with EINTR. Retrying fsycn on EINTR fixes this issue.
Attachments
For Gerrit Dashboard: QTBUG-66268 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
219489,2 | QSaveFile: Check for EINTR in fsync()/fdatasync() | 5.10 | qt/qtbase | Status: MERGED | +2 | 0 |
458138,1 | QSaveFile: Check for EINTR in fsync()/fdatasync() | 6.5 | qt/qtbase | Status: ABANDONED | 0 | 0 |