Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined function get_debug_type() when configuration is invalid #1384

Closed
sstok opened this issue Oct 28, 2020 · 8 comments · Fixed by #1385
Closed

Call to undefined function get_debug_type() when configuration is invalid #1384

sstok opened this issue Oct 28, 2020 · 8 comments · Fixed by #1385
Assignees

Comments

@sstok
Copy link

sstok commented Oct 28, 2020

Question Answer
Infection version 0.18.2@05685f8e97ec2d42455fdaad6984446d5af2f67e
Test Framework version PHPUnit 8.5.8
PHP version 7.4.10
Platform MacOS (Docker environment)
Github Repo https://github.com/park-manager/park-manager/tree/infection-broken

Running infection with a wrong (not malformed) configuration file (see the repository) crashes the application
with Call to undefined function _HumbugBox6673b05a0af0\Symfony\Component\Console\get_debug_type().

As this function is introduced in PHP 8.0, this might need the PHP 8 Polyfill.

Output with issue
$ make infection

[Uncaught Error in phar:///usr/local/bin/infection/vendor/symfony/console/Application.php on line 489]
Error: Call to undefined function _HumbugBox6673b05a0af0\Symfony\Component\Console\get_debug_type() in phar:///usr/local/bin/infection/vendor/symfony/console/Application.php:489
Stack trace:
#0 phar:///usr/local/bin/infection/vendor/symfony/console/Application.php(478): _HumbugBox6673b05a0af0\Symfony\Component\Console\Application->doRenderThrowable(Object(_HumbugBox6673b05a0af0\Infection\Configuration\Schema\InvalidSchema), Object(_HumbugBox6673b05a0af0\Symfony\Component\Console\Output\StreamOutput))
#1 phar:///usr/local/bin/infection/vendor/symfony/console/Application.php(83): _HumbugBox6673b05a0af0\Symfony\Component\Console\Application->renderThrowable(Object(_HumbugBox6673b05a0af0\Infection\Configuration\Schema\InvalidSchema), Object(_HumbugBox6673b05a0af0\Symfony\Component\Console\Output\StreamOutput))
#2 phar:///usr/local/bin/infection/vendor/symfony/console/Application.php(103): _HumbugBox6673b05a0af0\Symfony\Component\Console\Application->_HumbugBox6673b05a0af0\Symfony\Component\Console\{closure}(Object(_HumbugBox6673b05a0af0\Infection\Configuration\Schema\InvalidSchema))
#3 phar:///usr/local/bin/infection/bin/infection(71): _HumbugBox6673b05a0af0\Symfony\Component\Console\Application->run()
#4 /usr/local/bin/infection(14): require('phar:///usr/loc...')
#5 {main}
make: *** [Makefile:90: in-docker-infection] Error 255
make: *** [infection] Error 2
@sstok
Copy link
Author

sstok commented Oct 28, 2020

Some additional information ArrayItemRemoval doesn't allow ignoreSourceCodeByRegex which marks the configuration as invalid.

@sanmai
Copy link
Member

sanmai commented Oct 28, 2020

Chances are this is because PHP-Scoper does not know that it should keep get_debug_type() global.

Related to #1354

Solution is probably going to be similar.

@maks-rafalko
Copy link
Member

Released: https://github.com/infection/infection/tree/0.19.2

@sstok
Copy link
Author

sstok commented Oct 29, 2020

Thanks. It's working again.

And now to kill some mutants 😁

@canvural
Copy link
Sponsor

I encountered this issue with one of my projects today with version0.20.0@735506ce5fc35dd504c9ba147d5fe0554898b232

PHP 7.4.11
Downloaded infection phar from https://github.com/infection/infection/releases/download/0.20.0/infection.phar

My configuration
{
    "source": {
        "directories": [
            "app"
        ],
        "excludes": [
            "Mail",
            "Nova",
            "Providers",
            "Policies"
        ]
    },
    "logs": {
        "text": "infection.log"
    },
    "mutators": {
        "@default": true
    }
}
Infection verbose output
Box Requirements Checker
========================

> Using PHP 7.4.11
> PHP is using the following php.ini file:
  /usr/local/etc/php/php.ini

> Checking Box requirements:
  ✔ The application requires the version "^7.4 || ^8.0" or greater.
  ✔ The application requires the extension "zlib".
  ✔ The application requires the extension "dom".
  ✔ The application requires the extension "json".
  ✔ The application requires the extension "libxml".
  ✔ The package "nikic/php-parser" requires the extension "tokenizer".
  
                                                                                
 [OK] Your system is ready to run the application.                              
                                                                                

[debug] Checking INFECTION_ALLOW_XDEBUG
[debug] The Xdebug extension is loaded (3.0.2)
[debug] Async signals enabled (SIGINT = SIG_IGN)
[debug] Process restarting (INFECTION_ALLOW_XDEBUG=internal|3.0.2|1|*|*)
[debug] Running '/usr/local/bin/php' './infection' '--coverage=tests/_reports' '--initial-tests-php-options=-d memory_limit=-1' '-j4' '-vvv' '--ansi'

Box Requirements Checker
========================

> Using PHP 7.4.11
> PHP is using the following php.ini file:
  /tmp/KGo3AY

> Checking Box requirements:
  ✔ The application requires the version "^7.4 || ^8.0" or greater.
  ✔ The application requires the extension "zlib".
  ✔ The application requires the extension "dom".
  ✔ The application requires the extension "json".
  ✔ The application requires the extension "libxml".
  ✔ The package "nikic/php-parser" requires the extension "tokenizer".
  
                                                                                
 [OK] Your system is ready to run the application.                              
                                                                                

[debug] Checking INFECTION_ALLOW_XDEBUG
[debug] Restarted (234 ms). The Xdebug extension is not loaded
[debug] Async signals enabled (SIGINT = SIG_DFL)

    ____      ____          __  _
   /  _/___  / __/__  _____/ /_(_)___  ____
   / // __ \/ /_/ _ \/ ___/ __/ / __ \/ __ \
 _/ // / / / __/  __/ /__/ /_/ / /_/ / / / /
/___/_/ /_/_/  \___/\___/\__/_/\____/_/ /_/

Infection - PHP Mutation Testing Framework version 0.20.0@735506ce5fc35dd504c9ba147d5fe0554898b232


Running initial test suite...

PHPUnit version: 9.5.0

  783 [============================]  1 min

Fatal error: Uncaught Error: Call to undefined function _HumbugBoxa55ec68a3f71\Symfony\Component\Console\get_debug_type() in phar:///var/www/html/infection/vendor/symfony/console/Application.php:489
Stack trace:
#0 phar:///var/www/html/infection/vendor/symfony/console/Application.php(478): _HumbugBoxa55ec68a3f71\Symfony\Component\Console\Application->doRenderThrowable(Object(InvalidArgumentException), Object(_HumbugBoxa55ec68a3f71\Symfony\Component\Console\Output\StreamOutput))
#1 phar:///var/www/html/infection/vendor/symfony/console/Application.php(83): _HumbugBoxa55ec68a3f71\Symfony\Component\Console\Application->renderThrowable(Object(InvalidArgumentException), Object(_HumbugBoxa55ec68a3f71\Symfony\Component\Console\Output\StreamOutput))
#2 phar:///var/www/html/infection/vendor/symfony/console/Application.php(103): _HumbugBoxa55ec68a3f71\Symfony\Component\Console\Application->_HumbugBoxa55ec68a3f71\Symfony\Component\Console\{closure}(Object(InvalidArgumentException))
#3 phar:///var/www/html/infection/bin/infection(71): in phar:///var/www/html/infection/vendor/symfony/console/Application.php on line 489
[debug] Restarted process exited 255

Should I create a new issue?

@maks-rafalko
Copy link
Member

yes please

@sidz
Copy link
Member

sidz commented Jan 17, 2021

Could you please try latest version (0.20.2) before you raise new issue? @canvural

I suppose 0.20.2 should work without issue

@canvural
Copy link
Sponsor

canvural commented Jan 17, 2021

@sidz PHAR from https://github.com/infection/infection/releases/tag/0.20.2 downloads 0.20.x-dev@6035c1566af6a5a8d833a276351e5e18ed412305 version. With this version, error message is a little different but still the same issue. Is this a dev version? How to get 0.20.2?

Fatal error: Uncaught Error: Call to undefined function get_debug_type() in phar:///var/www/html/infection/vendor/symfony/console/Application.php:489
Stack trace:
#0 phar:///var/www/html/infection/vendor/symfony/console/Application.php(478): _HumbugBox42c8b1b7c746\Symfony\Component\Console\Application->doRenderThrowable(Object(InvalidArgumentException), Object(_HumbugBox42c8b1b7c746\Symfony\Component\Console\Output\StreamOutput))
#1 phar:///var/www/html/infection/vendor/symfony/console/Application.php(83): _HumbugBox42c8b1b7c746\Symfony\Component\Console\Application->renderThrowable(Object(InvalidArgumentException), Object(_HumbugBox42c8b1b7c746\Symfony\Component\Console\Output\StreamOutput))
#2 phar:///var/www/html/infection/vendor/symfony/console/Application.php(103): _HumbugBox42c8b1b7c746\Symfony\Component\Console\Application->_HumbugBox42c8b1b7c746\Symfony\Component\Console\{closure}(Object(InvalidArgumentException))
#3 phar:///var/www/html/infection/bin/infection(71): _HumbugBox42c8b1b7c746\Symfony\Component\Console in phar:///var/www/html/infection/vendor/symfony/console/Application.php on line 489

Edit: Same with 0.20.1@59a7a374e8020e362550b5223d7174ee7ccc184c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants