You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below codes in question found in app/Config/setup.php line 100,101,102
$check_file = fopen($check_constants_filename, "a+");
while (!feof($check_file)) {
$check_line = fgets($check_file);
If fopen() above the while condition returned a false boolean instead of the expected resource stream parameter, it logs this error
PHP Warning: feof() expects parameter 1 to be resource, boolean given in ../app/Config/setup.php on line 101, referer: http://localhost/dashboard
Which because the feof() function is in a while loop condition, it causes an infinite loop that leads to the disk becoming full because of that error being logged in an infinite loop.
IMO fopen() might return false because the file permissions are not configured right, but that doesnt mean orangescrum should fill the whole disk with that error.
I saw this kind of structure in multiple places in the codes. It would be fixed by an if condition before the while loop, checking if fopen() did not return a false boolean.
Let me know if a pull request is welcome, I will be glad to contribute.
Best regards,
The text was updated successfully, but these errors were encountered:
sergeByishimo
changed the title
Infinite while loop error log causes disk to be full
BUG : Infinite while loop error log causes disk to be full
Nov 9, 2022
sergeByishimo
changed the title
BUG : Infinite while loop error log causes disk to be full
Bug : Infinite while loop error log causes disk to be full
Nov 9, 2022
Hi!
Below codes in question found in
app/Config/setup.php
line 100,101,102If
fopen()
above the while condition returned a false boolean instead of the expected resource stream parameter, it logs this errorPHP Warning: feof() expects parameter 1 to be resource, boolean given in ../app/Config/setup.php on line 101, referer: http://localhost/dashboard
Which because the
feof()
function is in a while loop condition, it causes an infinite loop that leads to the disk becoming full because of that error being logged in an infinite loop.IMO
fopen()
might return false because the file permissions are not configured right, but that doesnt mean orangescrum should fill the whole disk with that error.I saw this kind of structure in multiple places in the codes. It would be fixed by an
if
condition before the while loop, checking iffopen()
did not return a false boolean.Let me know if a pull request is welcome, I will be glad to contribute.
Best regards,
The text was updated successfully, but these errors were encountered: