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

centos 6.5 core dump #11992

Closed
kcloze opened this issue Jul 19, 2016 · 11 comments
Closed

centos 6.5 core dump #11992

kcloze opened this issue Jul 19, 2016 · 11 comments

Comments

@kcloze
Copy link

kcloze commented Jul 19, 2016

PHP with phalcon extesion is ok, but when run the demo , nginx return 502 and get system message
below. I think it's a fatal error.
so I try it in cli env, it's the same fatal error.

Jul 19 20:59:05 10-13-14-134 kernel: php-fpm[10905] trap invalid opcode ip:7f0e80c8d1f5 sp:7fff42db1c80 error:0 in phalcon.so[7f0e809fa000+37c000]

system info:
Linux 10-13-14-134 2.6.32-431.11.9.el6.ucloud.x86_64 #1 SMP Sun Mar 29 14:05:42 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
centos 6.5
PHP 5.6.23 (cli) (built: Jul 19 2016 15:58:29)

install from:
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install

@Jurigag
Copy link
Contributor

Jurigag commented Jul 19, 2016

Post result from gdb bt:

https://bugs.php.net/bugs-generating-backtrace.php

@kcloze
Copy link
Author

kcloze commented Jul 19, 2016

#0  0x00007f6ef9b2e1f5 in zim_Phalcon_Mvc_Router_Route___construct () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#1  0x00007f6ef992e7bc in zephir_call_function_opt () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#2  0x00007f6ef992f526 in zephir_call_user_function () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#3  0x00007f6ef9930038 in zephir_call_class_method_aparams () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#4  0x00007f6ef9ac3fbb in zim_Phalcon_Mvc_Router___construct () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#5  0x000000000089f752 in zend_do_fcall_common_helper_SPEC (execute_data=<value optimized out>) at /data/src/php-extension/php-5.6.23/Zend/zend_vm_execute.h:558
#6  0x000000000088efe0 in execute_ex (execute_data=0x7f6f05732b40) at /data/src/php-extension/php-5.6.23/Zend/zend_vm_execute.h:363
#7  0x0000000000812d92 in zend_call_function (fci=0x7fff35c988b0, fci_cache=<value optimized out>) at /data/src/php-extension/php-5.6.23/Zend/zend_execute_API.c:829
#8  0x00007f6ef9912364 in zephir_call_user_func_array_noex () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#9  0x00007f6ef991242e in zephir_call_user_func_array () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#10 0x00007f6ef9b1a6b7 in zim_Phalcon_Di_Service_resolve () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#11 0x00007f6ef992e7bc in zephir_call_function_opt () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#12 0x00007f6ef992f526 in zephir_call_user_function () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#13 0x00007f6ef9930038 in zephir_call_class_method_aparams () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#14 0x00007f6ef9a0967c in zim_Phalcon_Di_get () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#15 0x00007f6ef992e7bc in zephir_call_function_opt () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#16 0x00007f6ef992f526 in zephir_call_user_function () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#17 0x00007f6ef9930038 in zephir_call_class_method_aparams () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#18 0x00007f6ef9b525f4 in zim_Phalcon_Di_getShared () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#19 0x00007f6ef992e7bc in zephir_call_function_opt () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#20 0x00007f6ef992f526 in zephir_call_user_function () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#21 0x00007f6ef9930038 in zephir_call_class_method_aparams () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#22 0x00007f6ef9a384bb in zim_Phalcon_Mvc_Application_handle () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
#23 0x000000000089f752 in zend_do_fcall_common_helper_SPEC (execute_data=<value optimized out>) at /data/src/php-extension/php-5.6.23/Zend/zend_vm_execute.h:558
#24 0x000000000088efe0 in execute_ex (execute_data=0x7f6f057325e0) at /data/src/php-extension/php-5.6.23/Zend/zend_vm_execute.h:363
#25 0x00000000008207f9 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /data/src/php-extension/php-5.6.23/Zend/zend.c:1341
#26 0x00000000007bfe6a in php_execute_script (primary_file=0x7fff35c9d1d0) at /data/src/php-extension/php-5.6.23/main/main.c:2613
#27 0x00000000008c725c in do_cli (argc=2, argv=0x14bcc50) at /data/src/php-extension/php-5.6.23/sapi/cli/php_cli.c:994
#28 0x00000000008c79f8 in main (argc=2, argv=0x14bcc50) at /data/src/php-extension/php-5.6.23/sapi/cli/php_cli.c:1378

@Jurigag
Copy link
Contributor

Jurigag commented Jul 19, 2016

And what exactly code is causing seg fault ?

@kcloze
Copy link
Author

kcloze commented Jul 19, 2016

NU gdb (GDB) Red Hat Enterprise Linux (7.2-90.el6)
Copyright (C) 2010 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /opt/php56/bin/php...done.
[New Thread 23743]
Missing separate debuginfo for /opt/libmcrypt/lib/libmcrypt.so.4
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/91/0a3b70178c362638c91b13672e1970b67c241a
Missing separate debuginfo for /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/ce/e85cc0fcaa9b6ef0cfaf804d2f936940a73920
Missing separate debuginfo for /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/redis.so
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/4e/45ffcea319047312213c7d126c458a4cb2c1b4
Missing separate debuginfo for 
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/7d/8c515913ce4eba8c63e7139247b520af83b2cb
Reading symbols from /lib64/libcrypt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /lib64/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libz.so.1
Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /opt/libmcrypt/lib/libmcrypt.so.4...done.
Loaded symbols for /opt/libmcrypt/lib/libmcrypt.so.4
Reading symbols from /usr/lib64/libltdl.so.7...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libltdl.so.7
Reading symbols from /usr/lib64/libpng12.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libpng12.so.0
Reading symbols from /usr/lib64/libjpeg.so.62...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libjpeg.so.62
Reading symbols from /usr/lib64/libcurl.so.4...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libcurl.so.4
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libnsl.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /usr/lib64/libxml2.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libxml2.so.2
Reading symbols from /usr/lib64/libssl.so.10...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libssl.so.10
Reading symbols from /usr/lib64/libcrypto.so.10...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libcrypto.so.10
Reading symbols from /usr/lib64/libfreetype.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libfreetype.so.6
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libresolv.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libresolv.so.2
Reading symbols from /lib64/libfreebl3.so...(no debugging symbols found)...done.
Loaded symbols for /lib64/libfreebl3.so
Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libidn.so.11...(no debugging symbols found)...done.
Loaded symbols for /lib64/libidn.so.11
Reading symbols from /lib64/libldap-2.4.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libldap-2.4.so.2
Reading symbols from /lib64/libgssapi_krb5.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libgssapi_krb5.so.2
Reading symbols from /lib64/libkrb5.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib64/libkrb5.so.3
Reading symbols from /lib64/libk5crypto.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib64/libk5crypto.so.3
Reading symbols from /lib64/libcom_err.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libcom_err.so.2
Reading symbols from /usr/lib64/libssl3.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libssl3.so
Reading symbols from /usr/lib64/libsmime3.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libsmime3.so
Reading symbols from /usr/lib64/libnss3.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libnss3.so
Reading symbols from /usr/lib64/libnssutil3.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libnssutil3.so
Reading symbols from /lib64/libplds4.so...(no debugging symbols found)...done.
Loaded symbols for /lib64/libplds4.so
Reading symbols from /lib64/libplc4.so...(no debugging symbols found)...done.
Loaded symbols for /lib64/libplc4.so
Reading symbols from /lib64/libnspr4.so...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnspr4.so
Reading symbols from /usr/lib64/libssh2.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libssh2.so.1
Reading symbols from /lib64/liblber-2.4.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/liblber-2.4.so.2
Reading symbols from /usr/lib64/libsasl2.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libsasl2.so.2
Reading symbols from /lib64/libkrb5support.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib64/libkrb5support.so.0
Reading symbols from /lib64/libkeyutils.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libkeyutils.so.1
Reading symbols from /lib64/libselinux.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libselinux.so.1
Reading symbols from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so...(no debugging symbols found)...done.
Loaded symbols for /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
Reading symbols from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/redis.so...done.
Loaded symbols for /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/redis.so
Core was generated by `/opt/php56/bin/php index.php'.
Program terminated with signal 4, Illegal instruction.
#0  0x00007f6ef9b2e1f5 in zim_Phalcon_Mvc_Router_Route___construct () from /opt/php56/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so
Missing separate debuginfos, use: debuginfo-install cyrus-sasl-lib-2.1.23-15.el6_6.2.x86_64 freetype-2.3.11-15.el6_6.1.x86_64 glibc-2.12-1.166.el6_7.7.x86_64 keyutils-libs-1.4-5.el6.x86_64 krb5-libs-1.10.3-42.el6.x86_64 libcom_err-1.41.12-22.el6.x86_64 libcurl-7.19.7-46.el6.x86_64 libidn-1.18-2.el6.x86_64 libjpeg-turbo-1.2.1-3.el6_5.x86_64 libpng-1.2.49-1.el6_2.x86_64 libselinux-2.0.94-5.8.el6.x86_64 libssh2-1.4.2-1.el6.x86_64 libtool-ltdl-2.2.6-15.5.el6.x86_64 libxml2-2.7.6-20.el6.x86_64 nspr-4.10.0-1.el6.x86_64 nss-3.15.1-15.el6.x86_64 nss-softokn-freebl-3.14.3-23.el6_7.x86_64 nss-util-3.15.1-3.el6.x86_64 openldap-2.4.40-5.el6.x86_64 openssl-1.0.1e-42.el6.x86_64 zlib-1.2.3-29.el6.x86_64

@Jurigag
Copy link
Contributor

Jurigag commented Jul 19, 2016

I mean which php code is causing seg fault ?

@kcloze
Copy link
Author

kcloze commented Jul 19, 2016

very simple script.

<?php
use Phalcon\Cli\Console as ConsoleApp;

error_reporting(E_ALL);
date_default_timezone_set('Asia/Shanghai');
define('APP_PATH', __DIR__ . '/..');
define('YII_ENV_APP_NAME', 'ycf_direct_selling');

/**
 * Read the configuration
 */
$config = include APP_PATH . "/../ycf_config/" . YII_ENV_APP_NAME . "/config.php";
/**
 * Read auto-loader
 */
include __DIR__ . '/config/loader.php';

/**
 * Read the services
 */

include __DIR__ . '/config/mainCli.php';

/**
 * Create a console application
 */
$console = new ConsoleApp($di);

/**
 * Process the console arguments
 */
$arguments = [];

foreach ($argv as $k => $arg) {
    if ($k == 1) {
        $arguments['task'] = $arg;
    } elseif ($k == 2) {
        $arguments['action'] = $arg;
    } elseif ($k >= 3) {
        $arguments['params'][] = $arg;
    }
}

try {

    /**
     * Handle
     */
    $console->handle($arguments);

    /**
     * If configs is set to true, then we print a new line at the end of each execution
     *
     * If we dont print a new line,
     * then the next command prompt will be placed directly on the left of the output
     * and it is less readable.
     *
     * You can disable this behaviour if the output of your application needs to don't have a new line at end
     */
    if (isset($config["printNewLine"]) && $config["printNewLine"]) {
        echo PHP_EOL;
    }

} catch (Exception $e) {
    echo $e->getMessage() . PHP_EOL;
    echo $e->getTraceAsString() . PHP_EOL;

}

@kcloze
Copy link
Author

kcloze commented Jul 19, 2016

my dev env is ok. Today I want to deploy the project to production,I find it's a not working with a simple demo.

@Jurigag
Copy link
Contributor

Jurigag commented Jul 19, 2016

Are you sure you posted good code ? I don't see anywhere here Phalcon/Mvc/Application::handle() / or Phalcon/Mvc/Router::construct. Did you have created it somehwere in loader.php or mainCli.php ?

@kcloze
Copy link
Author

kcloze commented Jul 19, 2016

php-fpm and cli all made core dump.

in cli :
$di from mainCli.php

$console = new ConsoleApp($di);
$console->handle($arguments);

@Jurigag
Copy link
Contributor

Jurigag commented Jul 19, 2016

No, but look in stack you ahve calls:

Phalcon/Mvc/Application::handle() and Phalcon/Mvc/Router::construct

I don't see it in code you posted.

@kcloze
Copy link
Author

kcloze commented Jul 20, 2016

it's maybe my host have dif PHP version and install scripts have same bug.

I rebuild extension with blew, and it's ok.

git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build/64bit/
make clean
/opt/php56/bin/phpize --clean
/opt/php56/bin/phpize 
./configure  --with-php-config=/opt/php56/bin/php-config 
make && make install

@kcloze kcloze closed this as completed Jul 20, 2016
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

2 participants