|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77162 endless-loop script segfaults instead of exit with a proper error
Submitted: 2018-11-15 10:03 UTC Modified: 2018-11-15 16:11 UTC
From: maggus dot staab at googlemail dot com Assigned: cmb (profile)
Status: Not a bug Package: *General Issues
PHP Version: 7.0.32 OS: ubuntu16 lts
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
1 + 29 = ?
Subscribe to this entry?

 [2018-11-15 10:03 UTC] maggus dot staab at googlemail dot com
the following code segfaults on the php-cli (and on mod_php) but I expected a proper error to happen

mstaab@mst16:/tmp$ php test.php
Speicherzugriffsfehler (Speicherabzug geschrieben)
mstaab@mst16:/tmp$ php -v
PHP (cli) (built: Nov  4 2018 05:10:29) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache, Copyright (c) 1999-2017, by Zend Technologies
    with blackfire v1.23.1~linux-x64-non_zts70,, by Blackfire

Test script:
// test.php

class a {
  private $prop;

  public function __construct() {
    $this->prop = new a();

new a();

Expected result:
no segfault

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-11-15 10:10 UTC] sjon at hortensius dot net
Did you try without extensions? It works pretty good here
 [2018-11-15 10:38 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2018-11-15 10:38 UTC]
Please also try with any of the actively supported PHP

[1] <>
 [2018-11-15 10:46 UTC]
This is almost certainly due to the blackfire extension, which will hook zend_execute and thus force call stack recursion rather than VM recursion.
 [2018-11-15 15:59 UTC] maggus dot staab at googlemail dot com
running the very same test on ubuntu18 with php7.2 works without a problem.

as soon as I disable blackfire on my php 7.0.x it also works without a segfault.

Will report it to blackfire then.
 [2018-11-15 16:11 UTC]
-Status: Feedback +Status: Not a bug
 [2018-11-15 16:11 UTC]
> as soon as I disable blackfire on my php 7.0.x it also works
> without a segfault.

Okay, so this is not a PHP bug.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Oct 04 11:03:58 2022 UTC