Project

General

Profile

Actions

Bug #79955

closed

Warning in SessionService Length parameter must be greater than 0

Added by Georg Ringer about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
Start date:
2017-02-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:
Stabilization Sprint

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

Actions #1

Updated by Timo Hund about 7 years ago

  • Assignee set to Timo Hund

I'll have a look at this

Actions #2

Updated by Timo Hund about 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.

Actions #3

Updated by Gerrit Code Review about 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

Actions #4

Updated by Gerrit Code Review about 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

Actions #5

Updated by Gerrit Code Review about 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

Actions #6

Updated by Timo Hund about 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF