Bug #71569 [NEW]: #70389 fix causes segmentation fault

From: Date: Thu, 11 Feb 2016 11:56:20 +0000
Subject: Bug #71569 [NEW]: #70389 fix causes segmentation fault
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199163@lists.php.net to get a copy of this message
From: pavel2000 at ngs dot ru Operating system: PHP version: 5.6.18 Package: PDO related Bug Type: Bug Bug description:#70389 fix causes segmentation fault Description: ------------ Hi! We began to get segfaults after updating 5.6.7 up to 5.6.17 on our Debian 7 box. While searching for the causes of this, we found that resolution of https://bugs.php.net/bug.php?id=70389 (http://git.php.net/?p=php-src.git;a=commit;h=ef1bd8f0e6f88b1d123cea1c0b5079cfde7f90df) introduces regression. Please look into the backtrace we get: Program received signal SIGSEGV, Segmentation fault. _zend_mm_free_int (heap=0xdc7c30, p=0x7ffff7ea4058) at /home/t/php-5.6.17/Zend/zend_alloc.c:2104 2104 /home/t/php-5.6.17/Zend/zend_alloc.c: No such file or directory. (gdb) bt #0 _zend_mm_free_int (heap=0xdc7c30, p=0x7ffff7ea4058) at /home/t/php-5.6.17/Zend/zend_alloc.c:2104 #1 0x00007fffe6543c05 in pdo_mysql_handle_factory (dbh=0x25cbd00, driver_options=0x22e5d68) at /home/t/php-5.6.17/ext/pdo_mysql/mysql_driver.c:685 #2 0x00007ffff5d2f1ba in zim_PDO_dbh_constructor () at /build/php5-5.6.17+dfsg/ext/pdo/pdo_dbh.c:389 #3 0x00000000006e5cd2 in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7fac858) at /home/t/php-5.6.17/Zend/zend_vm_execute.h:558 #4 0x00000000006aa728 in execute_ex (execute_data=0x7ffff7fac858) at /home/t/php-5.6.17/Zend/zend_vm_execute.h:363 #5 0x0000000000642a89 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /home/t/php-5.6.17/Zend/zend.c:1341 #6 0x00000000005df042 in php_execute_script (primary_file=primary_file@entry=0x7fffffffd290) at /home/t/php-5.6.17/main/main.c:2597 #7 0x00000000006e8f79 in do_cli (argc=6, argv=0xdc7890) at /home/t/php-5.6.17/sapi/cli/php_cli.c:994 #8 0x0000000000427a1d in main (argc=6, argv=0xdc7890) at /home/t/php-5.6.17/sapi/cli/php_cli.c:1378 mysql_driver.c has following lines of this process: 687: default_group= pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL TSRMLS_CC); ... 685: efree(default_group) <--- crashed here Fix #70389 changes pdo_attr_strval() implementation. After replacing pdo_mysql.so to file from 5.6.7 problem disappears (and #70389 comes back). All indicates that the reason for crashes we got is #70389 regression. Please note, what we use MYSQL_ATTR_READ_DEFAULT_GROUP flag in our code, it was set it to string value: PDO::MYSQL_ATTR_READ_DEFAULT_GROUP => 'client-section' Sorry, I'm unable to provide more info such as test PHP script or a patch, as I'm not PHP or C qualified developer. But I think my ticket and backtrace can be useful point of start to review #70389 / ef1bd8f0e6f88b1d123cea1c0b5079cfde7f90df again. Thanks. -- Edit bug report at https://bugs.php.net/bug.php?id=71569&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71569&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71569&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71569&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71569&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71569&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71569&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71569&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71569&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71569&r=support Expected behavior: https://bugs.php.net/fix.php?id=71569&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71569&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71569&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71569&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71569&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71569&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71569&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71569&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71569&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71569&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71569&r=mysqlcfg

« previous php.bugs (#199163) next »