PHP error in logs
After upgrading to 2.5.0-DEVELOPMENT (amd64) built on Mon Oct 21 20:52:27 EDT 2019 I get the following warning on the dashboard:
pfSense has detected a crash report or programming bug. Click here for more information.
I've attached the log file.
#1 Updated by Jim Pingle 5 months ago
- Category set to Gateway Monitoring
- Assignee set to Jim Pingle
- Target version set to 2.5.0
I've seen that happen before. Looks like a race condition of some sort since there is a test just before that checking for the file, and touch should create a file if it doesn't already exist. I've never seen a problem come from it, just the error, so it's just something we can suppress.
#3 Updated by Nano Caiordo 5 months ago
It might be a permission issue, php docs about file_exists() states:
"The check is done using the real UID/GID instead of the effective one."but the file is probably created using the "effective one". Would the more appropriate is_file() be a workaround to skip the permission issue?
#4 Updated by Jim Pingle 5 months ago
If that were the case it would happen to everyone all the time, which isn't true. Also the order of operations is backwards compared to your theory. In the code, the file tested to see if it does not exist before it is touched -- touching a file that doesn't exist will create a new/empty file, and if the file exists it updates the time. Which is why it sounds more like a race condition where several processes have been triggered at once, and the file is somehow removed while
touch() is in the middle of working on it.