php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52565 print out of Zend_Form causing segmentation fault
Submitted: 2010-08-09 00:25 UTC Modified: 2013-02-18 00:34 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: martin dot minka at gmail dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.3.3 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-08-09 00:25 UTC] martin dot minka at gmail dot com
Description:
------------
Our real application is crashing with signal 11. I was able to simplify the code to following test code which is far from our real application, but causes crash in the same kind of code construction: echo is_null($form) ? '':  $form;
 
I am able to reproduce this crash with PHP 5.3.3 and PHP 5.2.14. 
It does not crash when runnig in CLI mode.

How to run:
1. configure include path to contain Zend library (I was testing with http://framework.zend.com/svn/framework/standard/tags/release-1.10.6/library/Zend)
2. restart apache
3. point your browser to bug.php

Test script:
---------------
set_include_path('.' . PATH_SEPARATOR . '/var/www/library');
require 'Zend/Form.php';
class TestClass {
	function crash() {
		$form = new Zend_Form();
		echo is_null($form) ? '':  $form;
		// it works if there echo instead of die() here
		die("this ends with signal 11 SIGSEGV, returns HTTP code 500");
	}
}
$test = new TestClass();
$test->crash();

Expected result:
----------------
the program should die and print out message "this ends with signal 11 SIGSEGV, returns HTTP code 500"

Actual result:
--------------
HTTP response code 500 returned and signal 11 SIGSEGV logged

Patches

backtrace (last revision 2010-08-09 08:40 UTC by martin dot minka at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-09 00:30 UTC] rasmus@php.net
And the backtrace?
 [2010-08-09 09:29 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2010-08-09 09:29 UTC] pajoye@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

We also need a small reproduce script.
 [2010-08-09 09:41 UTC] mike@php.net
IIRC there's a place in (older version of?) the ZF Form libs where __toString() does not return a string, causing a unexpected SIGSEGV.
 [2010-08-09 10:43 UTC] martin dot minka at gmail dot com
-Status: Feedback +Status: Open
 [2010-08-09 10:43 UTC] martin dot minka at gmail dot com
Thank you for quick reactions. I compiled PHP with debug enabled and produced backtrace. It is attached in patch section.

Reproduce script is included in the original text. That exact script crashes for me everytime.
 [2010-08-09 10:46 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2010-08-09 10:46 UTC] pajoye@php.net
Ah sorry, I did not see the attachment.

However ZF is not exactly a small self contained reproduce script. I would suggest to either try to debug it or ask the ZF devs to debug.

Maybe you are experiencing Mike's issue as well.
 [2010-09-29 15:31 UTC] yesin dot iv at gmail dot com
Got same backtrace without using Zend Forms.
 [2010-09-29 15:33 UTC] felipe@php.net
Without using Zend Forms? So what was the test case? Can you provide a short script? :)
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC