php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80128 trigger_error produces 255 exit code
Submitted: 2020-09-21 08:34 UTC Modified: 2020-09-21 12:24 UTC
From: php at shyim dot de Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 8.0.0beta4 OS: NixOs
Private report: No CVE-ID: None
 [2020-09-21 08:34 UTC] php at shyim dot de
Description:
------------
I am currently testing our Software on PHP 8. Anything seems to work, but the CLI Installer fails. I did some debugging using var_dump and searching which line produces the 255 exit code without message. It was always the trigger_error calls.
When I remove from the entire project all trigger_error calls, the installation step works.



Test script:
---------------
Unfortunately I don't know what causes it. But when you run our Installer (MySQL Database needed) it crashes always. See install.sh to how to execute the installer.

Github Repository: https://github.com/shyim/php8-bug-trigger-error

Expected result:
----------------
The Installer works runs with exit code 0. And a recovery/install/data/install.lock file exists

Actual result:
--------------
The trigger_error triggers 255 exit code without message.
Example: https://github.com/symfony/form/blob/v4.4.13/DependencyInjection/FormPass.php#L100

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-21 10:50 UTC] requinix@php.net
-Status: Open +Status: Feedback -Package: Reproducible crash +Package: *General Issues
 [2020-09-21 10:50 UTC] requinix@php.net
Use an actual debugger to step through the code as it hits that trigger_error() call.
 [2020-09-21 11:07 UTC] php at shyim dot de
I am really new to debugging into PHP. You mean with xdebug or something like gdb?
 [2020-09-21 11:13 UTC] requinix@php.net
Xdebug will be easier to work with. Basically every PHP IDE supports it and installation is pretty quick: mostly adding an extension and double-checking some settings. Check your IDE and/or Google for the exact process.

If you know that the FormPass.php line causes it, set a breakpoint for that line and have your IDE run the installer. When PHP gets to that line, you'll "step into" the next call to see what happens. My bet is that execution will move off into an error handler somewhere, but maybe the program will just end at that moment.
 [2020-09-21 12:13 UTC] php at shyim dot de
Could reproduce it now, with a smaller Code Block. There 3v4l

https://3v4l.org/9HAXe
 [2020-09-21 12:23 UTC] php at shyim dot de
Okay I am not sure if that is a real issue, cause display_errors is disabled. Feel free to close, when you think the same :)
 [2020-09-21 12:24 UTC] nikic@php.net
-Status: Feedback +Status: Not a bug
 [2020-09-21 12:24 UTC] nikic@php.net
Please see these UPGRADING entries:
 * https://github.com/php/php-src/blob/4c821cf20668776737272587e7a87876b4fca25e/UPGRADING#L40
 * https://github.com/php/php-src/blob/4c821cf20668776737272587e7a87876b4fca25e/UPGRADING#L60-L79

The right code would be https://3v4l.org/MFGOg

This would be much more obvious if you did not set display_errors=0, that makes it essentially impossible to debug anything.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jul 06 02:03:41 2022 UTC