php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28111 switch($this->type = $type) cause SEGV
Submitted: 2004-04-22 22:21 UTC Modified: 2004-04-29 22:56 UTC
From: derrell dot lipman at unwireduniverse dot com Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.0.0RC1 OS: Linux 2.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: derrell dot lipman at unwireduniverse dot com
New email:
PHP Version: OS:

 

 [2004-04-22 22:21 UTC] derrell dot lipman at unwireduniverse dot com
Description:
------------
An assignment (of a class variable?) in a switch statement causes an apache crash.  The first object instantiation int eh attached sample ($testval == 1) succeeds; the second one ($testval == 2) fails.


Reproduce code:
---------------
<?php
class TestClass
{
    var $type;
    
    function TestClass($testval)
    {
        $type = intval("2");

        if ($testval == 1)
        {
            switch($type)
            {
            default:
                echo "Test 1 worked<br>";
                flush();
                break;
            }
        }
        else if ($testval == 2)
        {
            switch($this->type = $type)    /* This line causes crash */
            {
            default:
                echo "Test 2 worked<br>";
                flush();
                break;
            }
        }

    }
}

$tc = new TestClass(1);
$tc = new TestClass(2);
?>


Actual result:
--------------
In apache/error.log:
  [notice] child pid XXXXX exit signal Segmentation fault (11)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-23 09:04 UTC] derick@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

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.
 [2004-04-29 22:55 UTC] sniper@php.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.


 [2004-04-29 22:56 UTC] sniper@php.net
You should try the latest cvs snapshot anyway, I think this was fixed long time ago (after RC1 was released).

http://snaps.php.net

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 19:01:29 2024 UTC