View Issue Details

IDProjectCategoryView StatusLast Update
0000850Xdebugpublic2013-05-25 23:18
Reporterkenorb Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionunable to reproduce 
PlatformMacOSOSXOS Version10.6.8
Summary0000850: Segmentation fault on xdebug_var_export
Description

I'm using Drupal + drush and when I'm executing specified bash script, it crashing on following command:
drush -vy -l http://aat-drupal-clean en aat_wex

I think it could be related to this:
http://bugs.xdebug.org/view.php?id=683

Steps To Reproduce

In my environment:
$ ./install_clean_drupal.sh
...
WD system: features module installed. [info]
WD system: features module enabled. [info]
./install_clean_drupal.sh: line 15: 15091 Segmentation fault drush $ENV_ARG en aat_wex

Additional Information

Last lines from the screen before the crash:
WD system: features module installed. [info]
WD system: features module enabled. [info]
./install_clean_drupal.sh: line 15: 15091 Segmentation fault drush $ENV_ARG en aat_wex

PHP 5.2.17 (cli) (built: Sep 15 2011 10:59:39)

Backtrace:
Process: php [15091]
Path: /Applications/MAMP/bin/php/php5.2.17/bin/php
Identifier: php
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: bash [14854]

Date/Time: 2012-06-06 15:17:08.801 +0100
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000000000000000d, 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 xdebug.so 0x00000001012433f3 xdebug_var_export + 931
1 xdebug.so 0x000000010124395d xdebug_get_zval_value + 125
2 xdebug.so 0x000000010123c27b xdebug_append_printable_stack + 1579
3 xdebug.so 0x0000000101222454 xdebug_throw_exception_hook + 756
4 php 0x00000001002fd167 zend_throw_exception_internal + 103
5 php 0x0000000100117b1f pdo_handle_error + 6396 php 0x000000010011cda1 zim_PDOStatement_execute + 849
7 xdebug.so 0x0000000101223927 xdebug_execute_internal + 359
8 php 0x0000000100308685 zend_do_fcall_common_helper_SPEC + 2037
9 php 0x00000001003078bc execute + 364
10 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
11 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
12 php 0x00000001003078bc execute + 364
13 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
14 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
15 php 0x00000001003078bc execute + 364
16 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
17 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
18 php 0x00000001003078bc execute + 364
19 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
20 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
21 php 0x00000001003078bc execute + 364
22 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
23 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
24 php 0x00000001003078bc execute + 364
25 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
26 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
27 php 0x00000001003078bc execute + 364
28 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
29 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
30 php 0x00000001003078bc execute + 36431 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
32 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
33 php 0x00000001003078bc execute + 364
34 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
35 php 0x00000001002db43a zend_call_function + 2634
36 php 0x00000001002dc662 call_user_function_ex + 66
37 php 0x000000010022be8c zif_call_user_func_array + 748
38 xdebug.so 0x0000000101223927 xdebug_execute_internal + 359
39 php 0x0000000100308685 zend_do_fcall_common_helper_SPEC + 2037
40 php 0x00000001003078bc execute + 364
41 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
42 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
43 php 0x00000001003078bc execute + 364
44 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
45 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
46 php 0x00000001003078bc execute + 364
47 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
48 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
49 php 0x00000001003078bc execute + 364
50 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
51 php 0x00000001002db43a zend_call_function + 2634
52 php 0x00000001002dc662 call_user_function_ex + 66
53 php 0x000000010022be8c zif_call_user_func_array + 748
54 xdebug.so 0x0000000101223927 xdebug_execute_internal + 359
55 php 0x0000000100308685 zend_do_fcall_common_helper_SPEC + 2037
56 php 0x00000001003078bc execute + 364
57 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
58 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
59 php 0x00000001003078bc execute + 364
60 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
61 php 0x00000001002db43a zend_call_function + 2634
62 php 0x00000001002dc662 call_user_function_ex + 66
63 php 0x000000010022be8c zif_call_user_func_array + 748
64 xdebug.so 0x0000000101223927 xdebug_execute_internal + 359
65 php 0x0000000100308685 zend_do_fcall_common_helper_SPEC + 2037
66 php 0x00000001003078bc execute + 364
67 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
68 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
69 php 0x00000001003078bc execute + 364
70 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
71 php 0x0000000100308273 zend_do_fcall_common_helper_SPEC + 995
72 php 0x00000001003078bc execute + 364
73 xdebug.so 0x00000001012235f3 xdebug_execute + 3331
74 php 0x00000001002e6bc7 zend_execute_scripts + 375
75 php 0x000000010029fd5a php_execute_script + 586
76 php 0x0000000100371d95 main + 5365
77 php 0x00000001000014d4 start + 52

Check the attachments for the full backtrace.

