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

Segmentation fault in main/spprintf.c #16009

Open
YuanchengJiang opened this issue Sep 23, 2024 · 0 comments
Open

Segmentation fault in main/spprintf.c #16009

YuanchengJiang opened this issue Sep 23, 2024 · 0 comments

Comments

@YuanchengJiang
Copy link

Description

The following code:

<?php
$dom = DOM\XMLDocument::createFromString(<<<XML
<html xmlns="http://www.w3.org/1999/xhtml">
<input type="text" placeholder="" />
<textarea placeholder="" />
<input xmlns="" type="text" placeholder="" />
<textarea xmlns="" placeholder="" />
<input type="text" />
<textarea />
</html>
XML);
$fusion = $dom;
function testMin2First(int $value): int {
        $value = min($value, 100);
        return $value;
}
function testMin2Second(int $fusion): int {
        $value = min(100, $value);
        return $value;
}
function testMin2_TMP(int $value): int {
        $value = min($value + 1, 100);
        return $value;
}
var_dump(testMin2First(5));
var_dump(testMin2Second(5));
?>

Resulted in this output:

/php-src/main/spprintf.c:376:14: runtime error: member access within misaligned address 0x200238000000002 for type 'zend_string' (aka 'struct _zend_string'), which requires 8 byte alignment

To reproduce:

-d "extension_dir=/php-src/modules/" -d "zend_extension=/php-src/modules/opcache.so" -d "opcache.enable=1" -d "opcache.enable_cli=1" -d "opcache.jit=1012"

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

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

No branches or pull requests

2 participants