php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49813 Segfault during shutdown in php_stream_context_del_link
Submitted: 2009-10-08 13:40 UTC Modified: 2009-12-20 01:00 UTC
Votes:7
Avg. Score:4.6 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:5 (83.3%)
Same OS:3 (50.0%)
From: dmitry dot revenko at businessmedia dot ru Assigned:
Status: No Feedback Package: SOAP related
PHP Version: 5.2SVN-2009-10-08 (snap) OS: Linux Fedora Core 6 2.6.22
Private report: No CVE-ID: None
 [2009-10-08 13:40 UTC] dmitry dot revenko at businessmedia dot ru
Description:
------------
This error occures both in CLI and Apache PHP module. If I use SoapClient with client certificate I get segmentation fault. Soap call(s) and all the script logic behaves as expected, but during PHP shutdown there's segmentation fault occured.
I reproduced this on two workstations with the same Fedora Core 6 and tried PHP versions 5.2.6 - 5.2.11 and 5.2.current.

Reproduce code:
---------------
<?php
// Program requires client certificate (I can send the one)
try
{
	$soap = new SoapClient('https://host/soap/?wsdl', array(
		'exceptions' => 1,
		'wsdl_cache' => WSDL_CACHE_NONE,
		'local_cert' => dirname(__FILE__) . '/client-cert.pem',
		'passphrase' => 'piglet'
	));
	
	$res = $soap->userLogin(array('login' => 'bugonek', 'password' => md5('000'), 'save_session' => false));
	if ($res !== false && $res->errorCode == 0)
		echo "SID: {$res->sid}\n";
	else
		echo "Login error: {$res->errorMessage}\n";
}
catch (Exception $e)
{
	echo 'Exception [' . $e->getCode() . '] ' . $e->getMessage() . "\n";
}
?>

Expected result:
----------------
SID: 3092b3e454a6f4c9bb8ccab01adce34c (this value is generated at runtime and not exactly should be the one)

Actual result:
--------------
SID: 3092b3e454a6f4c9bb8ccab01adce34c
Segmentation fault (core dumped)

gdb backtrace
-------------------------------------
Core was generated by `/usr/local/bin/php index-simple.php'.
Program terminated with signal 11, Segmentation fault.
#0  0x08412c9d in php_stream_context_del_link (context=0x88a06bc, stream=0x88a1078) at /usr/src/Software/php5.2-200910081030/main/streams/streams.c:2044
2044            for(zend_hash_internal_pointer_reset(Z_ARRVAL_P(context->links));

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-16 21:46 UTC] felipe@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2009-11-24 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-12-12 22:20 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-12-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC