Bug #79801 [Opn]: Type Error with JIT
| From: | nikic@php.net | Date: | Mon, 19 Oct 2020 13:57:19 +0000 |
| Subject: | Bug #79801 [Opn]: Type Error with JIT | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229754@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79801&edit=1
ID: 79801
Updated by: nikic@php.net
Reported by: sebastian@php.net
Summary: Type Error with JIT
Status: Open
Type: Bug
Package: JIT
Operating System: Linux
PHP Version: 8.0Git-2020-09-03 (Git)
Block user comment: N
Private report: N
New Comment:
I tried this again using exactly the referenced commit and using exactly the listed ini options, but
this still doesn't reproduce for me :(
Previous Comments:
------------------------------------------------------------------------
[2020-10-16 05:10:08] sebastian@php.net
I am still able to reproduce this with current versions of PHPUnit
(137f98be3b928d5f9f14e66f7aa5eadcfc668bbe) and PHP 8.0 (3841ea338ef2508d467efef9ec45d03162ba695d).
------------------------------------------------------------------------
[2020-09-04 14:29:42] sebastian@php.net
Weird. Just to be sure: you used the same settings (-d opcache.enable=1 -d opcache.enable_cli=1 -d
opcache.optimization_level=-1 -d opcache.jit_buffer_size=64M -d opcache.jit=1255) I used?
------------------------------------------------------------------------
[2020-09-04 13:39:00] nikic@php.net
I'm not able to reproduce this.
------------------------------------------------------------------------
[2020-09-04 08:26:54] sebastian@php.net
PHPUnit\Framework\TestCase::usesDataProvider() has a single line of code in its body: return
!empty($this->data);
I do not believe that empty() can return a value of type string, hence I believe "Fatal error:
Uncaught TypeError: PHPUnit\Framework\TestCase::usesDataProvider(): Return value must be of type
bool, string returned in /usr/local/src/phpunit/src/Framework/TestCase.php:1484" to be wrong.
------------------------------------------------------------------------
[2020-09-03 09:41:22] sebastian@php.net
Update using 397a692735b295566aab947d979013247385f6db of PHP and
a59ece3a83000188ab9abad4fe46f397bf082749 of PHPUnit:
When I run the test with PHP 8 but without JIT then I get:
$ php-80 ./phpunit --filter testConstraintIsEqual2#3
PHPUnit 9.4-ga59ece3a8 by Sebastian Bergmann and contributors.
Runtime: PHP 8.0.0-dev
Configuration: /usr/local/src/phpunit/phpunit.xml
. 1 / 1 (100%)
Time: 00:00.099, Memory: 22.00 MB
OK (1 test, 1 assertion)
When I run the test with PHP 8 and JIT enabled then I get:
$ php-80 -d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.optimization_level=-1 -d
opcache.jit_buffer_size=64M -d opcache.jit=1255 ./phpunit --filter testConstraintIsEqual2#3
Fatal error: Uncaught TypeError: PHPUnit\Framework\TestCase::usesDataProvider(): Return value must
be of type bool, string returned in /usr/local/src/phpunit/src/Framework/TestCase.php:1484
Stack trace:
#0 /usr/local/src/phpunit/src/Framework/TestCase.php(1480):
PHPUnit\Framework\TestCase->usesDataProvider()
#1 /usr/local/src/phpunit/src/Framework/TestCase.php(1252): PHPUnit\Framework\TestCase->sortId()
#2 /usr/local/src/phpunit/src/Framework/TestCase.php(485):
PHPUnit\Framework\TestCase->setName('testGlobalFunct...')
#3 /usr/local/src/phpunit/src/Framework/TestBuilder.php(163):
PHPUnit\Framework\TestCase->__construct('testGlobalFunct...', Array,
'assertTrue')
#4 /usr/local/src/phpunit/src/Framework/TestBuilder.php(108):
PHPUnit\Framework\TestBuilder->buildDataProviderTestSuite('testGlobalFunct...',
'PHPUnit\\Framewo...', Array, false, NULL, false, Array)
#5 /usr/local/src/phpunit/src/Framework/TestSuite.php(889):
PHPUnit\Framework\TestBuilder->build(Object(ReflectionClass), 'testGlobalFunct...')
#6 /usr/local/src/phpunit/src/Framework/TestSuite.php(231):
PHPUnit\Framework\TestSuite->addTestMethod(Object(ReflectionClass), Object(ReflectionMethod))
#7 /usr/local/src/phpunit/src/Framework/TestSuite.php(361):
PHPUnit\Framework\TestSuite->__construct(Object(ReflectionClass))
#8 /usr/local/src/phpunit/src/Framework/TestSuite.php(500):
PHPUnit\Framework\TestSuite->addTestSuite(Object(ReflectionClass))
#9 /usr/local/src/phpunit/src/Framework/TestSuite.php(525):
PHPUnit\Framework\TestSuite->addTestFile('/usr/local/src/...')
#10 /usr/local/src/phpunit/src/TextUI/XmlConfiguration/TestSuite/TestSuiteMapper.php(50):
PHPUnit\Framework\TestSuite->addTestFiles(Array)
#11 /usr/local/src/phpunit/src/TextUI/Command.php(388):
PHPUnit\TextUI\XmlConfiguration\TestSuiteMapper->map(Object(PHPUnit\TextUI\XmlConfiguration\TestSuiteCollection),
'')
#12 /usr/local/src/phpunit/src/TextUI/Command.php(115):
PHPUnit\TextUI\Command->handleArguments(Array)
#13 /usr/local/src/phpunit/src/TextUI/Command.php(100): PHPUnit\TextUI\Command->run(Array, true)
#14 /usr/local/src/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#15 {main}
Next PHPUnit\TextUI\Exception: PHPUnit\Framework\TestCase::usesDataProvider(): Return value must be
of type bool, string returned in /usr/local/src/phpunit/src/TextUI/Command.php:102
Stack trace:
#0 /usr/local/src/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#1 {main}
thrown in /usr/local/src/phpunit/src/TextUI/Command.php on line 102
So I no longer run into a segfault but rather into a type error.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79801
--
Edit this bug report at https://bugs.php.net/bug.php?id=79801&edit=1