{"action":"created","issue":{"url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/209","repository_url":"https://api.github.com/repos/mongodb/mongo-php-driver","labels_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/209/comments","events_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/209/events","html_url":"https://github.com/mongodb/mongo-php-driver/issues/209","id":129048044,"number":209,"title":"Segfault on 1.1.2 whenever running PHP","user":{"login":"Zenexer","id":504130,"avatar_url":"https://avatars.githubusercontent.com/u/504130?v=3","gravatar_id":"","url":"https://api.github.com/users/Zenexer","html_url":"https://github.com/Zenexer","followers_url":"https://api.github.com/users/Zenexer/followers","following_url":"https://api.github.com/users/Zenexer/following{/other_user}","gists_url":"https://api.github.com/users/Zenexer/gists{/gist_id}","starred_url":"https://api.github.com/users/Zenexer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zenexer/subscriptions","organizations_url":"https://api.github.com/users/Zenexer/orgs","repos_url":"https://api.github.com/users/Zenexer/repos","events_url":"https://api.github.com/users/Zenexer/events{/privacy}","received_events_url":"https://api.github.com/users/Zenexer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mongodb/mongo-php-driver/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2016-01-27T06:38:53Z","updated_at":"2016-03-18T15:25:52Z","closed_at":null,"body":"On Ubuntu 15.10 x64:\r\n\r\n```\r\n% sudo php5-fpm -t || echo \"Exit status: $?\"\r\n[27-Jan-2016 01:35:47] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful\r\n\r\nExit status: 139\r\n```\r\n\r\nHere's an except from catchsegv:\r\n\r\n```\r\nBacktrace:\r\nphp5-fpm[0x6dee88]\r\n/usr/lib/x86_64-linux-gnu/sasl2/libdigestmd5.so(+0x391b)[0x7f29ffd7491b]\r\n/usr/lib/x86_64-linux-gnu/libsasl2.so.2(+0x6cc9)[0x7f2a07ba5cc9]\r\n/usr/lib/x86_64-linux-gnu/libsasl2.so.2(sasl_client_done+0x2a)[0x7f2a07ba5e0a]\r\n/usr/lib/php5/20131226/mongodb.so(+0x6122e)[0x7f2a003eb22e]\r\n/lib/x86_64-linux-gnu/libpthread.so.0(+0xe36b)[0x7f2a0d3c036b]\r\n/lib64/ld-linux-x86-64.so.2(+0x10bb7)[0x7f2a0fb96bb7]\r\n/lib/x86_64-linux-gnu/libc.so.6(+0x39d32)[0x7f2a0d609d32]\r\n/lib/x86_64-linux-gnu/libc.so.6(+0x39d85)[0x7f2a0d609d85]\r\nphp5-fpm(fpm_init+0x182)[0x7b9912]\r\nphp5-fpm(main+0x776)[0x465366]\r\n/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f2a0d5f0a40]\r\nphp5-fpm(_start+0x29)[0x466539]\r\n```\r\n\r\nIf I remove package libsasl2-dev before compiling, it works fine."},"comment":{"url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/comments/198408382","html_url":"https://github.com/mongodb/mongo-php-driver/issues/209#issuecomment-198408382","issue_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/209","id":198408382,"user":{"login":"sshilko","id":1147808,"avatar_url":"https://avatars.githubusercontent.com/u/1147808?v=3","gravatar_id":"","url":"https://api.github.com/users/sshilko","html_url":"https://github.com/sshilko","followers_url":"https://api.github.com/users/sshilko/followers","following_url":"https://api.github.com/users/sshilko/following{/other_user}","gists_url":"https://api.github.com/users/sshilko/gists{/gist_id}","starred_url":"https://api.github.com/users/sshilko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sshilko/subscriptions","organizations_url":"https://api.github.com/users/sshilko/orgs","repos_url":"https://api.github.com/users/sshilko/repos","events_url":"https://api.github.com/users/sshilko/events{/privacy}","received_events_url":"https://api.github.com/users/sshilko/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T15:25:52Z","updated_at":"2016-03-18T15:25:52Z","body":"this seems to work for me now, but still testing\r\n{code}\r\n#!/bin/bash\r\n\r\n#Compiles and install mongodb extension because pecl produces segfaults and corrupts zend memory heap\r\n#https://github.com/mongodb/mongo-php-driver/issues/209\r\n\r\napt-get install php-pear -y\r\npecl uninstall mongodb\r\napt-get remove libsasl2-dev -y\r\ncd /tmp\r\nrm -rf mongo-php-driver\r\ngit clone https://github.com/mongodb/mongo-php-driver.git\r\ncd mongo-php-driver\r\ngit checkout 1.1.4\r\ngit submodule update --init\r\nphpize\r\nmake clean\r\nCFLAGS=\"-DMONGOC_NO_AUTOMATIC_GLOBALS -g -O2 -pipe\" ./configure --enable-mongodb\r\nmake && make install\r\n/etc/init.d/php7.0-fpm restart\r\n{code}\r\n\r\nand\r\n{code}\r\n/usr/sbin/php-fpm7.0 -t\r\n{code}\r\nno longer segfaults"}}