View Issue Details

IDProjectCategoryView StatusLast Update
0001360XdebugUncategorizedpublic2017-01-13 16:51
ReporterBlizz Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionno change required 
PlatformDockerOSDebianOS VersionJessie
Product Version2.4.1 
Summary0001360: Xdebug enabled causes Segfaults
Description

I'm experiencing a problem similar to the one described in ticket 0001339, but I decided to open a separate ticket in case you want to threat it as a different one.

While unit testing code developed against Laravel 5.3.22 Xdebug seems to cause a crash when trying to execute a statement that results in a "QueryException". With xdebug disabled, the code "correctly" finishes, displaying the exception results.

Steps To Reproduce

Attempt a save operation with a record not having a specific field on a table not having a default value for that field.

Normal result:

Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1364 Field 'parent_id' doesn't have a default value (SQL: insert into categories (title, created_at) values (Testing Category, 2016-11-03 14:20:42))

/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:769
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:725
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:480
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:434
/app/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php:32
/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2152
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1451
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1607
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1576
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1472
/app/tests/unit/packages/content/CategoryTest.php:18

Caused by
Doctrine\DBAL\Driver\PDOException: SQLSTATE[HY000]: General error: 1364 Field 'parent_id' doesn't have a default value

/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:479
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:762
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:725
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:480
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:434
/app/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php:32
/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2152
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1451
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1607
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1576
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1472
/app/tests/unit/packages/content/CategoryTest.php:18

Caused by
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'parent_id' doesn't have a default value

/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:479
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:762
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:725
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:480
/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:434
/app/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php:32
/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2152
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1451
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1607
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1576
/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1472
/app/tests/unit/packages/content/CategoryTest.php:18

With xdebug: segfault.

Additional Information

Attached is the full backtrace, this is the regular one:

