php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26685 Doing a continue 0 within a switch is causing a seg fault
Submitted: 2003-12-21 19:17 UTC Modified: 2004-01-01 20:48 UTC
From: sc1n at yahoo dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 4.3.4 OS: Gentoo Linux 2.6 Kernel
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
16 + 30 = ?
Subscribe to this entry?

 
 [2003-12-21 19:17 UTC] sc1n at yahoo dot com
Description:
------------
I used a terinary operator to do a continue 0 or continue 2 
within a switch, and this caused PHP to seg fault... I am able to 
consitantly reproduce the bug. 

Reproduce code:
---------------
while( $value_array = each($this->tags) )
{
	$key = $value_array[0];
	$value = $value_array[1];
	$value['tag_id'] = $key;
			
	switch($tag_pos_type)
	{
		case "start":
			continue $value[3] == 1 ? 2: 0; //The problem
							
		case "end":
			continue $value[3] == 0 ? 2: 0; //The problem					
	}
			
	if( is_array($tag_type_array) )
	{
		if( in_array($value[0], $tag_type_array) )
		{
			return $value;
		}
	}
	else 
	{
		return $value;	
	}			
}

Expected result:
----------------
To either continue not at all, or to continue 2 

Actual result:
--------------
segmentation fault 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-21 19:50 UTC] sc1n at yahoo dot com
This is really a logic error as well, as I should have done a 
continue 1 or continue 0 with a break, however I guess it 
should still be addressed because it does consitantly cash a 
seg fault.
 [2003-12-22 03:15 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-01-01 20:48 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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 17:01:34 2024 UTC