-
Type:
Bug
-
Status: Closed
-
Priority:
Major - P3
-
Resolution: Fixed
-
Affects Version/s: 1.4.5
-
Fix Version/s: None
-
Component/s: pecl-mongo
-
Environment:Ubuntu 12.04 LTS
Mongo 2.4.8
PHP 5.3.10-1ubuntu3.9
Mongo Driver 1.4.5
-
# Replies:5
-
Last comment by Customer:true
Calling the info method on a dead MongoCursor object causes a page fault. See the script below to reproduce.
<?php
|
#################################
|
# ECHO VERSIONS ################# |
#################################
|
echo "PHP: " . phpversion() . "\n"; |
echo "Mongo Driver: " . phpversion('mongo') . "\n"; |
|
##########################################
|
# CREATE FAILURE CONDITION ###############
|
##########################################
|
|
$connection = new MongoClient('mongodb://localhost:27017'); |
|
$connection->test->segfault_demo->insert(array('test' => 1)); |
$connection->test->segfault_demo->insert(array('test' => 2)); |
$connection->test->segfault_demo->insert(array('test' => 3)); |
$connection->test->segfault_demo->insert(array('test' => 4)); |
$connection->test->segfault_demo->insert(array('test' => 5)); |
$connection->test->segfault_demo->insert(array('test' => 6)); |
$connection->test->segfault_demo->insert(array('test' => 7)); |
|
$txlogs = $connection->test->segfault_demo->find()->limit(5); |
|
foreach($txlogs as $txlog) { |
echo ($txlogs->dead() ? "Dead" : "Not Dead") . "\n"; |
}
|
|
################################
|
# CAUSE SEGFAULT ###############
|
################################
|
$txlogs->info(); |
Output:
PHP: 5.3.10-1ubuntu3.9
|
Mongo Driver: 1.4.5
|
Not Dead
|
Not Dead
|
Not Dead
|
Not Dead
|
Not Dead
|
Segmentation fault
|