#0 0x00007f004f7e1d8b in xdebug_objdebug_pp (zval_pp=0x7ffca9b864c8, is_tmp=0x7ffca9b86414) at /tmp/pear/temp/xdebug/xdebug_var.c:57
#1 0x00007f004f7e4446 in xdebug_var_export (struc=0x7ffca9b864c8, str=0x7ffca9b864d0, level=1, debug_zval=0, options=0x1bd1e20) at /tmp/pear/temp/xdebug/xdebug_var.c:1120
0000002 0x00007f004f7e4822 in xdebug_get_zval_value (val=0x7f004fa19980, debug_zval=0, options=0x1bd1e20) at /tmp/pear/temp/xdebug/xdebug_var.c:1192
0000003 0x00007f004f7da5ff in add_single_value (str=0x7ffca9b86610, zv=0x7f004fa19980, html=0, collecton_level=4) at /tmp/pear/temp/xdebug/xdebug_stack.c:394
0000004 0x00007f004f7daaa4 in xdebug_append_printable_stack (str=0x7ffca9b86610, html=0) at /tmp/pear/temp/xdebug/xdebug_stack.c:483
0000005 0x00007f004f7bee14 in xdebug_throw_exception_hook (exception=0x7ffca9b86720) at /tmp/pear/temp/xdebug/xdebug.c:1515
0000006 0x00000000009562f5 in zend_throw_exception_internal (exception=0x7ffca9b86720) at /tmp/php-7.0.12/Zend/zend_exceptions.c:163
0000007 0x000000000095a5a9 in zend_throw_exception_object (exception=0x7ffca9b86720) at /tmp/php-7.0.12/Zend/zend_exceptions.c:1093
0000008 0x00000000006c1457 in pdo_handle_error (dbh=0x7f004a0be380, stmt=0x7f0049982380) at /tmp/php-7.0.12/ext/pdo/pdo_dbh.c:164
0000009 0x00000000006c7cdd in zim_PDOStatement_execute (execute_data=0x7f004fa1a200, return_value=0x7f004fa1a1d0) at /tmp/php-7.0.12/ext/pdo/pdo_stmt.c:539
0000010 0x000000000098776d in execute_internal (execute_data=0x7f004fa1a200, return_value=0x7f004fa1a1d0) at /tmp/php-7.0.12/Zend/zend_execute.c:2045
0000011 0x00007f004f7c0365 in xdebug_execute_internal (current_execute_data=0x7f004fa1a200, return_value=0x7f004fa1a1d0) at /tmp/pear/temp/xdebug/xdebug.c:2050
0000012 0x000000000098a000 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:844
0000013 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000014 0x0000000000988e63 in execute_ex (ex=0x7f004fa1a140) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000015 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa1a140) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000016 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000017 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000018 0x0000000000988e63 in execute_ex (ex=0x7f004fa1a030) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000019 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa1a030) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000020 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000021 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000022 0x0000000000988e63 in execute_ex (ex=0x7f004fa19f20) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000023 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19f20) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000024 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000025 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000026 0x0000000000988e63 in execute_ex (ex=0x7f004fa19d90) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000027 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19d90) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000028 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000029 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000030 0x0000000000988e63 in execute_ex (ex=0x7f004fa19cf0) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000031 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19cf0) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000032 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000033 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000034 0x0000000000988e63 in execute_ex (ex=0x7f004fa19c60) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
#35 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19c60) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000036 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000037 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000038 0x0000000000988e63 in execute_ex (ex=0x7f004fa19b20) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000039 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19b20) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000040 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000041 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000042 0x0000000000988e63 in execute_ex (ex=0x7f004fa19a10) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000043 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19a10) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000044 0x000000000091676f in zend_call_function (fci=0x7ffca9b872f0, fci_cache=0x7ffca9b872c0) at /tmp/php-7.0.12/Zend/zend_execute_API.c:856
0000045 0x0000000000798903 in zif_call_user_func_array (execute_data=0x7f004fa19990, return_value=0x7f004fa19930) at /tmp/php-7.0.12/ext/standard/basic_functions.c:4803
0000046 0x000000000098776d in execute_internal (execute_data=0x7f004fa19990, return_value=0x7f004fa19930) at /tmp/php-7.0.12/Zend/zend_execute.c:2045
0000047 0x00007f004f7c0365 in xdebug_execute_internal (current_execute_data=0x7f004fa19990, return_value=0x7f004fa19930) at /tmp/pear/temp/xdebug/xdebug.c:2050
0000048 0x000000000098a000 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:844
#49 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000050 0x0000000000988e63 in execute_ex (ex=0x7f004fa19770) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
#51 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19770) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000052 0x000000000098d01d in ZEND_CALL_TRAMPOLINE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1750
0000053 0x0000000000988e63 in execute_ex (ex=0x7f004fa19770) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000054 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19770) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000055 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000056 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000057 0x0000000000988e63 in execute_ex (ex=0x7f004fa19680) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000058 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19680) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000059 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000060 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000061 0x0000000000988e63 in execute_ex (ex=0x7f004fa19540) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000062 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19540) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000063 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000064 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000065 0x0000000000988e63 in execute_ex (ex=0x7f004fa193f0) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000066 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa193f0) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000067 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000068 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000069 0x0000000000988e63 in execute_ex (ex=0x7f004fa19240) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000070 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa19240) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000071 0x000000000091676f in zend_call_function (fci=0x7ffca9b87c80, fci_cache=0x7ffca9b87c50) at /tmp/php-7.0.12/Zend/zend_execute_API.c:856
0000072 0x000000000072450c in zim_reflection_method_invokeArgs (execute_data=0x7f004fa191c0, return_value=0x7f004fa18e90) at /tmp/php-7.0.12/ext/reflection/php_reflection.c:3346
0000073 0x000000000098776d in execute_internal (execute_data=0x7f004fa191c0, return_value=0x7f004fa18e90) at /tmp/php-7.0.12/Zend/zend_execute.c:2045
0000074 0x00007f004f7c0365 in xdebug_execute_internal (current_execute_data=0x7f004fa191c0, return_value=0x7f004fa18e90) at /tmp/pear/temp/xdebug/xdebug.c:2050
0000075 0x000000000098a000 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:844
0000076 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000077 0x0000000000988e63 in execute_ex (ex=0x7f004fa18c90) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000078 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa18c90) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000079 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000080 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000081 0x0000000000988e63 in execute_ex (ex=0x7f004fa18420) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000082 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa18420) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000083 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000084 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000085 0x0000000000988e63 in execute_ex (ex=0x7f004fa175f0) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000086 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa175f0) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000087 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000088 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000089 0x0000000000988e63 in execute_ex (ex=0x7f004fa16b90) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000090 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa16b90) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000091 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000092 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000093 0x0000000000988e63 in execute_ex (ex=0x7f004fa165b0) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000094 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa165b0) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000095 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000096 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000097 0x0000000000988e63 in execute_ex (ex=0x7f004fa15fd0) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000098 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa15fd0) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000099 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000100 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000101 0x0000000000988e63 in execute_ex (ex=0x7f004fa147d0) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000102 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa147d0) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000103 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000104 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000105 0x0000000000988e63 in execute_ex (ex=0x7f004fa14290) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000106 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa14290) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000107 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000108 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000109 0x0000000000988e63 in execute_ex (ex=0x7f004fa141a0) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000110 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa141a0) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000111 0x0000000000989e49 in ZEND_DO_FCALL_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:800
0000112 0x000000000098c61a in ZEND_USER_OPCODE_SPEC_HANDLER () at /tmp/php-7.0.12/Zend/zend_vm_execute.h:1568
0000113 0x0000000000988e63 in execute_ex (ex=0x7f004fa14030) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:414
0000114 0x00007f004f7bfdfd in xdebug_execute_ex (execute_data=0x7f004fa14030) at /tmp/pear/temp/xdebug/xdebug.c:1900
0000115 0x0000000000988f78 in zend_execute (op_array=0x7f004fa83000, return_value=0x0) at /tmp/php-7.0.12/Zend/zend_vm_execute.h:458
0000116 0x000000000092de0c in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /tmp/php-7.0.12/Zend/zend.c:1427
0000117 0x00000000008a058e in php_execute_script (primary_file=0x7ffca9b8bed0) at /tmp/php-7.0.12/main/main.c:2494
0000118 0x00000000009ede36 in do_cli (argc=3, argv=0x19c7030) at /tmp/php-7.0.12/sapi/cli/php_cli.c:974

I'll add my phpinfo as a note

TagsNo tags attached.
Attached Files
gdb-bt-full.txt (40,699 bytes)   
php-info.txt (33,161 bytes)   
gdb-full-2.5.0-dev.txt (46,383 bytes)   
Operating System
PHP Version7.0.10-7.0.14

Activities

Blizz

2016-11-03 14:36

reporter   ~0003733

php info added as 2nd attachment instead.

derick

2016-11-03 14:45

administrator   ~0003734

I'm pretty sure I've fixed this in Git already. Could you try the latest master branch from github.com/xdebug/xdebug please? I'm near releasing 2.5.0alpha1 with this fix too.

Blizz

2016-11-03 14:51

reporter   ~0003735

This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.5.0-dev, Copyright (c) 2002-2016, by Derick Rethans


PHPUnit 5.6.2 by Sebastian Bergmann and contributors.

Segmentation fault (core dumped)


It seems not in this case.

I'll attach an update full backtrace but it looks pretty much the same as my initial one.

derick

2016-11-03 15:00

administrator   ~0003736

Okay - thanks for trying.

Can you provide me with all the steps that I need to (try) to reproduce this please?

Blizz

2016-11-03 16:10

reporter   ~0003737

Took me a while, but I succeeded.

I've managed to reproduce this on a vanilla install of Laravel 5.3 with the following code:
(just save this in the main root where the "artisan" file resides) and execute with "php crash.php".

No special dependencies included in composer.json, just laravel/framework (5.3.*)

<?php
require DIR . '/bootstrap/autoload.php';
$app = require_once DIR . '/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();

class Category extends \Illuminate\Database\Eloquent\Model
{
public $timestamps = [self::CREATED_AT];

public function setCreatedAt($value)
{
    if ($this->timestamps === true || (is_array($this->timestamps) && in_array(static::CREATED_AT, $this->timestamps)))
        $this->{static::CREATED_AT} = $value;
    return $this;
}

}

$category = new Category();
$category->name = 'test';
$category->save();


Observation: It does not matter that the underlying table doesn't exist, the segmentation fault basically occurs on any exception being thrown.

After some further testing it turns out that the fault is only raised if a read and an assignment operation follow each other.

I've tried the following things (keeping the function and the "return $this"-statement):

$this->{static::CREATED_AT} = $value;
[OK]


if ($this->timestamps !== true)
echo 'test';
[OK]


if ($this->timestamps !== true)
$this->{static::CREATED_AT} = $value;
[CRASH]


if (is_array($this->timestamps))
$this->{static::CREATED_AT} = $value;
[CRASH]


$this->timestamps !== true;
$this->{static::CREATED_AT} = $value;
[CRASH]


is_array($this->timestamps);
$this->{static::CREATED_AT} = $value;
[CRASH]

Blizz

2016-11-03 16:49

reporter   ~0003738

It gets even weirder: Apparently there needs to be a static read access as well...

$this->timestamps !== true;
$this->created_at = $value;
[OK]


static::CREATED_AT;
$this->created_at = $value;
[OK]


$this->timestamps !== true;
static::CREATED_AT;
$this->created_at = $value;
[CRASH]


Order in which they occur doesn't seem to matter:

static::CREATED_AT;
$this->timestamps !== true;
$this->created_at = $value;
[CRASH]


$this->created_at = $value;
static::CREATED_AT;
$this->timestamps !== true;
[CRASH]

derick

2016-11-03 16:55

administrator   ~0003739

I don't know Laravel. Can you give me a list of the exact things to run in a newly created directory?

Blizz

2016-11-03 17:00

reporter   ~0003740

Create a boilerplate project by running:

composer create-project --prefer-dist laravel/laravel testproject

Then open the .env file in there, modify the DB_ constants.
After that you should be in business

derick

2016-11-04 23:37

administrator   ~0003742

I can reproduce this with your test case, but also managed to get a smaller one:

<?php
class Foo
{
function _insertGridId( $a, $b )
{
var_dump ($a, $b);
trigger_error( 'ERROR' );
}

function __call($name, $args)
{
    call_user_func_array( [ $this, "_{$name}" ], $args );
}

}

$f = new Foo;
$f->insertGridId( 42, 54 );
?>

Blizz

2016-11-14 11:25

reporter   ~0003743

Small question: Now that you can reproduce it, is there a possible option for XDebug that I can switch off to not encounter that Segfault while keeping debugging functionality? I'm doing a lot of debugging lately and I keep running into the crash.

Thanks.

derick

2016-11-16 12:58

administrator   ~0003747

Sorry - I can't think of any, except for perhaps setting xdebug.collect_params=0.

Blizz

2016-11-17 20:29

reporter   ~0003761

