php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29080 Segmentation Fault when using Interface
Submitted: 2004-07-09 23:14 UTC Modified: 2004-09-10 12:55 UTC
Votes:5
Avg. Score:4.2 ± 0.7
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: jason at ionzoft dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.0.0RC3 OS: Redhat ES 3.0 (Intel)
Private report: No CVE-ID: None
 [2004-07-09 23:14 UTC] jason at ionzoft dot com
Description:
------------
Hello,

I discovered this problem tonight while working on a new PHP 5 class that uses an interface.  The code example came from http://www.zend.com/php5/articles/engine2-php5-changes.php#Heading5


<?php
   interface Throwable {
      public function getMessage();
   }

   class MyException implements Throwable {
      public function getMessage() {
          echo "Hello\n";
      }
   }

   $x = new MyException;
   $x->getMessage();
?>


------------------


On this server, I get a Segmentation Fault:

[ionzoft@lithium dev]$ php -v
PHP 5.0.0RC3 (cli) (built: Jun 24 2004 17:35:13)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0RC3, Copyright (c) 1998-2004 Zend Technologies
    with Zend Extension Manager v1.0.2, Copyright (c) 2003-2004, by Zend Technologies
    with Zend Optimizer v2.5.2, Copyright (c) 1998-2004, by Zend Technologies
    with Zend Debugger v3.5.0, Copyright (c) 1999-2004, by Zend Technologies


[ionzoft@lithium dev]$ php -f Interface.php
Segmentation fault

------------------

On this server, It works fine:

[izsp@boron Jason]$ php -v
PHP 5.0.0RC3 (cli) (built: Jun 14 2004 14:04:10)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0RC3, Copyright (c) 1998-2004 Zend Technologies


[izsp@boron Jason]$ php -f Interface.php
Hello

------------------

Could it be a problem with the Debugger?

Thanks,
Jason Garber


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reproduce code:
---------------
<?php
   interface Throwable {
      public function getMessage();
   }

   class MyException implements Throwable {
      public function getMessage() {
          echo "Hello\n";
      }
   }

   $x = new MyException;
   $x->getMessage();
?>


Expected result:
----------------
Should print "Hello\n"

Actual result:
--------------
"Segmentation Fault"

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-10 06:51 UTC] curt@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip
 [2004-07-10 14:37 UTC] helly@php.net
Could you also try to run it with Debugger and Optimizer alone to get them isolated?
 [2004-07-15 20:06 UTC] piotr at t-p-l dot com
running the same code seg faults aswell
I narrowed it down to Optimizer here is the proof:

------ WITHOUT OPTIMIZER ------

# php -v
PHP 5.0.0 (cli) (built: Jul 15 2004 10:19:20)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0, Copyright (c) 1998-2004 Zend Technologies
    with Zend Extension Manager v1.0.3, Copyright (c) 2003-2004, by Zend Technologies
    with Zend Debugger v3.5.0, Copyright (c) 1999-2004, by Zend Technologies

# php test2.php
Hello

------ WITH OPTIMIZER ------

# php -v
PHP 5.0.0 (cli) (built: Jul 15 2004 10:19:20)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0, Copyright (c) 1998-2004 Zend Technologies
    with Zend Extension Manager v1.0.3, Copyright (c) 2003-2004, by Zend Technologies
    with Zend Optimizer v2.5.3, Copyright (c) 1998-2004, by Zend Technologies
    with Zend Debugger v3.5.0, Copyright (c) 1999-2004, by Zend Technologies

# php test2.php
Segmentation fault

------ WITH OPTIMIZER (but no DEBUGGER) ------

# php -v
PHP 5.0.0 (cli) (built: Jul 15 2004 10:19:20)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0, Copyright (c) 1998-2004 Zend Technologies
    with Zend Extension Manager v1.0.3, Copyright (c) 2003-2004, by Zend Technologies
    with Zend Optimizer v2.5.3, Copyright (c) 1998-2004, by Zend Technologies

# php test2.php
Segmentation fault
 [2004-07-18 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2004-07-20 17:10 UTC] jason at ionzoft dot com
Hi,

I'm experiencing the same bug, but it seems only the original poster
comments are considered any good by the system, so could you please
comment on your bug to reopen it.

Thanks,

Piotr

-- 
Piotr Banasik
T-P-L.com

GnuPG key fingerprint: B1E5 A557 BB24 5E8A 95A4  202A 2B
 [2004-09-10 12:55 UTC] nlopess@php.net
It works with the Zend Optimizer/Debugger, so it's not our problem.
You should report the problem to Zend.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Aug 21 20:01:27 2024 UTC