TagsNo tags attached.
Attached Files
Operating System
PHP Version5.2.10

Activities

kenorb

2012-06-06 14:44

reporter   ~0002233

Following function can cause the problem:
<?php

/**

  • Log and display the error
  • @param string $group Name of error group to report
  • @param string $error Error to report
  • @param object/array $object Object to include with the log
  • @param bool $backtrace TRUE if watchdog log should include full backtrace of the error
    */
    function aat_wex_log($group, $error, $object = NULL, $backtrace = TRUE) {
    $object_msg = $object ? 'Object: ' . var_export($object, TRUE) : '';
    $bt = $backtrace ? 'Backtrace: ' . var_export(debug_backtrace(), TRUE) : '';
    watchdog($group, "Error message: %error
    \n%object
    \n%bt", array('%error' => $error, '%object' => $object_msg, '%bt' => $bt), WATCHDOG_ERROR);
    $last_id = db_query("SELECT 1", array(), array('return' => Database::RETURN_INSERT_ID));
    $msg = t("Error: !id", array('!id' => $last_id));
    $err_msg = user_access('access site reports') ? l($msg, 'admin/reports/event/' . $last_id) : $msg;
    drupal_set_message($err_msg, 'error');
    }
    ?>
    This is the only place, where I'm using var_export().

kenorb

2012-06-06 15:34

reporter   ~0002234

Usually this function is executed when there is an Exception (try/catch).

kenorb

2012-06-07 09:22

reporter   ~0002235

This is what was called in PHP before the crash:
24.3217 54977744 -> Database::getConnection($target = ???, $key = ???) /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:2685 => $key = 'default' /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:1444

=> class DatabaseConnection_mysql { protected $shutdownRegistered = FALSE; protected $target = 'default'; protected $key = 'default'; protected $logger = NULL; protected $transactionLayers = array (); protected $driverClasses = array ('InsertQuery' => 'InsertQuery_mysql', 'MergeQuery' => 'MergeQuery', 'DatabaseTransaction' => 'DatabaseTransaction', 'SelectQuery' => 'SelectQuery', 'DeleteQuery' => 'DeleteQuery', 'DatabaseSchema' => 'DatabaseSchema_mysql', 'UpdateQuery' => 'UpdateQuery'); protected $statementClass = 'DatabaseStatementBase'; protected $transactionSupport = TRUE; protected $transactionalDDLSupport = FALSE; protected $temporaryNameIndex = 0; protected $connectionOptions = array ('database' => 'aat_clean_drupal2', 'username' => 'root', 'password' => 'root', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => array (...)); protected $schema = class DatabaseSchema_mysql { protected $connection = ...; protected $placeholder = 0; protected $defaultSchema = 'public'; protected $uniqueIdentifier = '4fd0724f48a245.45588987' }; protected $prefixes = array ('default' => ''); protected $prefixSearch = array (0 => '{', 1 => '}'); protected $prefixReplace = array (0 => '', 1 => '') } 24.3219 54977744 -> DatabaseConnection->schema() /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:2685
=> class DatabaseSchema_mysql { protected $connection = class DatabaseConnection_mysql { protected $shutdownRegistered = FALSE; protected $target = 'default'; protected $key = 'default'; protected $logger = NULL; protected $transactionLayers = array (...); protected $driverClasses = array (...); protected $statementClass = 'DatabaseStatementBase'; protected $transactionSupport = TRUE; protected $transactionalDDLSupport = FALSE; protected $temporaryNameIndex = 0; protected $connectionOptions = array (...); protected $schema = ...; protected $prefixes = array (...); protected $prefixSearch = array (...); protected $prefixReplace = array (...) }; protected $placeholder = 0; protected $defaultSchema = 'public'; protected $uniqueIdentifier = '4fd0724f48a245.45588987' }
24.3219 54977744 -> DatabaseSchema->createTable($name = 'ctools_object_cache', $table = array ('description' => 'A special cache used to store objects that are being edited; it serves to save state in an ordinarily stateless environment.', 'fields' => array ('sid' => array (...), 'name' => array (...), 'obj' => array (...), 'updated' => array (...), 'data' => array (...)), 'primary key' => array (0 => 'sid', 1 => 'obj', 2 => 'name'), 'indexes' => array ('updated' => array (...)), 'module' => 'ctools', 'name' => 'ctools_object_cache')) /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:2685 24.3220 54978680 -> DatabaseSchema_mysql->tableExists($table = 'ctools_object_cache') /Users/kenorb/Sites/AAT/docroot/includes/database/schema.inc:656 24.3221 54979240 -> DatabaseConnection_mysql->queryRange($query = 'SELECT 1 FROM {ctools_object_cache}', $from = 0, $count = 1, $args = ???, $options = ???) /Users/kenorb/Sites/AAT/docroot/includes/database/mysql/schema.inc:507 24.3221 54980672 -> DatabaseConnection->query($query = 'SELECT 1 FROM {ctools_object_cache} LIMIT 0, 1', $args = array (), $options = array ()) /Users/kenorb/Sites/AAT/docroot/includes/database/mysql/database.inc:82 24.3221 54982784 -> DatabaseConnection->defaultOptions() /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:651 >=> array ('target' => 'default', 'fetch' => 5, 'return' => 1, 'throw_exception' => TRUE) => $options += array ('target' => 'default', 'fetch' => 5, 'return' => 1, 'throw_exception' => TRUE) /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:651 24.3222 54983960 -> DatabaseConnection->expandArguments($query = 'SELECT 1 FROM {ctools_object_cache} LIMIT 0, 1', $args = array ()) /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:662
=> $modified = FALSE /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:714
24.3223 54985856 -> array_filter(array (), 'is_array') /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:718
=> array ()
=> FALSE 24.3223 54983960 -> DatabaseConnection->prepareQuery($query = 'SELECT 1 FROM {ctools_object_cache} LIMIT 0, 1') /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:663 24.3223 54984312 -> DatabaseConnection->prefixTables($sql = 'SELECT 1 FROM {ctools_object_cache} LIMIT 0, 1') /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:461
24.3224 54984632 -> str_replace(array (0 => '{', 1 => '}'), array (0 => '', 1 => ''), 'SELECT 1 FROM {ctools_object_cache} LIMIT 0, 1') /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:429 >=> 'SELECT 1 FROM ctools_object_cache LIMIT 0, 1' >=> 'SELECT 1 FROM ctools_object_cache LIMIT 0, 1' => $query = 'SELECT 1 FROM ctools_object_cache LIMIT 0, 1' /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:461
24.3224 54984472 -> PDO->prepare('SELECT 1 FROM ctools_object_cache LIMIT 0, 1') /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:464 24.3225 54985776 -> DatabaseStatementBase->__construct($dbh = class DatabaseConnection_mysql { protected $shutdownRegistered = FALSE; protected $target = 'default'; protected $key = 'default'; protected $logger = NULL; protected $transactionLayers = array (); protected $driverClasses = array ('InsertQuery' => 'InsertQuery_mysql', 'MergeQuery' => 'MergeQuery', 'DatabaseTransaction' => 'DatabaseTransaction', 'SelectQuery' => 'SelectQuery', 'DeleteQuery' => 'DeleteQuery', 'DatabaseSchema' => 'DatabaseSchema_mysql', 'UpdateQuery' => 'UpdateQuery'); protected $statementClass = 'DatabaseStatementBase'; protected $transactionSupport = TRUE; protected $transactionalDDLSupport = FALSE; protected $temporaryNameIndex = 0; protected $connectionOptions = array
('database' => 'aat_clean_drupal2', 'username' => 'root', 'password' => 'root', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => array (...)); protected $schema = class DatabaseSchema_mysql { protected $connection = ...; protected $placeholder = 0; protected $defaultSchema = 'public'; protected $uniqueIdentifier = '4fd0724f48a245.45588987' }; protected $prefixes = array ('default
' => ''); protected $prefixSearch = array (0 => '{', 1 => '}'); protected $prefixReplace = array (0 => '', 1 => '') }) /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:0
=> $this->dbh = class DatabaseConnection_mysql { protected $shutdownRegistered = FALSE; protected $target = 'default'; protected $key
= 'default'; protected $logger = NULL; protected $transactionLayers = array (); protected $driverClasses = array ('InsertQuery' => 'InsertQuery_mysql', 'MergeQuery' => 'MergeQuery', 'DatabaseTransactio
n' => 'DatabaseTransaction', 'SelectQuery' => 'SelectQuery', 'DeleteQuery' => 'DeleteQuery', 'DatabaseSchema' => 'DatabaseSchema_mysql', 'UpdateQuery' => 'UpdateQuery'); protected $statementClass = 'Dat
abaseStatementBase'; protected $transactionSupport = TRUE; protected $transactionalDDLSupport = FALSE; protected $temporaryNameIndex = 0; protected $connectionOptions = array ('database' => 'aat_clean_d
rupal2', 'username' => 'root', 'password' => 'root', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => array (...)); protected $schema = class DatabaseSchema_mysql { protected $conne
ction = ...; protected $placeholder = 0; protected $defaultSchema = 'public'; protected $uniqueIdentifier = '4fd0724f48a245.45588987' }; protected $prefixes = array ('default' => ''); protected $prefixS
earch = array (0 => '{', 1 => '}'); protected $prefixReplace = array (0 => '', 1 => '') } /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:2114
24.3226 54986216 -> PDOStatement->setFetchMode(5) /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:2115

=> TRUE
=> NULL
=> class DatabaseStatementBase { public $dbh = class DatabaseConnection_mysql { protected $shutdownRegistered = FALSE; protected $target = 'default'; protected $key = 'default'; protected $logger = NULL; protected $transactionLayers = array (...); protected $driverClasses = array (...); protected $statementClass = 'DatabaseStatementBase'; protected $transactionSupport = TRUE; protected $transactionalDDLSupport = FALSE; protected $temporaryNameIndex = 0; protected $connectionOptions = array (...); protected $schema = class DatabaseSchema_mysql { ... }; protected $prefixes = array (...); protected $prefixSearch = array (...); protected $prefixReplace = array (...) }; public $queryString = 'SELECT 1 FROM ctools_object_cache LIMIT 0, 1' }
=> class DatabaseStatementBase { public $dbh = class DatabaseConnection_mysql { protected $shutdownRegistered = FALSE; protected $target = 'default'; protected $key = 'default'; protected $logger = NULL; protected $transactionLayers = array (...); protected $driverClasses = array (...); protected $statementClass = 'DatabaseStatementBase'; protected $transactionSupport = TRUE; protected $transactionalDDLSupport = FALSE; protected $temporaryNameIndex = 0; protected $connectionOptions = array (...); protected $schema = class DatabaseSchema_mysql { ... }; protected $prefixes = array (...); protected $prefixSearch = array (...); protected $prefixReplace = array (...) }; public $queryString = 'SELECT 1 FROM ctools_object_cache LIMIT 0, 1' }
=> $stmt = class DatabaseStatementBase { public $dbh = class DatabaseConnection_mysql { protected $shutdownRegistered = FALSE; protected $target = 'default'; protected $key = 'default'; protected $logger = NULL; protected $transactionLayers = array (...); protected $driverClasses = array (...); protected $statementClass = 'DatabaseStatementBase'; protected $transactionSupport = TRUE; protected $transactionalDDLSupport = FALSE; protected $temporaryNameIndex = 0; protected $connectionOptions = array (...); protected $schema = class DatabaseSchema_mysql { ... }; protected $prefixes = array (...); protected $prefixSearch = array (...); protected $prefixReplace = array (...) }; public $queryString = 'SELECT 1 FROM ctools_object_cache LIMIT 0, 1' } /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:663
24.3228 54985160 -> DatabaseStatementBase->execute($args = array (), $options = array ('target' => 'default', 'fetch' => 5, 'return' => 1, 'throw_exception' => TRUE)) /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:664
24.3229 54986792 -> is_string(5) /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:2120
=> FALSE
24.3229 54986792 -> PDOStatement->setFetchMode(5) /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:2127
=> TRUE
24.3229 54986752 -> DatabaseConnection->getLogger() /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:2131
=> NULL
=> $logger = NULL /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:2131
24.3230 54986888 -> PDOStatement->execute(array ()) /Users/kenorb/Sites/AAT/docroot/includes/database/database.inc:2136

kenorb

2012-06-07 09:59

reporter   ~0002236

Can't reproduce on PHP 5.3.6 with xdebug enabled.

derick

2012-06-07 12:01

administrator   ~0002238

Keborb, it would be really helpful if you could reproduce this with one single small script that doesn't rely on anything Drupal.

derick

2012-06-27 21:10

administrator   ~0002297

Could you please provide the requested information?

derick

2012-12-17 19:28

administrator   ~0002390

No information provided and I can't reproduce this. Closing, but feel free to reopen if you can provide the requested information.

Issue History

Date Modified Username Field Change
2012-06-06 14:42 kenorb New Issue
2012-06-06 14:42 kenorb File Added: php_2012-06-06-151709_kenorbs-MacBook-Air.crash
2012-06-06 14:43 kenorb File Added: php_2012-05-30-122809_kenorbs-MacBook-Air.crash
2012-06-06 14:43 kenorb File Added: php_2012-06-06-151147_kenorbs-MacBook-Air.crash
2012-06-06 14:44 kenorb Note Added: 0002233
2012-06-06 15:34 kenorb Note Added: 0002234
2012-06-07 09:22 kenorb Note Added: 0002235
2012-06-07 09:59 kenorb Note Added: 0002236
2012-06-07 12:01 derick Note Added: 0002238
2012-06-07 12:01 derick Assigned To => derick
2012-06-07 12:01 derick Status new => feedback
2012-06-27 21:10 derick Note Added: 0002297
2012-12-17 19:28 derick Note Added: 0002390
2013-05-25 23:18 derick Status feedback => resolved
2013-05-25 23:18 derick Resolution open => unable to reproduce
2016-07-31 12:35 derick Category Debug client (console) => debugclient (debugging tool)
2016-07-31 12:35 derick Category debugclient (debugging tool) => (No Category)