FYI: I set collect_params from 4 to 0 and that seems to have resolved it for now (at least regarding phpunit and phpspec, haven't had the chance to test the web-side of the code yet)

derick

2016-12-04 16:40

administrator   ~0003917

I am pretty sure that I have fixed the crash related to objdebug_pp, as shown in your backtrace. Could you please try the latest version from GIT again?

Blizz

2016-12-04 20:39

reporter   ~0003934

Tried it and it still segfaulted on my unit tests.
So I compiled php in debug mode again to generate a stacktrace.
It seems to be a different one this time, so might be an unrelated problem.

Here is the head of it:

Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f6eb17e3077 in xdebug_array_element_export (zv_nptr=0x7fff4a13f3b0, index=140734436209664, hash_key=0x2b17bdc24, level=1, str=0x7fff4a13d7d0, debug_zval=0, options=0x22d1940)
at /tmp/xdebug/xdebug_var.c:939
939 tmp = xdebug_str_to_str((char*) HASH_APPLY_KEY_VAL(hash_key), HASH_APPLY_KEY_LEN(hash_key), "'", 1, "\'", 2, &newlen);
(gdb) bt
#0 0x00007f6eb17e3077 in xdebug_array_element_export (zv_nptr=0x7fff4a13f3b0, index=140734436209664, hash_key=0x2b17bdc24, level=1, str=0x7fff4a13d7d0, debug_zval=0, options=0x22d1940)
at /tmp/xdebug/xdebug_var.c:939
#1 0x00007f6eb17e3aab in xdebug_var_export (struc=0x7fff4a13d7c8, str=0x7fff4a13d7d0, level=1, debug_zval=0, options=0x22d1940) at /tmp/xdebug/xdebug_var.c:1100
0000002 0x00007f6eb17e3f56 in xdebug_get_zval_value (val=0x7f6eb1a19b00, debug_zval=0, options=0x22d1940) at /tmp/xdebug/xdebug_var.c:1192
0000003 0x00007f6eb17d9ba0 in add_single_value (str=0x7fff4a13d910, zv=0x7f6eb1a19b00, html=0, collecton_level=4) at /tmp/xdebug/xdebug_stack.c:397
0000004 0x00007f6eb17da045 in xdebug_append_printable_stack (str=0x7fff4a13d910, html=0) at /tmp/xdebug/xdebug_stack.c:486
0000005 0x00007f6eb17bdfec in xdebug_throw_exception_hook (exception=0x7fff4a13da10) at /tmp/xdebug/xdebug.c:1521
0000006 0x000000000098536a in zend_throw_exception_internal (exception=0x7fff4a13da10) at /tmp/php-7.1.0/Zend/zend_exceptions.c:167
0000007 0x0000000000989393 in zend_throw_exception (exception_ce=0x22c5bc0, message=0x7f6eb07fd4d0 "could not find driver", code=0) at /tmp/php-7.1.0/Zend/zend_exceptions.c:933
0000008 0x0000000000989465 in zend_throw_exception_ex (exception_ce=0x22c5bc0, code=0, format=0xf5d2e3 "could not find driver") at /tmp/php-7.1.0/Zend/zend_exceptions.c:947
0000009 0x00000000006f518d in zim_PDO_dbh_constructor (execute_data=0x7f6eb1a1a930, return_value=0x7fff4a13df10) at /tmp/php-7.1.0/ext/pdo/pdo_dbh.c:260
0000010 0x00000000009b8211 in execute_internal (execute_data=0x7f6eb1a1a930, return_value=0x7fff4a13df10) at /tmp/php-7.1.0/Zend/zend_execute.c:2044

Let me know if you need more info, or if I need to check something else.

Blizz

2016-12-04 20:45

reporter   ~0003935

Ow, perhaps important: As you can probably see in the paths, this is 7.1.0 instead of 7.0.12, if I should test with a 7.0 release instead, let me know.

derick

2016-12-05 14:20

administrator   ~0003944

This latest crash, with which reproduce case are you generating this?

derick

2017-01-03 18:49

administrator   ~0004129

Ping?

Blizz

2017-01-12 14:07

reporter   ~0004176

Sorry, haven't been able to spend the time on it earlier.
I tried again with the latest versions of everything and wasn't able to reproduce the crash anymore. Feel free to close the issue. I'll open a new one should I experience it again.

derick

2017-01-13 16:51

administrator   ~0004178

Okay - thanks!

Issue History

Date Modified Username Field Change
2016-11-03 14:35 Blizz New Issue
2016-11-03 14:35 Blizz File Added: gdb-bt-full.txt
2016-11-03 14:35 Blizz File Added: php-info.txt
2016-11-03 14:36 Blizz Note Added: 0003733
2016-11-03 14:45 derick Note Added: 0003734
2016-11-03 14:45 derick Assigned To => derick
2016-11-03 14:45 derick Status new => feedback
2016-11-03 14:51 Blizz Note Added: 0003735
2016-11-03 14:51 Blizz Status feedback => assigned
2016-11-03 14:52 Blizz File Added: gdb-full-2.5.0-dev.txt
2016-11-03 15:00 derick Note Added: 0003736
2016-11-03 15:00 derick Status assigned => feedback
2016-11-03 16:10 Blizz Note Added: 0003737
2016-11-03 16:10 Blizz Status feedback => assigned
2016-11-03 16:49 Blizz Note Added: 0003738
2016-11-03 16:55 derick Note Added: 0003739
2016-11-03 17:00 Blizz Note Added: 0003740
2016-11-04 23:37 derick Note Added: 0003742
2016-11-14 11:25 Blizz Note Added: 0003743
2016-11-16 12:58 derick Target Version => 2.5.0RC2
2016-11-16 12:58 derick Note Added: 0003747
2016-11-17 20:29 Blizz Note Added: 0003761
2016-12-04 16:40 derick Note Added: 0003917
2016-12-04 16:40 derick Status assigned => feedback
2016-12-04 17:57 derick Target Version 2.5.0RC2 =>
2016-12-04 20:39 Blizz Note Added: 0003934
2016-12-04 20:39 Blizz Status feedback => assigned
2016-12-04 20:45 Blizz Note Added: 0003935
2016-12-05 14:20 derick Note Added: 0003944
2016-12-05 14:20 derick Status assigned => feedback
2017-01-03 18:49 derick Note Added: 0004129
2017-01-12 14:07 Blizz Note Added: 0004176
2017-01-12 14:07 Blizz Status feedback => assigned
2017-01-13 16:51 derick Note Added: 0004178
2017-01-13 16:51 derick Status assigned => resolved
2017-01-13 16:51 derick Resolution open => no change required
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized