Issues

ZF-12139: Segmentation Fault when rendering a Zend_Form_Element

Issue Type: Bug Created: 2012-04-04T20:54:09.000+0000 Last Updated: 2012-10-04T14:16:47.000+0000 Status: Open Fix version(s): Reporter: Michael Irey (michaelirey) Assignee: Christian Albrecht (alab) Tags: - Zend_Form

Related issues: Attachments:

Description

Please see https://bugs.php.net/bug.php?id=60158

Using ZendFramework-1.11.10. Seg fault occurs also in 5.3.2 as well as 5.3.8. Does not occur in 5.2.4. Difficult to reproduce, but I will include the gdb backtrace. Basically assigning the value of variable to another, causes the seg fault. I can not determine why. The line $this->_element = $element; causes the seg fault.

<pre class="highlight">
    public function setElement($element)
    {
        if ((!$element instanceof Zend_Form_Element)
            && (!$element instanceof Zend_Form)
            && (!$element instanceof Zend_Form_DisplayGroup))
        {
            require_once 'Zend/Form/Decorator/Exception.php';
            throw new Zend_Form_Decorator_Exception('Invalid element type passed to decorator');
        }

        $this->_element = $element;
        return $this;
    }



<pre class="highlight">
Not this: exit signal Segmentation fault (11)



<pre class="highlight">
Program terminated with signal 11, Segmentation fault.

They recommended I report this issue.

Any ideas how I can get around this? When I echo a form element sometimes I get a Segmentation fault, happens frequently when there is an input type of File.

<pre class="highlight">
class Form_ContactPhoto extends Form_Source
{
    public function init()
    {
        $this->addElement('hidden', 'ID');
        
        $element = new Zend_Form_Element_File('ContactPhoto');
        $element
            ->setLabel('New Photo')
            ->setDestination(TMP_DIR)
            ->setRequired(false)
            ->addValidator('Count', false, 1)
            ->addValidator('Size', false, 10240000) // 10 mb max
            ->addValidator('Extension', false, 'jpg,png,gif')
            ->setDecorators(array('File'));
        $this->addElement($element);
        
        $this->addElement('text', 'MarketingPhotoBwLocation');
        
        $this->addElement('text', 'MarketingPhotoLocation');
        
        $this->addElement('submit', 'Submit', array('label' => 'Save'));
    }
}

Comments

Posted by Frank Brückner (frosch) on 2012-04-24T11:56:45.000+0000

Hi Michael, any update on this issue? Is this a problem from PHP or from Zend Framework? I can not reproduce the problem (PHP 5.3.6 and 5.3.10).

Posted by Frank Brückner (frosch) on 2012-05-11T15:03:16.000+0000

Can anyone reproduce the problem?

Posted by Adam Lundrigan (adamlundrigan) on 2012-05-14T12:52:50.000+0000

What is the value of your APPLICATION_PATH constant?

Posted by Michael Irey (michaelirey) on 2012-07-13T17:35:44.000+0000

Yes APPLICATION_PATH is constant.

Posted by Michael Irey (michaelirey) on 2012-07-13T17:37:30.000+0000

@Frank, yes this is still an issue for us. If you add blank new lines to the file it can sometimes cause the seg fault to not happen. Strange huh.

Posted by Ryan Mauger (bittarman) on 2012-07-13T20:41:16.000+0000

Please provide more information.

We cannot fix this without reproducing, and it seems to happen with very few systems... Please provide O/S distribution / version, php configure line and a complete, executable, minimal script to reproduce the problem.

Posted by Ed (elomonaco) on 2012-10-04T14:16:47.000+0000

I too face this problem.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts