-
-
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
Crash dumps with Volt alwaysRecompileView=TRUE #1949
Comments
The crash happens in Could you please turn off XCache and see if the problem persists? |
Sorry, I forgot to enable crash dumps again. With xcache off: #0 lex_scan (zendlval=0x7ffffe7d6058) at Zend/zend_language_scanner.c:1091 |
The crash still happens in the same place, inside Zend lexic analyzer. Could you please try to compile Phalcon in debug mode: phpize
./configure "CFLAGS=-O0 -g3"
make
sudo make install and then generate the backtrace with |
Here you go: |
Thanks, could you please post Aslo, if you run <?php
require '/home/mpossy/app/config/../../cache/_home_mpossy_app_views_merchant_index.volt.php';
?> does PHP crash? |
It doesn't crash because it fails to do anyting without phalcon. "Fatal error: Using $this when not in object context" |
OK, could you please try to apply this patch: diff --git a/ext/mvc/view/engine/volt.c b/ext/mvc/view/engine/volt.c
index 39545d6..a4f33ab 100644
--- a/ext/mvc/view/engine/volt.c
+++ b/ext/mvc/view/engine/volt.c
@@ -245,10 +245,24 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, render){
);
}
- if (phalcon_require(compiled_template_path TSRMLS_CC) == FAILURE) {
- RETVAL_FALSE;
- RETURN_MM();
+ {
+ zend_file_handle *pfile;
+ zend_file_handle file = {0};
+
+ convert_to_string(compiled_template_path);
+
+ file.filename = Z_STRVAL_P(compiled_template_path);
+ file.opened_path = NULL;
+ file.free_filename = 0;
+ file.type = ZEND_HANDLE_FILENAME;
+ pfile = &file;
+
+ if (FAILURE == zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, pfile)) {
+ RETVAL_FALSE;
+ RETURN_MM();
+ }
}
+
if (PHALCON_IS_TRUE(must_clean)) {
PHALCON_INIT_VAR(contents);
phalcon_ob_get_contents(contents TSRMLS_CC); then rebuild the source: php build/gen-build.php rebuild Phalcon and see if crashes still happen? This will use Zend's |
Hi, Sorry for the late reply. It doesn't compile. maybe a missing if clause? |
I experienced the same issue. I compiled with the following
And still had the same problem. I believe it is caused by the generation of the file earlier in this file around line 225, It gets compiled and created but by the time it gets executed another thread is in the middle of modifying this same file and is corrupt. i'm not good with c yet but there appears to need to be a way to add a lock to the file once its created and then released after its executed to ensure the thread that generated the file is getting the same file it generated. |
Could you please try again using Phalcon 2 or close this issue as 1.3.x is no longer supported |
We experienced the same issue, see: How to reproduce: set PHP-FPM with option pm.max_children with a value greater than 1 (2, 10, 500...) and try to open a lot of pages in the application at the same time from at least two clients (in order to force PHP-FPM to serve more than 1 request at the same time). Volt must be configured with Some of these requests will fail, causing Nginx to throw 502 Error. The core dump will contain the error:
|
Hi,
We're getting a lot of crash dumps. I've tried with cphalcon 1.2.5/1.2.6/1.3.0, it's the same issue.
I think it's the 'alwaysRecompileView' => TRUE. With FALSE it works just fine. This happens when we stress the server with many concurent requests to check the performance. Probably a IO thing with writing files.
#0 lex_scan (zendlval=0x7fff8ec82bc8) at Zend/zend_language_scanner.c:1091
#1 0x0000000000734ef0 in zendlex (zendlval=0x7fff8ec82bc0) at /usr/local/src/php-5.5.7/Zend/zend_compile.c:6749
#2 0x000000000071d753 in zendparse () at /usr/local/src/php-5.5.7/Zend/zend_language_parser.c:3436
#3 0x0000000000729e15 in compile_file (file_handle=0x7fff8ec85190, type=) at Zend/zend_language_scanner.l:588
#4 0x0000000000595391 in phar_compile_file (file_handle=0x7fff8ec85190, type=8) at /usr/local/src/php-5.5.7/ext/phar/phar.c:3383
#5 0x00007f2a531d4474 in xc_compile_file (h=0x7fff8ec85190, type=8) at /usr/local/src/xcache-3.1.0/mod_cacher/xc_cacher.c:2196
#6 0x00007f2a50cb07cc in phalcon_internal_require () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#7 0x00007f2a50d3729f in zim_Phalcon_Mvc_View_Engine_Volt_render () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#8 0x00007f2a50cbb6d0 in phalcon_call_method_vparams () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#9 0x00007f2a50cbbeb7 in phalcon_call_method_params () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#10 0x00007f2a50e0996d in zim_Phalcon_Mvc_View__engineRender () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#11 0x00007f2a50cbb6d0 in phalcon_call_method_vparams () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#12 0x00007f2a50cbbeb7 in phalcon_call_method_params () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#13 0x00007f2a50deac9b in zim_Phalcon_Mvc_View_render () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#14 0x00007f2a50cbb6d0 in phalcon_call_method_vparams () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#15 0x00007f2a50cbbeb7 in phalcon_call_method_params () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#16 0x00007f2a50d2a3a3 in zim_Phalcon_Mvc_Application_handle () from /usr/local/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
#17 0x00000000007d91c2 in zend_do_fcall_common_helper_SPEC (execute_data=) at /usr/local/src/php-5.5.7/Zend/zend_vm_execute.h:552
#18 0x00000000007ca9b0 in execute_ex (execute_data=0x7f2a61bff708) at /usr/local/src/php-5.5.7/Zend/zend_vm_execute.h:363
#19 0x0000000000756da9 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-5.5.7/Zend/zend.c:1320
#20 0x00000000006f8c19 in php_execute_script (primary_file=0x7fff8ec8a9e0) at /usr/local/src/php-5.5.7/main/main.c:2489
#21 0x000000000080f9b2 in main (argc=, argv=) at /usr/local/src/php-5.5.7/sapi/fpm/fpm/fpm_main.c:1933
(gdb)
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: