php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54623 Segmentation fault after writing to first socket after closing of second socket
Submitted: 2011-04-28 16:58 UTC Modified: 2011-05-01 05:57 UTC
From: tiger dot seo at gmail dot com Assigned: cataphract (profile)
Status: Closed Package: Sockets related
PHP Version: 5.3.6 OS: Ubuntu 10.10
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: tiger dot seo at gmail dot com
New email:
PHP Version: OS:

 

 [2011-04-28 16:58 UTC] tiger dot seo at gmail dot com
Description:
------------
BTW, my friend with 5.2.6 says that bug doesn`t reproduces in her, but in version 5.2.10 it does reproduced, and in version 5.3.3 also reproduced.

Backtrace from GDB:

Starting program: /usr/bin/php memcached.php
[Thread debugging using libthread_db enabled]
[New Thread 0xb7c1cb70 (LWP 11369)]
[Thread 0xb7c1cb70 (LWP 11369) exited]

Program received signal SIGSEGV, Segmentation fault.
0x080ab68a in ?? ()
(gdb) bt
#0  0x080ab68a in ?? ()
#1  0x082c9d0a in ?? ()
#2  0x0823a439 in zif_fwrite ()
#3  0x08334647 in execute_internal ()
#4  0x0092b474 in xdebug_execute_internal (current_execute_data=0x893d5bc, return_value_used=0) at /build/buildd/xdebug-2.1.0/build-php5/xdebug.c:1339
#5  0x08360310 in ?? ()
#6  0x08336fde in execute ()
#7  0x0092b123 in xdebug_execute (op_array=0x890bc14) at /build/buildd/xdebug-2.1.0/build-php5/xdebug.c:1272
#8  0x0830cf06 in zend_execute_scripts ()
#9  0x082b1654 in php_execute_script ()
#10 0x083a41bb in ?? ()
#11 0x00646ce7 in __libc_start_main () from /lib/libc.so.6
#12 0x08066ca1 in _start ()


Test script:
---------------
<?php

$sock = pfsockopen('10.4.8.2', '11211');
$data = "add 1_".md5(time())." 0 10 10\r\n".time()."\r\n";
fwrite($sock, $data);
$sock2 = pfsockopen('10.4.8.2', '11211');
$data2 = "add 2_".md5(time())." 0 10 10\r\n".time()."\r\n";
fwrite($sock2, $data2);
fclose($sock2);
$data = "add 3_".md5(time())." 0 10 10\r\n".time()."\r\n";
fwrite($sock, $data);

Expected result:
----------------
Data normally writed to first socket

Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-28 17:08 UTC] tiger dot seo at gmail dot com
Port can be any other, for example with 80 port bug is reproduced
 [2011-04-30 18:49 UTC] cataphract@php.net
-Assigned To: +Assigned To: cataphract
 [2011-04-30 22:00 UTC] cataphract@php.net
Looks like a persistent version of bug #24557 (see r136199 and r136088).
 [2011-05-01 05:57 UTC] cataphract@php.net
Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=310681
Log: - Fixed bug #54623 (Segfault when when writing to a persistent socket after
  closing a copy of the socket).
 [2011-05-01 05:57 UTC] cataphract@php.net
-Status: Assigned +Status: Closed
 [2011-05-01 05:57 UTC] cataphract@php.net
Fixed in SVN. Thanks for the report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC