php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70482 SegFault on Solr Server 500 Response with no msg (xml RW)
Submitted: 2015-09-13 16:10 UTC Modified: 2015-09-13 16:11 UTC
From: omars@php.net Assigned: omars (profile)
Status: Closed Package: solr (PECL)
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: omars@php.net
New email:
PHP Version: OS:

 

 [2015-09-13 16:10 UTC] omars@php.net
Description:
------------
When solr server returns 500 error with no msg element, and a trace instead.
the extension segfaults instead of throwing a SolrServer Exception with code and the trace.

Only if the client is using xml response writer

Test script:
---------------
require_once "bootstrap.inc";
$options = array
(
		'hostname' => SOLR_SERVER_HOSTNAME,
		'login'    => SOLR_SERVER_USERNAME,
		'password' => SOLR_SERVER_PASSWORD,
		'port'     => SOLR_SERVER_PORT,
		'path'	   => SOLR_SERVER_PATH,
		'wt'	   => 'xml'
);

$client = new SolrClient($options);

$query = new SolrQuery('*:*');

$func = new SolrCollapseFunction('manu_id_s');

$func->setMax('sum(cscore(),field(manu_id_s))');
$func->setSize(100);
$func->setNullPolicy(SolrCollapseFunction::NULLPOLICY_EXPAND);

$query->collapse($func);
try {
	$queryResponse = $client->query($query);
} catch (SolrServerException $e) {
	printf("Exception code %d", $e->getCode());
	assert(strlen($e->getMessage()) > 0, 'Exception message is empty');
}


Expected result:
----------------
Exception code 500

Actual result:
--------------
Segmentation Fault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-13 16:11 UTC] omars@php.net
-Assigned To: +Assigned To: omars
 [2015-09-13 16:46 UTC] omars@php.net
Automatic comment on behalf of omars
Revision: http://git.php.net/?p=pecl/search_engine/solr.git;a=commit;h=067bc804059933c39ddf14aad8fe3b8ec438ea77
Log: Fix Bug #70482 	SegFault on Solr Server 500 Response with no msg (xml RW)
 [2015-09-13 16:46 UTC] omars@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC