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

opcache with Phalcon 1.3.2 #2513

Closed
kbtz opened this issue Jun 9, 2014 · 8 comments
Closed

opcache with Phalcon 1.3.2 #2513

kbtz opened this issue Jun 9, 2014 · 8 comments

Comments

@kbtz
Copy link

kbtz commented Jun 9, 2014

Not sure if it's related with #2239 and #2512, not sure if it's even a Phalcon bug. I'm just providing more details from my context in hope that it lead for some insight for solving this issue if it's related to Phalcon somehow...

My Environment:
Apache/2.2.15 (CentOS)
PHP 5.5.9
Phalcon 1.3.2 777fc83
Zend Engine v2.5.0
Zend OPcache v7.0.3
Xdebug v2.2.4

Reproduction & Errors:
From my testings, I'd say that's the reproduction is to use these extensions I've listed above. The code executes in the first time after a web server restart then fails on 2nd time (using opcached version of the script?), but that's just for some actions, so it may be an error introduced in the bytecode version of the script.

Some controllers actions called via AJAX (GET method) shows in javascript console a specific error code of Google Chrome called net::ERR_INCOMPLETE_CHUNKED_ENCODING. I wasn't able to find any more details of this error code.

Here's a sample of the response header when it occurs:

HTTP/1.1 200 OK
Date: Mon, 09 Jun 2014 19:22:25 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.5.9
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

At server side, I've got some zend_mm_heap corrupted at /var/log/httpd/error_log. I've double checked all my unsets but nothing changed.

Fun facts:

  • If a Xdebug breakpoint is set on the problematic php file, the error never occurs. I believe the breakpoint vanishes any cache for that file.
  • However, not loading Xdebug didn't change the symptoms.
  • By not loading the opcache extension the issue is gone and Xdebug works like a charm.

Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.

@tmatei
Copy link

tmatei commented Jun 10, 2014

@cvsguimaraes I had that error when I had xdebug on, and that was due to the memory not being enough. If you change your php.ini output_buffering = Off then you will probably get the same error I had in #2512

@kbtz
Copy link
Author

kbtz commented Jun 10, 2014

@tmatei which error more specifically? net::ERR_INCOMPLETE_CHUNKED_ENCODING or zend_mm_heap corrupted? Both?

@tmatei
Copy link

tmatei commented Jun 10, 2014

@cvsguimaraes zend_mm_heap corrupted

@oh-ren
Copy link

oh-ren commented Jun 27, 2014

Just curious, do you guys still have these issues? Did you, by any means, have found a workaround, or got it working in the meantime?
I haven't tried to run my app with OPcache enabled yet, but it's kind of a biggie when you have to disable it??
Have you perhaps tried using APC instead of OPcache? (though that's the way backwards I guess, and not really the proper way to go)

So it doesn't seem Xdebug related?

@kbtz
Copy link
Author

kbtz commented Jun 27, 2014

For now I'm fine without APC and OPCache, so I haven't tried any workaround than disabling these modules.

I believe Xdebug is related but passively, it isn't the source of the symptoms but is affected by them. After disabling OPCache the zend_mm_heap corrupted error was gone without applying the tweak suggested by tmatei.

@tmatei
Copy link

tmatei commented Jun 27, 2014

I don't know how to debug this any further, the problem I was seeing was due to opcode cache being turned on. Temporary workaround is to turn off opcode cache, but I haven't tried it with APC. This issue may be isolated to linux (centos) environment, but I am not sure. If someone is able to take a look at it, I can try to come up with an example and replicate this.

@maxowar
Copy link

maxowar commented Sep 23, 2014

I dont believe the problem is Opcache so disabling it isn't a solution (like removing exit/die for me, see #2564) because we still don't know what is the real cause.

What i've seen is that it happens that there are some memory errors, that are then "stored" on opcache that cause the crash of every next request, but it's just a consequence of a previous error.
Disabling Opcache make it works and the error still firing.

@tmatei it's really hard to debug because even gdb exit with error :( what i've seen with strace is that we arrive at the RSHUTDOWN phase...don't know how to help you to help us! :)

@kbtz
Copy link
Author

kbtz commented Nov 21, 2014

Still not sure about what caused this issue but seems that it's gone anyway.
#2564 seem's to be resolved too.

@kbtz kbtz closed this as completed Nov 21, 2014
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

4 participants