-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Phalcon 1.3.0 segfault #1567
Comments
Does this happen if you run |
Yes, in CLI
|
Could you please generate a core dump and get the backtrace? sudo apt-get install gdb
git clone https://github.com/phalcon/cphalcon.git
cd cphalcon/ext
git checkout origin/1.3.0
phpize
./configure CFLAGS="-O0 -g3"
make -j4
sudo make install
ulimit -c unlimited
sudo service apport stop
php index.php
gdb `which php` core and at the gdb prompt run
|
Unfortunately my php isn't compiled in debug mode, therefore all that I see is:
|
PHP version 5.4.19 if that helps |
OK, I will install PHP 5.4.19 and try to reproduce this. Is this stock version of PHP or manually built one? |
CentOS 6 yum installed stock php |
OK, will install a CentOS tonight and check what is wrong. |
|
Related: #1510 |
diff --git a/ext/phalcon.c b/ext/phalcon.c
index dc33837..5043c85 100644
--- a/ext/phalcon.c
+++ b/ext/phalcon.c
@@ -946,26 +946,26 @@ static ZEND_MODULE_POST_ZEND_DEACTIVATE_D(phalcon)
#endif
if (CG(unclean_shutdown)) {
- zend_phalcon_globals *phalcon_globals = PHALCON_VGLOBAL;
+ zend_phalcon_globals *pg = PHALCON_VGLOBAL;
- INIT_ZVAL(*phalcon_globals->z_null);
- Z_ADDREF_P(phalcon_globals->z_null);
+ INIT_ZVAL(*pg->z_null);
+ Z_ADDREF_P(pg->z_null);
- INIT_PZVAL(phalcon_globals->z_false);
- Z_ADDREF_P(phalcon_globals->z_false);
- ZVAL_FALSE(phalcon_globals->z_false);
+ INIT_PZVAL(pg->z_false);
+ Z_ADDREF_P(pg->z_false);
+ ZVAL_FALSE(pg->z_false);
- INIT_PZVAL(phalcon_globals->z_true);
- Z_ADDREF_P(phalcon_globals->z_true);
- ZVAL_TRUE(phalcon_globals->z_true);
+ INIT_PZVAL(pg->z_true);
+ Z_ADDREF_P(pg->z_true);
+ ZVAL_TRUE(pg->z_true);
- INIT_PZVAL(phalcon_globals->z_zero);
- Z_ADDREF_P(phalcon_globals->z_zero);
- ZVAL_LONG(phalcon_globals->z_zero, 0);
+ INIT_PZVAL(pg->z_zero);
+ Z_ADDREF_P(pg->z_zero);
+ ZVAL_LONG(pg->z_zero, 0);
- INIT_PZVAL(phalcon_globals->z_one);
- Z_ADDREF_P(phalcon_globals->z_one);
- ZVAL_LONG(phalcon_globals->z_one, 1);
+ INIT_PZVAL(pg->z_one);
+ Z_ADDREF_P(pg->z_one);
+ ZVAL_LONG(pg->z_one, 1);
}
return SUCCESS; |
The bug happened due to the way #define PHALCON_VGLOBAL &(phalcon_globals) Thus, zend_phalcon_globals *phalcon_globals = PHALCON_VGLOBAL; becomes zend_phalcon_globals *phalcon_globals = &(phalcon_globals); Local |
Thanks! |
Just tried several times:
Code:
dmesg:
This code causes php to crash, when Phalcon is enabled. Doesn't crash when disabled. Phalcon installed from /ext.
Here is my installation script:
The text was updated successfully, but these errors were encountered: