php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73588 php5-fpm crash Zend/zend_language_scanner.c: no such file or directory
Submitted: 2016-11-23 13:40 UTC Modified: 2016-12-04 04:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: tobia dot zanarella at gmail dot com Assigned:
Status: No Feedback Package: Unknown/Other Function
PHP Version: 5.6.28 OS: Linux Debian 6.8
Private report: No CVE-ID: None
 [2016-11-23 13:40 UTC] tobia dot zanarella at gmail dot com
Description:
------------
Our current configuration:

 - Debian 8.6
 - Nginx web server
 - PHP5-FPM v5.6.27-0+deb8u1
 - Zend Engine v2.6.0 with Zend OPcache v7.0.6-dev

We use **Phalcon framework v2.0.11** (and v2.0.13 on test environment, where we experience the same errors). In order to work, Phalcon needs to be compiled and then it becomes a PHP pre-loaded module (phalcon.so). During compilation, it invokes Zend libraries among the others.

We also use **Memcached** (as service and as PHP module).

The application runs normally except that Nginx randomly throws:

    502 Bad Gateway

errors during navigation. Reloading the page (F5) or pressing "Back" browser button, the page gets loaded without any error.

Sometimes, 502 errors are more frequent than other moments, apparently regardless of the load or traffic on the server.

The only errors we can read from the logs are not eloquent at all:

**php5-fpm.log:**

    WARNING: [pool www] child 2183 exited on signal 7 (SIGBUS) after 0.120012 seconds from start
    WARNING: [pool www] child 1391 exited on signal 7 (SIGBUS) after 59.871442 seconds from start
    WARNING: [pool www] child 12836 exited on signal 7 (SIGBUS - core dumped) after 560.364868 seconds from start
    WARNING: [pool www] child 10874 exited on signal 7 (SIGBUS - core dumped) after 38.964131 seconds from start
    ...
    ...

**nginx/error.log:**

    [error] 8428#0: *368771 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: xxxxxx.xxxxxxxxx.xxx, request: "POST /abc/def_ghi HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "xxxxxx.xxxxxxxxx.xxx", referrer: "https://xxxxxx.xxxxxxxxx.xxx/abc"
    ...
    ...

After days of reasearch, we tried applying all the suggestions we found on internet. The parameters we modified, tested and checked on Nginx and php-fpm are, among the others:

    (on php.ini)
    output_buffering
    max_execution_time
    memory_limit
    
    (on www.conf)
    listen = /var/run/php5-fpm.sock or listen = 127.0.0.1:9000
    pm = ondemand/static/etc.....
    pm.max_children 500/30/1/100/etc....
    pm.start_servers = 30/50/1/etc......
    pm.min_spare_servers
    pm.max_spare_servers
    pm.max_requests
    
    (on nginx virtual server conf file)
    fastcgi_pass
    fastcgi_buffers
    fastcgi_buffer_size
    fastcgi_connect_timeout
    fastcgi_send_timeout
    fastcgi_read_timeout
    
Every combination with any value on the above parameters didn't change anything on the "502" errors behaviour. They keep appearing sometimes.

So, we tried dumping the core of PHP on process crash with GDB. We found out that every time a 502 error is thrown, we receive always the same identical dump (I mean, with the same error). This is an example of a dump:

    GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
    Copyright (C) 2014 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 /usr/sbin/php5-fpm...Reading symbols from /usr/lib/debug/.build-id/d4/62618919aec6e5b126ad219b9d08046ef6b875.debug...done.
    done.
    [New LWP 17814]
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Core was generated by `php-fpm: pool www                                                       '.
    Program terminated with signal SIGBUS, Bus error.
    #0  lex_scan (zendlval=zendlval@entry=0x7fff14a7b0b8) at Zend/zend_language_scanner.c:1082
    1082	Zend/zend_language_scanner.c: no such file or directory.

**The error is this one:**

    #0  lex_scan (zendlval=zendlval@entry=0x7fff14a7b0b8) at Zend/zend_language_scanner.c:1082
    1082	Zend/zend_language_scanner.c: no such file or directory.

If we search this error on the internet, we find little or nothing.

We tried recompiling Phalcon, after an upgrade of PHP (from PHP 5.6.24 to 5.6.27), but the error keeps appearing.

We honestly can't understand what else we should do to have an explanation on this error and understand how to solve it definitively.

Thank you for your help.

Test script:
---------------
This error is not reproducible.

Actual result:
--------------
Php5-fpm on Nginx randomnly crashes with error: Zend/zend_language_scanner.c: no such file or directory

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-23 15:26 UTC] rasmus@php.net
-Status: Open +Status: Feedback
 [2016-11-23 15:26 UTC] rasmus@php.net
Sorry, there is absolutely nothing in this bug report for us to go on.
The fact that it can't find your zend_language_scanner.c file just means you haven't told your gdb where to find the php source code and if PHP is crashing with a SIGBUS, please provide a full backtrace, preferably with debugging symbols included and the source path set correctly in gdb. Also try if you can reproduce the problem without Phalcon.
 [2016-12-04 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 06 07:01:29 2024 UTC