php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49450 Segmentation fault with ArrayObject::offsetSet()
Submitted: 2009-09-03 10:33 UTC Modified: 2009-09-04 11:08 UTC
From: arnold at adaniels dot nl Assigned: bjori (profile)
Status: Closed Package: Website problem
PHP Version: 5.3.0 OS: Linux / Ubuntu 9.04
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: arnold at adaniels dot nl
New email:
PHP Version: OS:

 

 [2009-09-03 10:33 UTC] arnold at adaniels dot nl
Description:
------------
Using array access on $this in ArrayObject::offsetSet() causes a segmentation fault.

(Calling parent::offsetSet() instead, works fine)

Reproduce code:
---------------
class AOTest extends ArrayObject
{
	public function offsetSet($index, $newval)
	{
		$this[$index] = (int)$newval;
	}	
}

$a = new AOTest();
$a['test'] = "10 doves";
var_dump((array)$a);

Expected result:
----------------
array(1) {
  ["test"]=>
  int(10)
}


Actual result:
--------------
Segmentation fault


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-03 10:42 UTC] derick@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

49449
 [2009-09-03 10:49 UTC] arnold at adaniels dot nl
The PHP bugs app resulted in 'Authentication failed' and appeared not to have submitted the bug. Therefor I pressed 'Submit' again. I didn't get the confirmed page until I cleared my cookies.
 [2009-09-03 10:54 UTC] derick@php.net
Changing this one to a website issue then... #49449 is still your original report.
 [2009-09-03 11:58 UTC] arnold at adaniels dot nl
The same problem occured again. I get the message:

Authentication failed: Incorrect username Authentication failed: Incorrect username
Warning: Cannot modify header information - headers already sent by (output started at /home/Web/sites/php-bugs-web/include/auth.inc:30) in /home/Web/sites/php-bugs-web/report.php on line 201

---
My cookies:

http://bugs.php.net/report.php

2 cookies
Name	MAGIC_COOKIE
Value	OnJ1bGV6NGZy
Host	.php.net
Path	/
Secure	No
Expires	Tue, 15 Sep 2009 10:49:57 GMT

Name	PHPSESSID
Value	276ed6ccd97d407df90fca8f38334a0c
Host	bugs.php.net
Path	/
Secure	No
Expires	At End Of Session
 [2009-09-03 18:30 UTC] bjori@php.net
Why do you have MAGIC_COOKIE at all?
Did you try to login as developer at some point to any php.net service?
 [2009-09-03 18:33 UTC] bjori@php.net
Should be fixed in r287998.

Although I am still curious why you have that cookie.
 [2009-09-04 09:47 UTC] arnold at adaniels dot nl
I think I got it with the option to save the bug's password in a cookie ('remember for the next time' or something).
 [2009-09-04 11:08 UTC] svn@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&revision=288039
Log: Fixed bug#49450 (normal users get developers authentication errors)
# Re-enable the authentication errors messages for devs (with set username)
 [2009-09-04 11:08 UTC] bjori@php.net
This bug has been fixed in SVN. Since the websites are not directly
updated from the SVN server, the fix might need some time to spread
across the globe to all mirror sites, including PHP.net itself.

Thank you for the report, and for helping us make PHP.net better.

Found it, thanks for the report!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 27 00:00:03 2025 UTC