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 at Zend/zend_vm_execute.h:4057 #16774

Closed
YuanchengJiang opened this issue Nov 13, 2024 · 3 comments
Closed

Segmentation fault at Zend/zend_vm_execute.h:4057 #16774

YuanchengJiang opened this issue Nov 13, 2024 · 3 comments

Comments

@YuanchengJiang
Copy link

Description

The following code:

<?php
class C {
public $a {
get { return $this->a; }
}
}
function test(string $fusion, object $obj) {
var_dump($obj->a);
var_dump($obj);
}
$reflector = new ReflectionClass(C::class);
$obj = $reflector->newLazyGhost(function ($obj) {
});
test('Ghost', $obj);

Resulted in this output:

Zend/zend_vm_execute.h:4057:8: runtime error: load of misaligned address 0x7f18e886918f for type 'void *', which requires 8 byte alignment
0x7f18e886918f: note: pointer points here

To reproduce: JIT 1011

PHP Version

nightly

Operating System

ubuntu 22.04

@arnaud-lb
Copy link
Member

arnaud-lb commented Nov 13, 2024

@YuanchengJiang I was not able to reproduce this one. Could you share more details about how you run this code, and the commit hash of the php build? I'm running the code with the following command on an ASAN or MSAN build:

USE_ZEND_ALLOC=0 sapi/cli/php -n -dzend_extension=$(pwd)/modules/opcache.so -dopcache.enable_cli=1 -dopcache.jit_buffer_size=100m -dopcache.jit=1011 test.php

@nielsdos
Copy link
Member

I predict this is going to be a duplicate of #16578, checking now...

@nielsdos
Copy link
Member

You need to activate the cache slot by duplicating the test calll, then it reproduces.
This is indeed a duplicate of #16578 which was in itself a duplicate of #15834: avoiding the simple_get cache slot avoids this issue.

@nielsdos nielsdos closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
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

4 participants