#34623 [Fbk->Opn]: Segfault when selecting 'text' field with pdo/mysql
ID: 34623 User updated by: stewey at ambitious dot ca Reported By: stewey at ambitious dot ca -Status: Feedback +Status: Open Bug Type: PDO related Operating System: Mac OS X 10.4.2 PHP Version: 5CVS-2005-09-27 (snap) New Comment: It's actually a 'longtext'. I'm very sorry for the misinformation. To the obvious question: yes, this makes the difference. If it's 'text', no problem, longtext = segfault. Again, I'm sorry. Yes, I can repro via the CLI. Would you like a backtrace of that? CREATE TABLE `article` ( `articleId` int(10) unsigned NOT NULL auto_increment, `parentId` int(10) unsigned NOT NULL default '0', `templateId` int(10) unsigned NOT NULL default '0', `title` varchar(100) NOT NULL default '', `subTitle` varchar(255) default NULL, `text` longtext NOT NULL, `creationTime` timestamp NULL default NULL, `modificationTime` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `state` enum('Online','Offline') NOT NULL default 'Online', `audience` enum('Private','Public') NOT NULL default 'Private', `childSortOrder` enum ('Title','Date','Popularity','Arbitrary') NOT NULL default 'Title', `sortWeight` int(11) NOT NULL default '0', PRIMARY KEY (`articleId`), KEY `parentId` (`parentId`,`templateId`), FULLTEXT KEY `title` (`title`,`subTitle`,`text`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Previous Comments: [2005-09-28 22:03:52] [EMAIL PROTECTED] Can't reproduce. Please show your CREATE TABLE command. Also, are you able to replicate it using PHP CLI ? [2005-09-28 17:20:35] stewey at ambitious dot ca $ ./configure --with-apxs2=/usr/local/apache2/bin/apxs -- with-mysql=/usr/local/mysql --enable-pdo --prefix=/usr/ local/php5 --with-xmlrpc --with-pdo-mysql --enable-debug $ make $ make install Hope that helps! [2005-09-28 13:03:04] [EMAIL PROTECTED] How did you compile/configure PHP? [2005-09-28 00:20:29] stewey at ambitious dot ca Bug has resurfaced. Tested with php5-200509271430. Reproduce code is the same as before. [Tue Sep 27 15:15:31 2005] [notice] child pid 15934 exit signal Segmentation fault (11) Here is the backtrace: (gdb) run -X Starting program: /usr/local/apache2/bin/httpd -X Reading symbols for shared libraries .+++ done Reading symbols for shared libraries done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x7269748d 0x020a1504 in dispatch_param_event (stmt=0x49ac08, event_type=PDO_PARAM_EVT_FETCH_POST) at /Users/stewey/ Desktop/php5-200509271430/ext/pdo/pdo_stmt.c:133 133 if (!stmt->methods->param_hook) { (gdb) bt #0 0x020a1504 in dispatch_param_event (stmt=0x49ac08, event_type=PDO_PARAM_EVT_FETCH_POST) at /Users/stewey/ Desktop/php5-200509271430/ext/pdo/pdo_stmt.c:133 #1 0x020a26b4 in do_fetch_common (stmt=0x49ac08, ori=PDO_FETCH_ORI_NEXT, offset=0, do_bind=1) at /Users/ stewey/Desktop/php5-200509271430/ext/pdo/pdo_stmt.c:542 #2 0x020a36d8 in do_fetch (stmt=0x49ac08, do_bind=1, return_value=0x49fb78, how=PDO_FETCH_ASSOC, ori=PDO_FETCH_ORI_NEXT, offset=0, return_all=0x0) at /Users/ stewey/Desktop/php5-200509271430/ext/pdo/pdo_stmt.c:754 #3 0x020a56e8 in zif_PDOStatement_fetchAll (ht=1, return_value=0x49bba8, return_value_ptr=0x0, this_ptr=0x49a7e8, return_value_used=1) at /Users/stewey/ Desktop/php5-200509271430/ext/pdo/pdo_stmt.c:1348 #4 0x0232daac in zend_do_fcall_common_helper_SPEC (execute_data=0xbfffe578) at /Users/stewey/Desktop/ php5-200509271430/Zend/zend_vm_execute.h:187 #5 0x0232eca4 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0xbfffe578) at /Users/stewey/Desktop/ php5-200509271430/Zend/zend_vm_execute.h:310 #6 0x0232d4e8 in execute (op_array=0x499678) at /Users/ stewey/Desktop/php5-200509271430/Zend/zend_vm_execute.h:88 #7 0x022ed6b0 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /Users/stewey/Desktop/php5-200509271430/ Zend/zend.c:1087 #8 0x02282420 in php_execute_script (primary_file=0xbfffef44) at /Users/stewey/Desktop/ php5-200509271430/main/main.c:1677 #9 0x023a2840 in php_handler (r=0x18bde50) at /Users/ stewey/Desktop/php5-200509271430/sapi/apache2handler/ sapi_apache2.c:568 #10 0x0003daf4 in ap_run_handler (r=0x18bde50) at config.c: 152 #11 0x0003e0bc in ap_invoke_handler (r=0x18bde50) at config.c:364 #12 0x0001203c in ap_process_request (r=0x18bde50) at http_request.c:249 #13 0xcc14 in ap_process_http_connection (c=0x18b7f28) at http_core.c:251 #14 0x00044898 in ap_run_process_connection (c=0x18b7f28) at connection.c:43 #15 0x000298f8 in child_main (child_num_arg=4828168) at prefork.c:610 #16 0x000299dc in
#34623 [Fbk->Opn]: Segfault when selecting 'text' field with pdo/mysql
ID: 34623 User updated by: stewey at ambitious dot ca Reported By: stewey at ambitious dot ca -Status: Feedback +Status: Open Bug Type: PDO related Operating System: Mac OS X 10.4.2 PHP Version: 5CVS-2005-09-27 (snap) New Comment: $ ./configure --with-apxs2=/usr/local/apache2/bin/apxs -- with-mysql=/usr/local/mysql --enable-pdo --prefix=/usr/ local/php5 --with-xmlrpc --with-pdo-mysql --enable-debug $ make $ make install Hope that helps! Previous Comments: [2005-09-28 13:03:04] [EMAIL PROTECTED] How did you compile/configure PHP? [2005-09-28 00:20:29] stewey at ambitious dot ca Bug has resurfaced. Tested with php5-200509271430. Reproduce code is the same as before. [Tue Sep 27 15:15:31 2005] [notice] child pid 15934 exit signal Segmentation fault (11) Here is the backtrace: (gdb) run -X Starting program: /usr/local/apache2/bin/httpd -X Reading symbols for shared libraries .+++ done Reading symbols for shared libraries done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x7269748d 0x020a1504 in dispatch_param_event (stmt=0x49ac08, event_type=PDO_PARAM_EVT_FETCH_POST) at /Users/stewey/ Desktop/php5-200509271430/ext/pdo/pdo_stmt.c:133 133 if (!stmt->methods->param_hook) { (gdb) bt #0 0x020a1504 in dispatch_param_event (stmt=0x49ac08, event_type=PDO_PARAM_EVT_FETCH_POST) at /Users/stewey/ Desktop/php5-200509271430/ext/pdo/pdo_stmt.c:133 #1 0x020a26b4 in do_fetch_common (stmt=0x49ac08, ori=PDO_FETCH_ORI_NEXT, offset=0, do_bind=1) at /Users/ stewey/Desktop/php5-200509271430/ext/pdo/pdo_stmt.c:542 #2 0x020a36d8 in do_fetch (stmt=0x49ac08, do_bind=1, return_value=0x49fb78, how=PDO_FETCH_ASSOC, ori=PDO_FETCH_ORI_NEXT, offset=0, return_all=0x0) at /Users/ stewey/Desktop/php5-200509271430/ext/pdo/pdo_stmt.c:754 #3 0x020a56e8 in zif_PDOStatement_fetchAll (ht=1, return_value=0x49bba8, return_value_ptr=0x0, this_ptr=0x49a7e8, return_value_used=1) at /Users/stewey/ Desktop/php5-200509271430/ext/pdo/pdo_stmt.c:1348 #4 0x0232daac in zend_do_fcall_common_helper_SPEC (execute_data=0xbfffe578) at /Users/stewey/Desktop/ php5-200509271430/Zend/zend_vm_execute.h:187 #5 0x0232eca4 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0xbfffe578) at /Users/stewey/Desktop/ php5-200509271430/Zend/zend_vm_execute.h:310 #6 0x0232d4e8 in execute (op_array=0x499678) at /Users/ stewey/Desktop/php5-200509271430/Zend/zend_vm_execute.h:88 #7 0x022ed6b0 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /Users/stewey/Desktop/php5-200509271430/ Zend/zend.c:1087 #8 0x02282420 in php_execute_script (primary_file=0xbfffef44) at /Users/stewey/Desktop/ php5-200509271430/main/main.c:1677 #9 0x023a2840 in php_handler (r=0x18bde50) at /Users/ stewey/Desktop/php5-200509271430/sapi/apache2handler/ sapi_apache2.c:568 #10 0x0003daf4 in ap_run_handler (r=0x18bde50) at config.c: 152 #11 0x0003e0bc in ap_invoke_handler (r=0x18bde50) at config.c:364 #12 0x0001203c in ap_process_request (r=0x18bde50) at http_request.c:249 #13 0xcc14 in ap_process_http_connection (c=0x18b7f28) at http_core.c:251 #14 0x00044898 in ap_run_process_connection (c=0x18b7f28) at connection.c:43 #15 0x000298f8 in child_main (child_num_arg=4828168) at prefork.c:610 #16 0x000299dc in make_child (s=0x180ad58, slot=0) at prefork.c:650 #17 0x00029b14 in startup_children (number_to_start=5) at prefork.c:722 #18 0x00029fe0 in ap_mpm_run (_pconf=0x1806418, plog=0x5, s=0x180ad58) at prefork.c:941 #19 0x0002baf4 in main (argc=2, argv=0xbb20) at main.c: 618 [2005-09-24 06:03:28] stewey at ambitious dot ca Description: Selecting a text field using PDO and the PDO MySQL driver intermittently causes a seg fault. Occurs roughly one out of two times. If I don't select the text field, it runs fine. Possibly related to Bug #33533. Reproduce code: --- $PDO = new PDO( "mysql:dbname=test;host=127.0.0.1", 'user', 'pass' ); $statement = $PDO->prepare("select * from table"); $statement->execute(); $rows = $statement->fetchAll( PDO_FETCH_ASSOC ); print_r($rows); exit; Expected result: All columns of all rows of the table. Actual result: -- [Fri Sep 23 20:55:10 2005] [notice] child pid 12721 exit signal Segmentation fault (11) -- Edit this bug report at http://bugs.php.net/?id=34623&edit=1
#34623 [Fbk->Opn]: Segfault when selecting 'text' field with pdo/mysql
ID: 34623 User updated by: stewey at ambitious dot ca Reported By: stewey at ambitious dot ca -Status: Feedback +Status: Open Bug Type: PDO related Operating System: Mac OS X 10.4.2 PHP Version: 5.1.0RC1 New Comment: Confirmed fixed in latest! That's an amazing turn-around time. You rock! Previous Comments: [2005-09-24 20:31:06] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip [2005-09-24 19:24:50] stewey at ambitious dot ca I'm not sure why there is an absolute path to my compile directory in this backtrace. Please let me know if this is indicative of a problem. (gdb) run -X Starting program: /usr/local/apache2/bin/httpd -X Reading symbols for shared libraries .+++ done Reading symbols for shared libraries done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x21007665 0x02199bf8 in _efree (ptr=0x4967d0) at /Users/stewey/ Desktop/php-5.1.0RC1/Zend/zend_alloc.c:302 302 REMOVE_POINTER_FROM_LIST(p); (gdb) bt #0 0x02199bf8 in _efree (ptr=0x4967d0) at /Users/stewey/ Desktop/php-5.1.0RC1/Zend/zend_alloc.c:302 #1 0x02064e08 in pdo_mysql_stmt_dtor (stmt=0x496380) at / Users/stewey/Desktop/php-5.1.0RC1/ext/pdo_mysql/ mysql_statement.c:62 #2 0x0205f22c in free_statement (stmt=0x496380) at /Users/ stewey/Desktop/php-5.1.0RC1/ext/pdo/pdo_stmt.c:1977 #3 0x021cba6c in zend_objects_store_del_ref (zobject=0x495800) at /Users/stewey/Desktop/php-5.1.0RC1/ Zend/zend_objects_API.c:161 #4 0x021a59d0 in _zval_ptr_dtor (zval_ptr=0x4964ec) at / Users/stewey/Desktop/php-5.1.0RC1/Zend/zend_variables.h:35 #5 0x021babd4 in zend_hash_apply_deleter (ht=0x22eb550, p=0x4964e0) at /Users/stewey/Desktop/php-5.1.0RC1/Zend/ zend_hash.c:574 #6 0x021bad98 in zend_hash_graceful_reverse_destroy (ht=0x22eb550) at /Users/stewey/Desktop/php-5.1.0RC1/Zend/ zend_hash.c:640 #7 0x021a5644 in shutdown_executor () at /Users/stewey/ Desktop/php-5.1.0RC1/Zend/zend_execute_API.c:216 #8 0x021b23cc in zend_deactivate () at /Users/stewey/ Desktop/php-5.1.0RC1/Zend/zend.c:823 #9 0x02173e20 in php_request_shutdown (dummy=0x4967d0) at / Users/stewey/Desktop/php-5.1.0RC1/main/main.c:1238 #10 0x022388c0 in php_handler (r=0x18c2fc8) at /Users/ stewey/Desktop/php-5.1.0RC1/sapi/apache2handler/ sapi_apache2.c:443 #11 0x0003daf4 in ap_run_handler (r=0x18c2fc8) at config.c: 152 #12 0x0003e0bc in ap_invoke_handler (r=0x18c2fc8) at config.c:364 #13 0x00011d28 in ap_internal_redirect (new_uri=0x4967d0 "-00-00 00:00:00", r=0x4966a0) at http_request.c:465 #14 0x00012060 in ap_process_request (r=0x18bde50) at http_request.c:262 #15 0xcc14 in ap_process_http_connection (c=0x18b7f28) at http_core.c:251 #16 0x00044898 in ap_run_process_connection (c=0x18b7f28) at connection.c:43 #17 0x000298f8 in child_main (child_num_arg=4810704) at prefork.c:610 #18 0x000299dc in make_child (s=0x180ad58, slot=0) at prefork.c:650 #19 0x00029b14 in startup_children (number_to_start=5) at prefork.c:722 #20 0x00029fe0 in ap_mpm_run (_pconf=0x1806418, plog=0x4966a0, s=0x180ad58) at prefork.c:941 #21 0x0002baf4 in main (argc=2, argv=0xbb60) at main.c: 618 [2005-09-24 11:44:48] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. [2005-09-24 06:03:28] stewey at ambitious dot ca Description: Selecting a text field using PDO and the PDO MySQL driver intermittently causes a seg fault. Occurs roughly one out of two times. If I don't select the text field, it runs fine. Possibly related to Bug #33533. Reproduce code: --- $PDO = new PDO( "mysql:dbname=test;host=127.0.0.1", 'user', 'pass' ); $statement = $PDO->prepare("select * from table"); $statement->execute(); $rows = $statement->fetchAll( PDO_FETCH_ASSOC ); print_r($rows); exit; Expected result: All columns of all rows of the table. Actual result: -- [Fri Sep 23 20:55:10 2005] [notice] child pid 12721 exit signal Segmentation fault (11) -- Edit this bug report at http://bugs.php.net/?id=34623&edit=1
#34623 [Fbk->Opn]: Segfault when selecting 'text' field with pdo/mysql
ID: 34623 User updated by: stewey at ambitious dot ca Reported By: stewey at ambitious dot ca -Status: Feedback +Status: Open Bug Type: PDO related Operating System: Mac OS X 10.4.2 PHP Version: 5.1.0RC1 New Comment: I'm not sure why there is an absolute path to my compile directory in this backtrace. Please let me know if this is indicative of a problem. (gdb) run -X Starting program: /usr/local/apache2/bin/httpd -X Reading symbols for shared libraries .+++ done Reading symbols for shared libraries done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x21007665 0x02199bf8 in _efree (ptr=0x4967d0) at /Users/stewey/ Desktop/php-5.1.0RC1/Zend/zend_alloc.c:302 302 REMOVE_POINTER_FROM_LIST(p); (gdb) bt #0 0x02199bf8 in _efree (ptr=0x4967d0) at /Users/stewey/ Desktop/php-5.1.0RC1/Zend/zend_alloc.c:302 #1 0x02064e08 in pdo_mysql_stmt_dtor (stmt=0x496380) at / Users/stewey/Desktop/php-5.1.0RC1/ext/pdo_mysql/ mysql_statement.c:62 #2 0x0205f22c in free_statement (stmt=0x496380) at /Users/ stewey/Desktop/php-5.1.0RC1/ext/pdo/pdo_stmt.c:1977 #3 0x021cba6c in zend_objects_store_del_ref (zobject=0x495800) at /Users/stewey/Desktop/php-5.1.0RC1/ Zend/zend_objects_API.c:161 #4 0x021a59d0 in _zval_ptr_dtor (zval_ptr=0x4964ec) at / Users/stewey/Desktop/php-5.1.0RC1/Zend/zend_variables.h:35 #5 0x021babd4 in zend_hash_apply_deleter (ht=0x22eb550, p=0x4964e0) at /Users/stewey/Desktop/php-5.1.0RC1/Zend/ zend_hash.c:574 #6 0x021bad98 in zend_hash_graceful_reverse_destroy (ht=0x22eb550) at /Users/stewey/Desktop/php-5.1.0RC1/Zend/ zend_hash.c:640 #7 0x021a5644 in shutdown_executor () at /Users/stewey/ Desktop/php-5.1.0RC1/Zend/zend_execute_API.c:216 #8 0x021b23cc in zend_deactivate () at /Users/stewey/ Desktop/php-5.1.0RC1/Zend/zend.c:823 #9 0x02173e20 in php_request_shutdown (dummy=0x4967d0) at / Users/stewey/Desktop/php-5.1.0RC1/main/main.c:1238 #10 0x022388c0 in php_handler (r=0x18c2fc8) at /Users/ stewey/Desktop/php-5.1.0RC1/sapi/apache2handler/ sapi_apache2.c:443 #11 0x0003daf4 in ap_run_handler (r=0x18c2fc8) at config.c: 152 #12 0x0003e0bc in ap_invoke_handler (r=0x18c2fc8) at config.c:364 #13 0x00011d28 in ap_internal_redirect (new_uri=0x4967d0 "-00-00 00:00:00", r=0x4966a0) at http_request.c:465 #14 0x00012060 in ap_process_request (r=0x18bde50) at http_request.c:262 #15 0xcc14 in ap_process_http_connection (c=0x18b7f28) at http_core.c:251 #16 0x00044898 in ap_run_process_connection (c=0x18b7f28) at connection.c:43 #17 0x000298f8 in child_main (child_num_arg=4810704) at prefork.c:610 #18 0x000299dc in make_child (s=0x180ad58, slot=0) at prefork.c:650 #19 0x00029b14 in startup_children (number_to_start=5) at prefork.c:722 #20 0x00029fe0 in ap_mpm_run (_pconf=0x1806418, plog=0x4966a0, s=0x180ad58) at prefork.c:941 #21 0x0002baf4 in main (argc=2, argv=0xbb60) at main.c: 618 Previous Comments: [2005-09-24 11:44:48] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. [2005-09-24 06:03:28] stewey at ambitious dot ca Description: Selecting a text field using PDO and the PDO MySQL driver intermittently causes a seg fault. Occurs roughly one out of two times. If I don't select the text field, it runs fine. Possibly related to Bug #33533. Reproduce code: --- $PDO = new PDO( "mysql:dbname=test;host=127.0.0.1", 'user', 'pass' ); $statement = $PDO->prepare("select * from table"); $statement->execute(); $rows = $statement->fetchAll( PDO_FETCH_ASSOC ); print_r($rows); exit; Expected result: All columns of all rows of the table. Actual result: -- [Fri Sep 23 20:55:10 2005] [notice] child pid 12721 exit signal Segmentation fault (11) -- Edit this bug report at http://bugs.php.net/?id=34623&edit=1