{"action":"created","issue":{"url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/173","labels_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/173/labels{/name}","comments_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/173/comments","events_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/173/events","html_url":"https://github.com/mongodb/mongo-php-driver/issues/173","id":122610285,"number":173,"title":"Segmentation fault when creating Manager with empty arguments","user":{"login":"jeremyjannotta","id":423937,"avatar_url":"https://avatars.githubusercontent.com/u/423937?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremyjannotta","html_url":"https://github.com/jeremyjannotta","followers_url":"https://api.github.com/users/jeremyjannotta/followers","following_url":"https://api.github.com/users/jeremyjannotta/following{/other_user}","gists_url":"https://api.github.com/users/jeremyjannotta/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremyjannotta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremyjannotta/subscriptions","organizations_url":"https://api.github.com/users/jeremyjannotta/orgs","repos_url":"https://api.github.com/users/jeremyjannotta/repos","events_url":"https://api.github.com/users/jeremyjannotta/events{/privacy}","received_events_url":"https://api.github.com/users/jeremyjannotta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-12-16T21:48:50Z","updated_at":"2015-12-29T17:36:02Z","closed_at":null,"body":"When executing phpunit to instantiate a Manager, I am seeing a consistent segmentation fault error like this:\r\n```\r\n/usr/local/bin/phpunit: line 3:  2440 Segmentation fault: 11  /usr/bin/env php -d allow_url_fopen=On -d detect_unicode=Off /usr/local/Cellar/phpunit/5.0.0/libexec/phpunit-5.0.0.phar\r\n```\r\nwhen creating a Manager with these empty arguments:\r\n```\r\n$manager = new \\MongoDB\\Driver\\Manager(\"mongodb://localhost:27017\", [], []);\r\n```\r\n\r\nBut after removing the empty `[]` arguments it works fine:\r\n```\r\n$manager = new \\MongoDB\\Driver\\Manager(\"mongodb://localhost:27017\");\r\n```\r\nThis was found when I noticed MongoDB\\Client passes in these default values.\r\n\r\nAlso perhaps related, I notice under when trying to access any method, like getServers(), I see this error:\r\n```\r\nFatal error: Allowed memory size of 1828716544 bytes exhausted (tried to allocate 18446744073273022950 bytes) in /Users/jeremyjannotta/Documents/dev/projects/mongodb/vendor/mongodb/mongodb/src/Client.php on line 32\r\n\r\nCall Stack:\r\n    0.0006     230272   1. {main}() /Users/jeremyjannotta/Documents/dev/projects/mongodb/index.php:0\r\n    0.0070     344288   2. MongoDB\\Client->__construct() /Users/jeremyjannotta/Documents/dev/projects/mongodb/index.php:6\r\n    0.0070     344576   3. MongoDB\\Driver\\Manager->__construct() /Users/jeremyjannotta/Documents/dev/projects/mongodb/vendor/mongodb/mongodb/src/Client.php:32\r\n```\r\n\r\nExecuting this on Mac OSX 10.11.2, PHP 5.6.14, PHPUnit 5.0.0, MongoDB driver v1.1.0."},"comment":{"url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/comments/167837817","html_url":"https://github.com/mongodb/mongo-php-driver/issues/173#issuecomment-167837817","issue_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/173","id":167837817,"user":{"login":"alcaeus","id":383198,"avatar_url":"https://avatars.githubusercontent.com/u/383198?v=3","gravatar_id":"","url":"https://api.github.com/users/alcaeus","html_url":"https://github.com/alcaeus","followers_url":"https://api.github.com/users/alcaeus/followers","following_url":"https://api.github.com/users/alcaeus/following{/other_user}","gists_url":"https://api.github.com/users/alcaeus/gists{/gist_id}","starred_url":"https://api.github.com/users/alcaeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alcaeus/subscriptions","organizations_url":"https://api.github.com/users/alcaeus/orgs","repos_url":"https://api.github.com/users/alcaeus/repos","events_url":"https://api.github.com/users/alcaeus/events{/privacy}","received_events_url":"https://api.github.com/users/alcaeus/received_events","type":"User","site_admin":false},"created_at":"2015-12-29T17:36:01Z","updated_at":"2015-12-29T17:36:01Z","body":"As commented above, I have updated to 1.1.1 which solved one segfault I was experiencing.\r\n\r\nI've previously tried running without xdebug after @jmikola suspected that and it didn't change a thing. Here's the output without xdebug:\r\n```\r\n(gdb) bt full\r\n#0  0x00000001003cbb09 in zend_hash_num_elements ()\r\nNo symbol table info available.\r\n#1  0x0000000104bf7e96 in zval_to_bson () from /usr/local/opt/php56-mongo/mongo.so\r\nNo symbol table info available.\r\n#2  0x0000000104c4f5e3 in zim_Manager___construct () from /usr/local/opt/php56-mongodb/mongodb.so\r\nNo symbol table info available.\r\n#3  0x00000001003b0ca9 in dtrace_execute_internal ()\r\nNo symbol table info available.\r\n#4  0x0000000100429fce in zend_do_fcall_common_helper_SPEC ()\r\nNo symbol table info available.\r\n#5  0x00000001003e718e in execute_ex ()\r\nNo symbol table info available.\r\n#6  0x00000001003b0be5 in dtrace_execute_ex ()\r\nNo symbol table info available.\r\n#7  0x00000001003b2f4b in zend_eval_stringl ()\r\nNo symbol table info available.\r\n#8  0x00000001003b328a in zend_eval_stringl_ex ()\r\nNo symbol table info available.\r\n#9  0x000000010044aa82 in do_cli ()\r\nNo symbol table info available.\r\n#10 0x0000000100449c8b in main ()\r\nNo symbol table info available.\r\n```\r\n\r\nAgain, disabling pecl/mongo fixes the issue.\r\n\r\nAlso:\r\n```\r\n$ php --version\r\nPHP 5.6.16 (cli) (built: Nov 27 2015 10:28:34) \r\nCopyright (c) 1997-2015 The PHP Group\r\nZend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies\r\n```"}}