atoum / atoum

The modern, simple and intuitive PHP unit testing framework.
http://atoum.org
Other
1.45k stars 147 forks source link

Erreur extension Xdebug : Maximum function nesting level of '100' reached #78

Closed glonglon closed 12 years ago

glonglon commented 12 years ago

Bonjour, actuellement en pleine implémentation de tests unitaires avec atoum je rencontre quelques sur certaines classes, d'après mes recherches ce serait lié à l'extension Xdebug, voici ci-dessous ma trace d'exécution.


> PHP path: /usr/local/php/bin/php
> PHP version:
=> PHP 5.4.3 (cli) (built: Jun  4 2012 16:48:31) (DEBUG)
=> Copyright (c) 1997-2012 The PHP Group
=> Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
=>     with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans
> tests\units\cgLdap...
[U___________________________________________________________][1/1]
=> Test duration: 0.00 second.
=> Memory usage: 0.00 Mb.
> Total test duration: 0.00 second.
> Total test memory usage: 0.00 Mb.
> Running duration: 2.41 seconds.
Failure (1 test, 0/1 method, 0 failure, 1 error, 0 exception) !
> There is 1 error:
=> tests\units\cgLdap::testGetUtil():
==> Error FATAL ERROR in /Bureau/ProdeliaTests/outilsTests/tests_unit/tests/tuCgLdap.class.php on unknown line, generated by file /                                                                                                          Bureau/ProdeliaTests/gene/include/php/cgErreurs.class.php on line 576:
Maximum function nesting level of '100' reached, aborting!
> There is 1 uncompleted method:
=> tests\units\cgLdap::testGetUtil() with exit code 255:
==> output(4) ""
[root@LampP-caenEMO tests]#

J'ai donc dans un premier temps augmenté drastiquement le "maximum function nesting level" dont la valeur par défaut est à 100 dans mon fichier php.ini, voici ma config de xdebug dans le fichier php.ini :

[xdebug]
zend_extension=/usr/local/php/lib/php/extensions/debug-non-zts-20100525/xdebug.so

xdebug.max_nesting_level=512

Néanmoins à l'exécution le problème persiste, j'atteins quand même la limite des 512, voici ma trace :

> PHP path: /usr/local/php/bin/php
> PHP version:
=> PHP 5.4.3 (cli) (built: Jun  4 2012 16:48:31) (DEBUG)
=> Copyright (c) 1997-2012 The PHP Group
=> Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
=>     with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans
> tests\units\cgLdap...
[U___________________________________________________________][1/1]
=> Test duration: 0.00 second.
=> Memory usage: 0.00 Mb.
> Total test duration: 0.00 second.
> Total test memory usage: 0.00 Mb.
> Running duration: 27.22 seconds.
Failure (1 test, 0/1 method, 0 failure, 1 error, 0 exception) !
> There is 1 error:
=> tests\units\cgLdap::testGetUtil():
==> Error FATAL ERROR in /Bureau/ProdeliaTests/outilsTests/tests_unit/tests/tuCgLdap.class.php on unknown line, generated by file /Bureau/ProdeliaTests/gene/include/php/cgErreurs.class.php on line 576:
Maximum function nesting level of '512' reached, aborting!
> There is 1 uncompleted method:
=> tests\units\cgLdap::testGetUtil() with exit code 255:
==> output(4) ""
[root@LampP-caenEMO tests]#

En désactivant l'extension xdebug, le test m'indique une sorte de débordement mémoire :


> PHP path: /usr/local/php/bin/php
> PHP version:
=> PHP 5.4.3 (cli) (built: Jun  4 2012 16:48:31) (DEBUG)
=> Copyright (c) 1997-2012 The PHP Group
=> Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
> tests\units\cgLdap...
[U___________________________________________________________][1/1]
=> Test duration: 0.00 second.
=> Memory usage: 0.00 Mb.
> Total test duration: 0.00 second.
> Total test memory usage: 0.00 Mb.
> Running duration: 50.71 seconds.
Failure (1 test, 0/1 method, 0 failure, 1 error, 0 exception) !
> There is 1 error:
=> tests\units\cgLdap::testGetUtil():
==> Error FATAL ERROR in /Bureau/ProdeliaTests/outilsTests/tests_unit/tests/tuCgLdap.class.php on unknown line, generated by file /Bureau/ProdeliaTests/gene/include/php/cgErreurs.class.php on line 581:
Allowed memory size of 100663296 bytes exhausted at /usr/local/src/php-5.4.3/Zend/zend_operators.c:1267 (tried to allocate 82918 bytes)
> There is 1 uncompleted method:
=> tests\units\cgLdap::testGetUtil() with exit code 255:
==> output(4) ""
[root@LampP-caenEMO tests]#

Auriez vous une idée de l'origine de mon problème? Merci d'avance pour votre aide précieuse :)

mageekguy commented 12 years ago

Sans plus de détail, cela fleure bon la boucle infinie récursive et je dirais que ça n'a rien à voir avec atoum.

glonglon commented 12 years ago

En effet, toutes mes excuses, tu peux supprimer ou classer ce post.