Current Behavior
When using PHP Xdebug for development purpose, logging-in or signing-up with a non-admin user (e.g. a newly created one) I get the following warning and xdebug stops the thread:
[Thu Dec 15 13:11:09 2022] PHP Warning: Uncaught Error: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '200' frames in /home/nicolas/Source/www/flarum/vendor/illuminate/collections/Traits/EnumeratesValues.php:981
Disabling Xdebug (e.g. with sudo phpdismod xdebug
) allows the script to continue and eventually display the page.
I would like to be able to use Xdebug while developing Flarum extension.
It seems Xdebug is wrong with its assumption about a possible infinite loop, but it may however still be a performance problem to have such deep stack nesting.
Here is the full log of the error: xdebug_possible_infinite_loop_200_frames.log
Steps to Reproduce
On a Debian based Linux distribution, assuming a working fresh install of Flarum (with mailer configured):
-
make sure php-xdebug
installed and enabled
sudo apt install php-xdebug
sudo phpenmod xdebug
-
run server then visit http://localhost:8080
php -S localhost:8080 -t public
-
sign up a new user
-
get the above PHP Xdebug error
-
disable Xdebug then restart server
sudo phpdismod xdebug
-
refresh the page and now everything is working
Expected Behavior
Being able to use Xdebug while developing Flarum extensions.
Screenshots
No response
Environment
- Flarum version: 1.6.2
- Website URL: http://localhost:8080
- Webserver: PHP Built-in web server
- Hosting environment: local machine
- PHP version: PHP 8.1.12 (cli)
- Browser: Mozilla Firefox 107.0.1
Output of php flarum info
Flarum core 1.6.2
PHP version: 8.1.12
MySQL version: 10.6.10-MariaDB-1+b1
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, intl, exif, mysqli, pdo_mysql, pdo_sqlite, Phar, posix, readline, shmop, SimpleXML, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, Zend OPcache, xdebug
+----------------------+---------+--------+
| Flarum Extensions | | |
+----------------------+---------+--------+
| ID | Version | Commit |
+----------------------+---------+--------+
| flarum-flags | v1.6.1 | |
| flarum-approval | v1.6.1 | |
| flarum-tags | v1.6.1 | |
| flarum-suspend | v1.6.1 | |
| flarum-subscriptions | v1.6.1 | |
| flarum-sticky | v1.6.1 | |
| flarum-statistics | v1.6.1 | |
| flarum-mentions | v1.6.1 | |
| flarum-markdown | v1.6.1 | |
| flarum-lock | v1.6.1 | |
| flarum-likes | v1.6.1 | |
| flarum-lang-english | v1.6.0 | |
| flarum-emoji | v1.6.1 | |
| flarum-bbcode | v1.6.0 | |
+----------------------+---------+--------+
Base URL: http://localhost:8080
Installation path: /home/nicolas/Source/www/flarum
Queue driver: sync
Session driver: file
Mail driver: smtp
Debug mode: ON
Don't forget to turn off debug mode! It should never be turned on in a production system.
Possible Solution
No response
Additional Context
No response
type/bug