Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on shutdown #1489

Closed
sjinks opened this issue Apr 9, 2017 · 3 comments
Closed

Crash on shutdown #1489

sjinks opened this issue Apr 9, 2017 · 3 comments

Comments

@sjinks
Copy link
Contributor

sjinks commented Apr 9, 2017

$ UZE_ZEND_ALLOC=0 gdb --args $(phpenv which php) ./unit-tests/phpunit --not-exit -c phpunit.xml.dist unit-tests/
GNU gdb (Ubuntu 7.11.90.20161005-0ubuntu1) 7.11.90.20161005-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/vladimir/.phpenv/versions/7.0.9-debug-nts/bin/php...done.
(gdb) run
Starting program: /home/vladimir/.phpenv/versions/7.0.9-debug-nts/bin/php ./unit-tests/phpunit --not-exit -c phpunit.xml.dist unit-tests/
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
PHPUnit 4.8.35 by Sebastian Bergmann and contributors.

Runtime:        PHP 7.0.9
Configuration:  /home/vladimir/workspace/zephir/phpunit.xml.dist

...............................................................  63 / 346 ( 18%)
............................................................... 126 / 346 ( 36%)
............................................................... 189 / 346 ( 54%)
............................................................... 252 / 346 ( 72%)
............................................................... 315 / 346 ( 91%)
...............................

Time: 835 ms, Memory: 10.00MB

OK (346 tests, 1453 assertions)

Program received signal SIGSEGV, Segmentation fault.
0x0000555555c97a36 in zend_string_release (s=0x0) at /tmp/php-build/source/7.0.9/Zend/zend_string.h:269
269     /tmp/php-build/source/7.0.9/Zend/zend_string.h: Немає такого файла або каталогу.
(gdb) bt
#0  0x0000555555c97a36 in zend_string_release (s=0x0) at /tmp/php-build/source/7.0.9/Zend/zend_string.h:269
#1  0x0000555555c98c02 in destroy_op_array (op_array=0x7fffeae79468) at /tmp/php-build/source/7.0.9/Zend/zend_opcode.c:369
#2  0x0000555555c97f60 in zend_function_dtor (zv=0x7fffeaeaa040) at /tmp/php-build/source/7.0.9/Zend/zend_opcode.c:124
#3  0x0000555555cc1d78 in zend_hash_destroy (ht=0x7fffeae79270) at /tmp/php-build/source/7.0.9/Zend/zend_hash.c:1265
#4  0x0000555555c988ba in destroy_zend_class (zv=0x7fffffffb2a0) at /tmp/php-build/source/7.0.9/Zend/zend_opcode.c:289
#5  0x0000555555cc1427 in _zend_hash_del_el_ex (ht=0x5555566f2390, idx=875, p=0x55555691b1e0, prev=0x0) at /tmp/php-build/source/7.0.9/Zend/zend_hash.c:1026
#6  0x0000555555cc1507 in _zend_hash_del_el (ht=0x5555566f2390, idx=875, p=0x55555691b1e0) at /tmp/php-build/source/7.0.9/Zend/zend_hash.c:1050
#7  0x0000555555cc2e03 in zend_hash_reverse_apply (ht=0x5555566f2390, apply_func=0x555555c91afa <clean_non_persistent_class>) at /tmp/php-build/source/7.0.9/Zend/zend_hash.c:1628
#8  0x0000555555c9287e in shutdown_executor () at /tmp/php-build/source/7.0.9/Zend/zend_execute_API.c:367
#9  0x0000555555cab0f7 in zend_deactivate () at /tmp/php-build/source/7.0.9/Zend/zend.c:967
#10 0x0000555555c138cc in php_request_shutdown (dummy=0x0) at /tmp/php-build/source/7.0.9/main/main.c:1833
#11 0x0000555555d74ea9 in do_cli (argc=6, argv=0x5555566f1fb0) at /tmp/php-build/source/7.0.9/sapi/cli/php_cli.c:1141
#12 0x0000555555d75725 in main (argc=6, argv=0x5555566f1fb0) at /tmp/php-build/source/7.0.9/sapi/cli/php_cli.c:1344

PHP 7.0.9 NTS DEBUG

@sjinks
Copy link
Contributor Author

sjinks commented Apr 9, 2017

(gdb) frame 4
(gdb) print (char*)((zend_class_entry*)zv->value.ptr)->name->val
$1 = 0x7fffeb24cd98 "PHPUnit_Framework_Constraint_IsType"

@sjinks
Copy link
Contributor Author

sjinks commented Apr 9, 2017

Related to #1488

@sjinks
Copy link
Contributor Author

sjinks commented Apr 9, 2017

--- a/kernels/ZendEngine3/memory.c
+++ b/kernels/ZendEngine3/memory.c
@@ -400,7 +400,7 @@ void zephir_create_symbol_table()
 	entry->symbol_table = ex->symbol_table;
 	entry->prev         = gptr->active_symbol_table;
 
-	symbol_table = (zend_array*)emalloc(sizeof(zend_array *));
+	symbol_table = (zend_array*)emalloc(sizeof(zend_array));
 	zend_hash_init(symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0);
 	zend_hash_real_init(symbol_table, 0);

@sjinks sjinks closed this as completed in 491f0d4 Apr 9, 2017
sjinks added a commit that referenced this issue Apr 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant