Bug #79955
closedWarning in SessionService Length parameter must be greater than 0
100%
Description
Getting the error
#1476107295: PHP Warning: fread(): Length parameter must be greater than 0 in /app/vendor/typo3/cms/typo3/sysext/install/Classes/Service/SessionService.php line 392 (More information)
however don't really know how to reproduce
Updated by Timo Hund over 7 years ago
I had a look at this issue and figured out the following:
1. The error happens when somehow :D an empty session file is generated in "typo3temp/var/InstallToolSessions/<sessionFolder>/hash_<sessionName>
I would say a fix should be to check if result of filesize is not 0 and not false:
$length = filesize($sessionFile); if(!empty($length)) { $content = fread($fd, $length); }
What i currently don't understand, how this could happen. One possible reason is that for example the write method is
interrupted between "ftruncate" and "fwrite" which would result in a left empty file. If you force this by terminating the write process randomly at that point you have the desrcibed problem. Once an empty session file is there you continuesly have this error message in the install tool. By now i did not find another way to reproduce this.
Another way to force the error is to just truncate the file on the filesystem.
Updated by Gerrit Code Review over 7 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51835
Updated by Gerrit Code Review over 7 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51835
Updated by Gerrit Code Review over 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51835
Updated by Timo Hund over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 653e22f648a8a0f13f92271c5abe7fb895d388c6.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed