PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #5097

PHP crashes when throwing an exception after a form is created

Details

Submitted2005-08-15 10:50 UTC
Fromsteven11 at gmx dot de
StatusBogus
PackageHTML_QuickForm
PHP Version5.0.3
OSWindows
Roadmaps(Not assigned)

Comments

[2005-08-15 10:50 UTC] steven11 at gmx dot de

Description:
------------
Hi,
under certain circumstances the whole PHP-process crashes when throwing an exception after a form is created. It happens when a submit-Button is added to the form (maybe it also happens when other controls are added, but I didn't test this).

Also necessary is a call to call_user_method(). See the simplified code sample to get the idea ;-)

mfg Steven

Test script:
---------------
abstract class AbstractEditor {
public function doUploadIt() {
call_user_method('doUpload', $this);
}
}

class Editor extends AbstractEditor {
public function doUpload() {
$form = new HTML_QuickForm('frm');
$form->addElement('submit', 'submit', 'OK');

throw new Exception("test-exception");
}
}

try {
$edit = new Editor();
$edit->doUploadIt();
}
catch (Exception $err) {
die($err->getMessage());
}

Expected result:
----------------
The expected result is this output:

test-exception

Actual result:
--------------
No output, PHP crashes with an Access Violation (wants to access address 0x00000000)

[2005-08-15 10:56 UTC] steven11 at gmx dot de

I forgot something:

at the end of the code there must be two echo-calls:

echo "something";
echo "something";