zephir: PHP 7 create_instance_params is causing seg fault
So, if we define in phalcon view like this:
use Phalcon\Mvc\View;
$di = new \Phalcon\Di\FactoryDefault();
$di->set('view',function(){
$view=new \Phalcon\Mvc\View\Simple;
$view->registerEngines([
'.volt'=>'Phalcon\Mvc\View\Engine\Volt'
]);
return $view;
});
Then we got a create_instance_params called here https://github.com/phalcon/cphalcon/blob/2.1.x/phalcon/di.zep#L235
With name 'Phalcon\Mvc\View\Engine\Volt'
and arguments [di, view object]
And it causes a seg fault. Log is here:
Also on debug version i dont have stack trace(maybe i do something wrong) and code is not working(just white page)
Also just to clarify - zephir has problems to create instance of class when it’s provided as string(as i did here). It’s not phalcon related problem anyhow. From backtrace i guess he has some problems with passing arguments/bind them or something like this but i don’t know.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 70 (70 by maintainers)
Commits related to this issue
- Fix ZE3 #1218: create_instance_params: make sure to pass all params this prevents access to uninitialized memory (which might have caused crashes and similar unwanted behavior) — committed to zephir-lang/zephir by steffengy 8 years ago
- Refactored Mvc\Model\Metadata\Memory test — committed to phalcon/cphalcon by sergeyklay 8 years ago
@Jurigag @Izopi4a can you test again and confirm it’s fixed?