CopernicaMarketingSoftware / PHP-CPP

Library to build PHP extensions with C++
http://www.php-cpp.com/
Apache License 2.0
1.43k stars 333 forks source link

Segmentation fault (core dumped) when Php::out #416

Closed lifenglsf closed 5 years ago

lifenglsf commented 5 years ago

I run php code,i got success message with cpp codeSegmentation fault (core dumped)

[root@lifeng-centos7 extension2]# php a.php example output Segmentation fault (core dumped)

#include <phpcpp.h>
#include <iostream>
#include <stdlib.h>
using namespace std;
void myFunction()
{
    Php::out << "example output" << std::endl;
}

Php::Value myFunction2(){
if(rand()%2==0){
return "string";
}else{
return 123;
}
}

Php::Value sum_everything(Php::Parameters &parameters){
int result=0;
for(auto &param : parameters) result+=param;
return result;
}
extern "C" {
    PHPCPP_EXPORT void *get_module() {
        static Php::Extension extension("myFunctions", "1.0");
        extension.add<myFunction>("myFunction");
        extension.add<myFunction2>("myFunction2");
        extension.add<sum_everything>("sum_everything");
        return extension;
    }
}

php code

<?php
echo myFunction();

makefile

COMPILER_FLAGS      =   -Wall -c -O2 -std=c++11 -fpic -o
LINKER_FLAGS        =   -shared
LINKER_DEPENDENCIES =   -lphpcpp

RM                  =   rm -f
CP                  =   cp -f
MKDIR               =   mkdir -p

SOURCES             =   $(wildcard *.cpp)
OBJECTS             =   $(SOURCES:%.cpp=%.o)

all:                    ${OBJECTS} ${EXTENSION}

${EXTENSION}:           ${OBJECTS}
                        ${LINKER} ${LINKER_FLAGS} -o $@ ${OBJECTS} ${LINKER_DEPENDENCIES}

${OBJECTS}:
                        ${COMPILER} ${COMPILER_FLAGS} $@ ${@:%.o=%.cpp}

install:        
                        ${CP} ${EXTENSION} ${EXTENSION_DIR}
                        ${CP} ${INI} ${INI_DIR}

clean:
                        ${RM} ${EXTENSION} ${OBJECTS}
scorninpc commented 5 years ago

Try to store rand() into a int first. rand() can be double, and maybe explode allocated area of zend engine

int a = (int)rand();
if( a % 2 == 0 ) {
   return "string";
}
else {
   return 123;
}
lifenglsf commented 5 years ago

@scorninpc I called myFunction.I used your code,but not woked

lifenglsf commented 5 years ago

/var/spool/mail/root messages as following:


Return-Path: <user@localhost.localdomain>
X-Original-To: root@localhost
Delivered-To: root@localhost.localdomain
Received: by lifeng-centos7.localdomain (Postfix, from userid 0)
    id 8235B212906E; Mon,  3 Jun 2019 13:18:59 +0800 (CST)
Date: Mon, 03 Jun 2019 13:18:59 +0800
From: user@localhost.localdomain
To: root@localhost.localdomain
Subject: [abrt] php73-php-cli: php killed by SIGSEGV
Message-ID: <5cf4adc3.yHAtFU0f+5mv++PK%user@localhost>
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

reason:         php killed by SIGSEGV
cmdline:        php a.php
executable:     /opt/remi/php73/root/usr/bin/php
package:        php73-php-cli-7.3.5-1.el7.remi
component:      php73-php
pid:            116489
pwd:            /data/phpcpp_extension/extension2
hostname:       lifeng-centos7
count:          1
abrt_version:   2.1.11
analyzer:       CCpp
architecture:   x86_64
event_log:     =20
global_pid:     116489
kernel:         3.10.0-693.el7.x86_64
last_occurrence: 1559539138
os_release:     CentOS Linux release 7.6.1810 (Core)=20
pkg_arch:       x86_64
pkg_epoch:      0
pkg_fingerprint: 004E 6F47 00F9 7F56
pkg_name:       php73-php-cli
pkg_release:    1.el7.remi
pkg_vendor:     Remi Collet
pkg_version:    7.3.5
runlevel:       N 5
time:           Mon 03 Jun 2019 01:18:58 PM CST
type:           CCpp
uid:            0
username:       root
uuid:           a3c1c37b5fccb915e047c06ae7090817a97fe288

core_backtrace:
:{   "signal": 11
:,   "executable": "/opt/remi/php73/root/usr/bin/php"
:,   "stacktrace":
:      [ {   "crash_thread": true
:        ,   "frames":
:              [ {   "address": 139651109654462
:                ,   "build_id_offset": 139651109654462
:                } ]
:        } ]
:}
cgroup:
:11:blkio:/user.slice
:10:pids:/user.slice
:9:cpuset:/
:8:hugetlb:/
:7:devices:/user.slice
:6:net_prio,net_cls:/
:5:perf_event:/
:4:cpuacct,cpu:/user.slice
:3:freezer:/
:2:memory:/user.slice
:1:name=3Dsystemd:/user.slice/user-0.slice/session-2155.scope
dso_list:
:/usr/lib64/libc-2.17.so glibc-2.17-260.el7_6.5.x86_64 (CentOS) 1558444=
371
:/usr/lib64/libgcc_s-4.8.5-20150702.so.1 libgcc-4.8.5-36.el7_6.2.x86_64=
 (CentOS) 1557916483
:/usr/lib64/libncurses.so.5.9 ncurses-libs-5.9-14.20130511.el7_4.x86_64=
 (CentOS) 1558444371
:/usr/lib64/libpcre.so.1.2.0 pcre-8.32-17.el7.x86_64 (CentOS) 155780603=
7
:/usr/lib64/libstdc++.so.6.0.19 libstdc++-4.8.5-36.el7_6.2.x86_64 (Cent=
OS) 1558443018
:/usr/lib64/libxml2.so.2.9.1 libxml2-2.9.1-6.el7_2.3.x86_64 (CentOS) 15=
57806037
:/usr/lib64/libm-2.17.so glibc-2.17-260.el7_6.5.x86_64 (CentOS) 1558444=
371
:/usr/lib64/libz.so.1.2.7 zlib-1.2.7-18.el7.x86_64 (CentOS) 1558444371
:/usr/lib64/ld-2.17.so glibc-2.17-260.el7_6.5.x86_64 (CentOS) 155844437=
1
:/usr/lib64/libtinfo.so.5.9 ncurses-libs-5.9-14.20130511.el7_4.x86_64 (=
CentOS) 1558444371
:/usr/lib64/libresolv-2.17.so glibc-2.17-260.el7_6.5.x86_64 (CentOS) 15=
58444371
:/usr/lib64/libcrypto.so.1.0.2k openssl-libs-1:1.0.2k-16.el7_6.1.x86_64=
 (CentOS) 1558444384
:/usr/lib64/libgssapi_krb5.so.2.2 krb5-libs-1.15.1-37.el7_6.x86_64 (Cen=
tOS) 1558444383
:/usr/lib64/libkrb5.so.3.3 krb5-libs-1.15.1-37.el7_6.x86_64 (CentOS) 15=
58444383
:/usr/lib64/libfreebl3.so nss-softokn-freebl-3.36.0-5.el7_5.x86_64 (Cen=
tOS) 1558444370
:/usr/lib64/libkrb5support.so.0.1 krb5-libs-1.15.1-37.el7_6.x86_64 (Cen=
tOS) 1558444383
:/usr/lib64/libssl.so.1.0.2k openssl-libs-1:1.0.2k-16.el7_6.1.x86_64 (C=
entOS) 1558444384
:/usr/lib64/libselinux.so.1 libselinux-2.5-14.1.el7.x86_64 (CentOS) 155=
7810591
:/opt/remi/php73/root/usr/bin/php php73-php-cli-7.3.5-1.el7.remi.x86_64=
 (Remi Collet) 1557833219
:/usr/lib64/libcom_err.so.2.1 libcom_err-1.42.9-13.el7.x86_64 (CentOS) =
1558444371
:/usr/lib64/librt-2.17.so glibc-2.17-260.el7_6.5.x86_64 (CentOS) 155844=
4371
:/usr/lib64/libnsl-2.17.so glibc-2.17-260.el7_6.5.x86_64 (CentOS) 15584=
44371
:/usr/lib64/libcrypt-2.17.so glibc-2.17-260.el7_6.5.x86_64 (CentOS) 155=
8444371
:/usr/lib64/liblzma.so.5.2.2 xz-libs-5.2.2-1.el7.x86_64 (CentOS) 155780=
6037
:/usr/lib64/libpthread-2.17.so glibc-2.17-260.el7_6.5.x86_64 (CentOS) 1=
558444371
:/usr/lib/locale/locale-archive glibc-common-2.17-260.el7_6.5.x86_64 (C=
entOS) 1558444367
:/usr/lib64/libdl-2.17.so glibc-2.17-260.el7_6.5.x86_64 (CentOS) 155844=
4371
:/usr/lib64/libargon2.so.0 libargon2-20161029-3.el7.x86_64 (Fedora Proj=
ect) 1557833216
:/usr/lib64/libkeyutils.so.1.5 keyutils-libs-1.5.8-3.el7.x86_64 (CentOS=
) 1557806038
:/usr/lib64/libk5crypto.so.3.1 krb5-libs-1.15.1-37.el7_6.x86_64 (CentOS=
) 1558444383
:/usr/lib64/libedit.so.0.0.42 libedit-3.0-12.20121213cvs.el7.x86_64 (Ce=
ntOS) 1557806046
environ:
:XDG_SESSION_ID=3D2155
:DOCKER_REPO=3Ddocker-registry.51uuabc.com
:HOSTNAME=3Dlifeng-centos7
:DOCKER_REPO_PASSWORD=3Duuabc@123
:TERM=3Dxterm
:SHELL=3D/bin/bash
:HISTSIZE=3D1000
:'SSH_CLIENT=3D192.168.16.1 61449 22'
:SSH_TTY=3D/dev/pts/1
:USER=3Droot
:LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36:mh=3D00:pi=3D40;33:so=3D01;35=
:do=3D01;35:bd=3D40;33;01:cd=3D40;33;01:or=3D40;31;01:mi=3D01;05;37;41:=
su=3D37;41:sg=3D30;43:ca=3D30;41:tw=3D30;42:ow=3D34;42:st=3D37;44:ex=3D=
01;32:*.tar=3D01;31:*.tgz=3D01;31:*.arc=3D01;31:*.arj=3D01;31:*.taz=3D0=
1;31:*.lha=3D01;31:*.lz4=3D01;31:*.lzh=3D01;31:*.lzma=3D01;31:*.tlz=3D0=
1;31:*.txz=3D01;31:*.tzo=3D01;31:*.t7z=3D01;31:*.zip=3D01;31:*.z=3D01;3=
1:*.Z=3D01;31:*.dz=3D01;31:*.gz=3D01;31:*.lrz=3D01;31:*.lz=3D01;31:*.lz=
o=3D01;31:*.xz=3D01;31:*.bz2=3D01;31:*.bz=3D01;31:*.tbz=3D01;31:*.tbz2=
=3D01;31:*.tz=3D01;31:*.deb=3D01;31:*.rpm=3D01;31:*.jar=3D01;31:*.war=
=3D01;31:*.ear=3D01;31:*.sar=3D01;31:*.rar=3D01;31:*.alz=3D01;31:*.ace=
=3D01;31:*.zoo=3D01;31:*.cpio=3D01;31:*.7z=3D01;31:*.rz=3D01;31:*.cab=
=3D01;31:*.jpg=3D01;35:*.jpeg=3D01;35:*.gif=3D01;35:*.bmp=3D01;35:*.pbm=
=3D01;35:*.pgm=3D01;35:*.ppm=3D01;35:*.tga=3D01;35:*.xbm=3D01;35:*.xpm=
=3D01;35:*.tif=3D01;35:*.tiff=3D01;35:*.png=3D01;35:*.svg=3D01;35:*.svg=
z=3D01;35:*.mng=3D01;35:*.pcx=3D01;35:*.mov=3D01;35:*.mpg=3D01;35:*.mpe=
g=3D01;35:*.m2v=3D01;35:*.mkv=3D01;35:*.webm=3D01;35:*.ogm=3D01;35:*.mp=
4=3D01;35:*.m4v=3D01;35:*.mp4v=3D01;35:*.vob=3D01;35:*.qt=3D01;35:*.nuv=
=3D01;35:*.wmv=3D01;35:*.asf=3D01;35:*.rm=3D01;35:*.rmvb=3D01;35:*.flc=
=3D01;35:*.avi=3D01;35:*.fli=3D01;35:*.flv=3D01;35:*.gl=3D01;35:*.dl=3D=
01;35:*.xcf=3D01;35:*.xwd=3D01;35:*.yuv=3D01;35:*.cgm=3D01;35:*.emf=3D0=
1;35:*.axv=3D01;35:*.anx=3D01;35:*.ogv=3D01;35:*.ogx=3D01;35:*.aac=3D01=
;36:*.au=3D01;36:*.flac=3D01;36:*.mid=3D01;36:*.midi=3D01;36:*.mka=3D01=
;36:*.mp3=3D01;36:*.mpc=3D01;36:*.ogg=3D01;36:*.ra=3D01;36:*.wav=3D01;3=
6:*.axa=3D01;36:*.oga=3D01;36:*.spx=3D01;36:*.xspf=3D01;36:
:MAIL=3D/var/spool/mail/root
:PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
:ENV_NAME=3Dlocal
:PWD=3D/data/phpcpp_extension/extension2
:LANG=3Den_US.UTF-8
:MODULEPATH=3D/usr/share/Modules/modulefiles:/etc/modulefiles
:LOADEDMODULES=3D
:HISTCONTROL=3Dignoredups
:SHLVL=3D1
:HOME=3D/root
:LOGNAME=3Droot
:XDG_DATA_DIRS=3D/root/.local/share/flatpak/exports/share:/var/lib/flat=
pak/exports/share:/usr/local/share:/usr/share
:'SSH_CONNECTION=3D192.168.16.1 61449 192.168.16.128 22'
:MODULESHOME=3D/usr/share/Modules
:DOCKER_REPO_USER=3Ddev
:'LESSOPEN=3D||/usr/bin/lesspipe.sh %s'
:XDG_RUNTIME_DIR=3D/run/user/0
:DISPLAY=3Dlocalhost:11.0
:'BASH_FUNC_module()=3D() {  eval `/usr/bin/modulecmd bash $*`\n}'
:OLDPWD=3D/root
:_=3D/usr/bin/php
exploitable:
:Likely crash reason: Jump to an invalid address
:Exploitable rating (0-9 scale): 6
limits:
:Limit                     Soft Limit           Hard Limit           Un=
its    =20
:Max cpu time              unlimited            unlimited            se=
conds  =20
:Max file size             unlimited            unlimited            by=
tes    =20
:Max data size             unlimited            unlimited            by=
tes    =20
:Max stack size            8388608              unlimited            by=
tes    =20
:Max core file size        0                    unlimited            by=
tes    =20
:Max resident set          unlimited            unlimited            by=
tes    =20
:Max processes             3791                 3791                 pr=
ocesses=20
:Max open files            1024                 4096                 fi=
les    =20
:Max locked memory         65536                65536                by=
tes    =20
:Max address space         unlimited            unlimited            by=
tes    =20
:Max file locks            unlimited            unlimited            lo=
cks    =20
:Max pending signals       3791                 3791                 si=
gnals  =20
:Max msgqueue size         819200               819200               by=
tes    =20
:Max nice priority         0                    0                   =20
:Max realtime priority     0                    0                   =20
:Max realtime timeout      unlimited            unlimited            us=
       =20
machineid:
:systemd=3Ddf8bdffc3cd54dafbf802bec209098fe
:sosreport_uploader-dmidecode=3Ddc757d352c5ff406e3c0d780ace7fb6d1353a58=
b1cea2d563fb73cf7b9edafb4
maps:
:562d270ad000-562d27510000 r-xp 00000000 08:03 17929997                =
   /opt/remi/php73/root/usr/bin/php
:562d27710000-562d2779c000 r--p 00463000 08:03 17929997                =
   /opt/remi/php73/root/usr/bin/php
:562d2779c000-562d2779e000 rw-p 004ef000 08:03 17929997                =
   /opt/remi/php73/root/usr/bin/php
:562d2779e000-562d277bb000 rw-p 00000000 00:00 0=20
:562d27a9a000-562d27c8d000 rw-p 00000000 00:00 0                       =
   [heap]
:7f03174d6000-7f031da00000 r--p 00000000 08:03 51377276                =
   /usr/lib/locale/locale-archive
:7f031dcd8000-7f031dd38000 r-xp 00000000 08:03 254063                  =
   /usr/lib64/libpcre.so.1.2.0
:7f031dd38000-7f031df38000 ---p 00060000 08:03 254063                  =
   /usr/lib64/libpcre.so.1.2.0
:7f031df38000-7f031df39000 r--p 00060000 08:03 254063                  =
   /usr/lib64/libpcre.so.1.2.0
:7f031df39000-7f031df3a000 rw-p 00061000 08:03 254063                  =
   /usr/lib64/libpcre.so.1.2.0
:7f031df3a000-7f031df5e000 r-xp 00000000 08:03 2327644                 =
   /usr/lib64/libselinux.so.1
:7f031df5e000-7f031e15d000 ---p 00024000 08:03 2327644                 =
   /usr/lib64/libselinux.so.1
:7f031e15d000-7f031e15e000 r--p 00023000 08:03 2327644                 =
   /usr/lib64/libselinux.so.1
:7f031e15e000-7f031e15f000 rw-p 00024000 08:03 2327644                 =
   /usr/lib64/libselinux.so.1
:7f031e15f000-7f031e161000 rw-p 00000000 00:00 0=20
:7f031e161000-7f031e164000 r-xp 00000000 08:03 302226                  =
   /usr/lib64/libkeyutils.so.1.5
:7f031e164000-7f031e363000 ---p 00003000 08:03 302226                  =
   /usr/lib64/libkeyutils.so.1.5
:7f031e363000-7f031e364000 r--p 00002000 08:03 302226                  =
   /usr/lib64/libkeyutils.so.1.5
:7f031e364000-7f031e365000 rw-p 00003000 08:03 302226                  =
   /usr/lib64/libkeyutils.so.1.5
:7f031e365000-7f031e373000 r-xp 00000000 08:03 1377995                 =
   /usr/lib64/libkrb5support.so.0.1
:7f031e373000-7f031e573000 ---p 0000e000 08:03 1377995                 =
   /usr/lib64/libkrb5support.so.0.1
:7f031e573000-7f031e574000 r--p 0000e000 08:03 1377995                 =
   /usr/lib64/libkrb5support.so.0.1
:7f031e574000-7f031e575000 rw-p 0000f000 08:03 1377995                 =
   /usr/lib64/libkrb5support.so.0.1
:7f031e575000-7f031e59a000 r-xp 00000000 08:03 302105                  =
   /usr/lib64/liblzma.so.5.2.2
:7f031e59a000-7f031e799000 ---p 00025000 08:03 302105                  =
   /usr/lib64/liblzma.so.5.2.2
:7f031e799000-7f031e79a000 r--p 00024000 08:03 302105                  =
   /usr/lib64/liblzma.so.5.2.2
:7f031e79a000-7f031e79b000 rw-p 00025000 08:03 302105                  =
   /usr/lib64/liblzma.so.5.2.2
:7f031e79b000-7f031e7b0000 r-xp 00000000 08:03 2969630                 =
   /usr/lib64/libgcc_s-4.8.5-20150702.so.1
:7f031e7b0000-7f031e9af000 ---p 00015000 08:03 2969630                 =
   /usr/lib64/libgcc_s-4.8.5-20150702.so.1
:7f031e9af000-7f031e9b0000 r--p 00014000 08:03 2969630                 =
   /usr/lib64/libgcc_s-4.8.5-20150702.so.1
:7f031e9b0000-7f031e9b1000 rw-p 00015000 08:03 2969630                 =
   /usr/lib64/libgcc_s-4.8.5-20150702.so.1
:7f031e9b1000-7f031e9c8000 r-xp 00000000 08:03 253713                  =
   /usr/lib64/libpthread-2.17.so
:7f031e9c8000-7f031ebc7000 ---p 00017000 08:03 253713                  =
   /usr/lib64/libpthread-2.17.so
:7f031ebc7000-7f031ebc8000 r--p 00016000 08:03 253713                  =
   /usr/lib64/libpthread-2.17.so
:7f031ebc8000-7f031ebc9000 rw-p 00017000 08:03 253713                  =
   /usr/lib64/libpthread-2.17.so
:7f031ebc9000-7f031ebcd000 rw-p 00000000 00:00 0=20
:7f031ebcd000-7f031ebcf000 r-xp 00000000 08:03 236125                  =
   /usr/lib64/libfreebl3.so
:7f031ebcf000-7f031edce000 ---p 00002000 08:03 236125                  =
   /usr/lib64/libfreebl3.so
:7f031edce000-7f031edcf000 r--p 00001000 08:03 236125                  =
   /usr/lib64/libfreebl3.so
:7f031edcf000-7f031edd0000 rw-p 00002000 08:03 236125                  =
   /usr/lib64/libfreebl3.so
:7f031edd0000-7f031ef92000 r-xp 00000000 08:03 253687                  =
   /usr/lib64/libc-2.17.so
:7f031ef92000-7f031f192000 ---p 001c2000 08:03 253687                  =
   /usr/lib64/libc-2.17.so
:7f031f192000-7f031f196000 r--p 001c2000 08:03 253687                  =
   /usr/lib64/libc-2.17.so
:7f031f196000-7f031f198000 rw-p 001c6000 08:03 253687                  =
   /usr/lib64/libc-2.17.so
:7f031f198000-7f031f19d000 rw-p 00000000 00:00 0=20
:7f031f19d000-7f031f3d2000 r-xp 00000000 08:03 1378000                 =
   /usr/lib64/libcrypto.so.1.0.2k
:7f031f3d2000-7f031f5d2000 ---p 00235000 08:03 1378000                 =
   /usr/lib64/libcrypto.so.1.0.2k
:7f031f5d2000-7f031f5ee000 r--p 00235000 08:03 1378000                 =
   /usr/lib64/libcrypto.so.1.0.2k
:7f031f5ee000-7f031f5fb000 rw-p 00251000 08:03 1378000                 =
   /usr/lib64/libcrypto.so.1.0.2k
:7f031f5fb000-7f031f5ff000 rw-p 00000000 00:00 0=20
:7f031f5ff000-7f031f666000 r-xp 00000000 08:03 664970                  =
   /usr/lib64/libssl.so.1.0.2k
:7f031f666000-7f031f866000 ---p 00067000 08:03 664970                  =
   /usr/lib64/libssl.so.1.0.2k
:7f031f866000-7f031f86a000 r--p 00067000 08:03 664970                  =
   /usr/lib64/libssl.so.1.0.2k
:7f031f86a000-7f031f871000 rw-p 0006b000 08:03 664970                  =
   /usr/lib64/libssl.so.1.0.2k
:7f031f871000-7f031f874000 r-xp 00000000 08:03 254039                  =
   /usr/lib64/libcom_err.so.2.1
:7f031f874000-7f031fa73000 ---p 00003000 08:03 254039                  =
   /usr/lib64/libcom_err.so.2.1
:7f031fa73000-7f031fa74000 r--p 00002000 08:03 254039                  =
   /usr/lib64/libcom_err.so.2.1
:7f031fa74000-7f031fa75000 rw-p 00003000 08:03 254039                  =
   /usr/lib64/libcom_err.so.2.1
:7f031fa75000-7f031faa6000 r-xp 00000000 08:03 1377987                 =
   /usr/lib64/libk5crypto.so.3.1
:7f031faa6000-7f031fca5000 ---p 00031000 08:03 1377987                 =
   /usr/lib64/libk5crypto.so.3.1
:7f031fca5000-7f031fca7000 r--p 00030000 08:03 1377987                 =
   /usr/lib64/libk5crypto.so.3.1
:7f031fca7000-7f031fca8000 rw-p 00032000 08:03 1377987                 =
   /usr/lib64/libk5crypto.so.3.1
:7f031fca8000-7f031fd81000 r-xp 00000000 08:03 1377993                 =
   /usr/lib64/libkrb5.so.3.3
:7f031fd81000-7f031ff80000 ---p 000d9000 08:03 1377993                 =
   /usr/lib64/libkrb5.so.3.3
:7f031ff80000-7f031ff8e000 r--p 000d8000 08:03 1377993                 =
   /usr/lib64/libkrb5.so.3.3
:7f031ff8e000-7f031ff91000 rw-p 000e6000 08:03 1377993                 =
   /usr/lib64/libkrb5.so.3.3
:7f031ff91000-7f031ffdb000 r-xp 00000000 08:03 664962                  =
   /usr/lib64/libgssapi_krb5.so.2.2
:7f031ffdb000-7f03201db000 ---p 0004a000 08:03 664962                  =
   /usr/lib64/libgssapi_krb5.so.2.2
:7f03201db000-7f03201dc000 r--p 0004a000 08:03 664962                  =
   /usr/lib64/libgssapi_krb5.so.2.2
:7f03201dc000-7f03201de000 rw-p 0004b000 08:03 664962                  =
   /usr/lib64/libgssapi_krb5.so.2.2
:7f03201de000-7f032033d000 r-xp 00000000 08:03 302107                  =
   /usr/lib64/libxml2.so.2.9.1
:7f032033d000-7f032053c000 ---p 0015f000 08:03 302107                  =
   /usr/lib64/libxml2.so.2.9.1
:7f032053c000-7f0320544000 r--p 0015e000 08:03 302107                  =
   /usr/lib64/libxml2.so.2.9.1
:7f0320544000-7f0320546000 rw-p 00166000 08:03 302107                  =
   /usr/lib64/libxml2.so.2.9.1
:7f0320546000-7f0320548000 rw-p 00000000 00:00 0=20
:7f0320548000-7f032055e000 r-xp 00000000 08:03 253695                  =
   /usr/lib64/libnsl-2.17.so
:7f032055e000-7f032075e000 ---p 00016000 08:03 253695                  =
   /usr/lib64/libnsl-2.17.so
:7f032075e000-7f032075f000 r--p 00016000 08:03 253695                  =
   /usr/lib64/libnsl-2.17.so
:7f032075f000-7f0320760000 rw-p 00017000 08:03 253695                  =
   /usr/lib64/libnsl-2.17.so
:7f0320760000-7f0320762000 rw-p 00000000 00:00 0=20
:7f0320762000-7f0320764000 r-xp 00000000 08:03 253689                  =
   /usr/lib64/libdl-2.17.so
:7f0320764000-7f0320964000 ---p 00002000 08:03 253689                  =
   /usr/lib64/libdl-2.17.so
:7f0320964000-7f0320965000 r--p 00002000 08:03 253689                  =
   /usr/lib64/libdl-2.17.so
:7f0320965000-7f0320966000 rw-p 00003000 08:03 253689                  =
   /usr/lib64/libdl-2.17.so
:7f0320966000-7f0320a67000 r-xp 00000000 08:03 253691                  =
   /usr/lib64/libm-2.17.so
:7f0320a67000-7f0320c66000 ---p 00101000 08:03 253691                  =
   /usr/lib64/libm-2.17.so
:7f0320c66000-7f0320c67000 r--p 00100000 08:03 253691                  =
   /usr/lib64/libm-2.17.so
:7f0320c67000-7f0320c68000 rw-p 00101000 08:03 253691                  =
   /usr/lib64/libm-2.17.so
:7f0320c68000-7f0320c6f000 r-xp 00000000 08:03 253717                  =
   /usr/lib64/librt-2.17.so
:7f0320c6f000-7f0320e6e000 ---p 00007000 08:03 253717                  =
   /usr/lib64/librt-2.17.so
:7f0320e6e000-7f0320e6f000 r--p 00006000 08:03 253717                  =
   /usr/lib64/librt-2.17.so
:7f0320e6f000-7f0320e70000 rw-p 00007000 08:03 253717                  =
   /usr/lib64/librt-2.17.so
:7f0320e70000-7f0320e85000 r-xp 00000000 08:03 254032                  =
   /usr/lib64/libz.so.1.2.7
:7f0320e85000-7f0321084000 ---p 00015000 08:03 254032                  =
   /usr/lib64/libz.so.1.2.7
:7f0321084000-7f0321085000 r--p 00014000 08:03 254032                  =
   /usr/lib64/libz.so.1.2.7
:7f0321085000-7f0321086000 rw-p 00015000 08:03 254032                  =
   /usr/lib64/libz.so.1.2.7
:7f0321086000-7f032116f000 r-xp 00000000 08:03 254018                  =
   /usr/lib64/libstdc++.so.6.0.19
:7f032116f000-7f032136e000 ---p 000e9000 08:03 254018                  =
   /usr/lib64/libstdc++.so.6.0.19
:7f032136e000-7f0321376000 r--p 000e8000 08:03 254018                  =
   /usr/lib64/libstdc++.so.6.0.19
:7f0321376000-7f0321378000 rw-p 000f0000 08:03 254018                  =
   /usr/lib64/libstdc++.so.6.0.19
:7f0321378000-7f032138d000 rw-p 00000000 00:00 0=20
:7f032138d000-7f03213b2000 r-xp 00000000 08:03 254030                  =
   /usr/lib64/libtinfo.so.5.9
:7f03213b2000-7f03215b2000 ---p 00025000 08:03 254030                  =
   /usr/lib64/libtinfo.so.5.9
:7f03215b2000-7f03215b6000 r--p 00025000 08:03 254030                  =
   /usr/lib64/libtinfo.so.5.9
:7f03215b6000-7f03215b7000 rw-p 00029000 08:03 254030                  =
   /usr/lib64/libtinfo.so.5.9
:7f03215b7000-7f03215dd000 r-xp 00000000 08:03 254015                  =
   /usr/lib64/libncurses.so.5.9
:7f03215dd000-7f03217dc000 ---p 00026000 08:03 254015                  =
   /usr/lib64/libncurses.so.5.9
:7f03217dc000-7f03217dd000 r--p 00025000 08:03 254015                  =
   /usr/lib64/libncurses.so.5.9
:7f03217dd000-7f03217de000 rw-p 00026000 08:03 254015                  =
   /usr/lib64/libncurses.so.5.9
:7f03217de000-7f0321813000 r-xp 00000000 08:03 432583                  =
   /usr/lib64/libedit.so.0.0.42
:7f0321813000-7f0321a12000 ---p 00035000 08:03 432583                  =
   /usr/lib64/libedit.so.0.0.42
:7f0321a12000-7f0321a15000 r--p 00034000 08:03 432583                  =
   /usr/lib64/libedit.so.0.0.42
:7f0321a15000-7f0321a16000 rw-p 00037000 08:03 432583                  =
   /usr/lib64/libedit.so.0.0.42
:7f0321a16000-7f0321a1b000 rw-p 00000000 00:00 0=20
:7f0321a1b000-7f0321a31000 r-xp 00000000 08:03 253715                  =
   /usr/lib64/libresolv-2.17.so
:7f0321a31000-7f0321c30000 ---p 00016000 08:03 253715                  =
   /usr/lib64/libresolv-2.17.so
:7f0321c30000-7f0321c31000 r--p 00015000 08:03 253715                  =
   /usr/lib64/libresolv-2.17.so
:7f0321c31000-7f0321c32000 rw-p 00016000 08:03 253715                  =
   /usr/lib64/libresolv-2.17.so
:7f0321c32000-7f0321c34000 rw-p 00000000 00:00 0=20
:7f0321c34000-7f0321c3b000 r-xp 00000000 08:03 2327647                 =
   /usr/lib64/libargon2.so.0
:7f0321c3b000-7f0321e3a000 ---p 00007000 08:03 2327647                 =
   /usr/lib64/libargon2.so.0
:7f0321e3a000-7f0321e3b000 r--p 00006000 08:03 2327647                 =
   /usr/lib64/libargon2.so.0
:7f0321e3b000-7f0321e3c000 rw-p 00007000 08:03 2327647                 =
   /usr/lib64/libargon2.so.0
:7f0321e3c000-7f0321e44000 r-xp 00000000 08:03 254060                  =
   /usr/lib64/libcrypt-2.17.so
:7f0321e44000-7f0322043000 ---p 00008000 08:03 254060                  =
   /usr/lib64/libcrypt-2.17.so
:7f0322043000-7f0322044000 r--p 00007000 08:03 254060                  =
   /usr/lib64/libcrypt-2.17.so
:7f0322044000-7f0322045000 rw-p 00008000 08:03 254060                  =
   /usr/lib64/libcrypt-2.17.so
:7f0322045000-7f0322073000 rw-p 00000000 00:00 0=20
:7f0322073000-7f0322095000 r-xp 00000000 08:03 254055                  =
   /usr/lib64/ld-2.17.so
:7f032226e000-7f032227e000 rw-p 00000000 00:00 0=20
:7f0322293000-7f0322294000 rw-p 00000000 00:00 0=20
:7f0322294000-7f0322295000 r--p 00021000 08:03 254055                  =
   /usr/lib64/ld-2.17.so
:7f0322295000-7f0322296000 rw-p 00022000 08:03 254055                  =
   /usr/lib64/ld-2.17.so
:7f0322296000-7f0322297000 rw-p 00000000 00:00 0=20
:7ffdc8cf4000-7ffdc8d15000 rw-p 00000000 00:00 0                       =
   [stack]
:7ffdc8df7000-7ffdc8df9000 r-xp 00000000 00:00 0                       =
   [vdso]
:ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0               =
   [vsyscall]
open_fds:
:0:socket:[44760708]
:pos:=090
:flags:=0902000002
:mnt_id:=098
os_info:
:NAME=3D"CentOS Linux"
:VERSION=3D"7 (Core)"
:ID=3D"centos"
:ID_LIKE=3D"rhel fedora"
:VERSION_ID=3D"7"
:PRETTY_NAME=3D"CentOS Linux 7 (Core)"
:ANSI_COLOR=3D"0;31"
:CPE_NAME=3D"cpe:/o:centos:centos:7"
:HOME_URL=3D"https://www.centos.org/"
:BUG_REPORT_URL=3D"https://bugs.centos.org/"
:
:CENTOS_MANTISBT_PROJECT=3D"CentOS-7"
:CENTOS_MANTISBT_PROJECT_VERSION=3D"7"
:REDHAT_SUPPORT_PRODUCT=3D"centos"
:REDHAT_SUPPORT_PRODUCT_VERSION=3D"7"
:
proc_pid_status:
:Name:=09php
:Umask:=090022
:State:=09S (sleeping)
:Tgid:=09116489
:Ngid:=090
:Pid:=09116489
:PPid:=09111441
:TracerPid:=090
:Uid:=090=090=090=090
:Gid:=090=090=090=090
:FDSize:=09256
:Groups:=090=20
:VmPeak:=09  393156 kB
:VmSize:=09  180348 kB
:VmLck:=09       0 kB
:VmPin:=09       0 kB
:VmHWM:=09   14032 kB
:VmRSS:=09    8508 kB
:RssAnon:=09    3292 kB
:RssFile:=09    5216 kB
:RssShmem:=09       0 kB
:VmData:=09    2564 kB
:VmStk:=09     132 kB
:VmExe:=09    4492 kB
:VmLib:=09   11140 kB
:VmPTE:=09     172 kB
:VmSwap:=09       0 kB
:Threads:=091
:SigQ:=092/3791
:SigPnd:=090000000000000000
:ShdPnd:=090000000000000000
:SigBlk:=090000000000000000
:SigIgn:=090000000000001000
:SigCgt:=090000000184004a07
:CapInh:=090000000000000000
:CapPrm:=090000001fffffffff
:CapEff:=090000001fffffffff
:CapBnd:=090000001fffffffff
:CapAmb:=090000000000000000
:Seccomp:=090
:Cpus_allowed:=09ffffffff,ffffffff,ffffffff,ffffffff
:Cpus_allowed_list:=090-127
:Mems_allowed:=0900000000,00000000,00000000,00000000,00000000,00000000,=
00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000=
,00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000=
0,00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000=
00,00000000,00000001
:Mems_allowed_list:=090
:voluntary_ctxt_switches:=092
:nonvoluntary_ctxt_switches:=096
var_log_messages:
:[System Logs]:
:May 31 17:03:02 lifeng-centos7 php[90817]: DIGEST-MD5 common mech free
:May 31 17:04:13 lifeng-centos7 php[91989]: DIGEST-MD5 common mech free
:May 31 17:04:16 lifeng-centos7 php[91995]: DIGEST-MD5 common mech free
:May 31 17:06:16 lifeng-centos7 php[93865]: DIGEST-MD5 common mech free
:May 31 17:06:50 lifeng-centos7 php[94428]: DIGEST-MD5 common mech free
:May 31 17:07:25 lifeng-centos7 php[94902]: DIGEST-MD5 common mech free
:May 31 17:07:25 lifeng-centos7 kernel: php[94902]: segfault at 7f435ac=
88fbe ip 00007f435ac88fbe sp 00007ffdeb556af8 error 14 in locale-archiv=
e[7f43634d6000+652a000]
:May 31 17:07:25 lifeng-centos7 abrt-hook-ccpp[94903]: Process 94902 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 17:07:41 lifeng-centos7 php[95269]: DIGEST-MD5 common mech free
:May 31 17:07:41 lifeng-centos7 kernel: php[95269]: segfault at 7f3fbca=
88fbe ip 00007f3fbca88fbe sp 00007fffeaeaf1d8 error 14 in locale-archiv=
e[7f3fc52d6000+652a000]
:May 31 17:07:41 lifeng-centos7 abrt-hook-ccpp[95270]: Process 95269 (p=
hp) of user 0 killed by SIGSEGV - ignoring (repeated crash)
:May 31 17:08:02 lifeng-centos7 php[95588]: DIGEST-MD5 common mech free
:May 31 17:40:02 lifeng-centos7 php[124951]: DIGEST-MD5 common mech fre=
e
:May 31 17:40:09 lifeng-centos7 php[125017]: DIGEST-MD5 common mech fre=
e
:May 31 17:40:31 lifeng-centos7 php[125357]: DIGEST-MD5 common mech fre=
e
:May 31 17:40:31 lifeng-centos7 kernel: php[125357]: segfault at 7f16f9=
888fbe ip 00007f16f9888fbe sp 00007ffc461cda28 error 14 in locale-archi=
ve[7f17020d6000+652a000]
:May 31 17:40:31 lifeng-centos7 abrt-hook-ccpp[125358]: Process 125357 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 31 17:41:13 lifeng-centos7 php[126127]: DIGEST-MD5 common mech fre=
e
:May 31 17:41:17 lifeng-centos7 php[126180]: DIGEST-MD5 common mech fre=
e
:May 31 17:41:17 lifeng-centos7 kernel: php[126180]: segfault at 7f7f50=
488fbe ip 00007f7f50488fbe sp 00007ffc5e3a70d8 error 14 in locale-archi=
ve[7f7f58cd6000+652a000]
:May 31 17:41:17 lifeng-centos7 abrt-hook-ccpp[126181]: Process 126180 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 31 17:42:14 lifeng-centos7 php[127126]: DIGEST-MD5 common mech fre=
e
:May 31 17:42:17 lifeng-centos7 php[127189]: DIGEST-MD5 common mech fre=
e
:May 31 17:42:17 lifeng-centos7 kernel: php[127189]: segfault at 7f7f0f=
288fbe ip 00007f7f0f288fbe sp 00007ffe5d8aee38 error 14 in locale-archi=
ve[7f7f17ad6000+652a000]
:May 31 17:42:17 lifeng-centos7 abrt-hook-ccpp[127190]: Process 127189 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 31 17:45:46 lifeng-centos7 php[130415]: DIGEST-MD5 common mech fre=
e
:May 31 17:45:49 lifeng-centos7 php[130523]: DIGEST-MD5 common mech fre=
e
:May 31 17:45:49 lifeng-centos7 kernel: php[130523]: segfault at 7f3119=
888fbe ip 00007f3119888fbe sp 00007fffaed3e4d8 error 14 in locale-archi=
ve[7f31220d6000+652a000]
:May 31 17:45:49 lifeng-centos7 abrt-hook-ccpp[130524]: Process 130523 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 31 17:48:51 lifeng-centos7 php[2679]: DIGEST-MD5 common mech free
:May 31 17:48:54 lifeng-centos7 php[2688]: DIGEST-MD5 common mech free
:May 31 17:48:54 lifeng-centos7 kernel: php[2688]: segfault at 7fdadda8=
8fbe ip 00007fdadda88fbe sp 00007ffe9d203ad8 error 14 in locale-archive=
[7fdae62d6000+652a000]
:May 31 17:48:54 lifeng-centos7 abrt-hook-ccpp[2689]: Process 2688 (php=
) of user 0 killed by SIGSEGV - dumping core
:May 31 17:51:55 lifeng-centos7 php[5588]: DIGEST-MD5 common mech free
:May 31 17:51:55 lifeng-centos7 kernel: php[5588]: segfault at 7f7764c8=
8fbe ip 00007f7764c88fbe sp 00007ffdc195b438 error 14 in locale-archive=
[7f776d4d6000+652a000]
:May 31 17:51:55 lifeng-centos7 abrt-hook-ccpp[5589]: Process 5588 (php=
) of user 0 killed by SIGSEGV - dumping core
:May 31 17:57:16 lifeng-centos7 php[10574]: DIGEST-MD5 common mech free
:May 31 17:57:19 lifeng-centos7 php[10683]: DIGEST-MD5 common mech free
:May 31 17:57:19 lifeng-centos7 kernel: php[10683]: segfault at 7fa7406=
88fbe ip 00007fa740688fbe sp 00007ffe5de7c828 error 14 in locale-archiv=
e[7fa748ed6000+652a000]
:May 31 17:57:19 lifeng-centos7 abrt-hook-ccpp[10684]: Process 10683 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 17:57:49 lifeng-centos7 php[11209]: DIGEST-MD5 common mech free
:May 31 17:57:54 lifeng-centos7 php[11244]: DIGEST-MD5 common mech free
:May 31 17:57:54 lifeng-centos7 kernel: php[11244]: segfault at 7efeb84=
87fbe ip 00007efeb8487fbe sp 00007ffc63a4faa8 error 14 in locale-archiv=
e[7efec0cd6000+652a000]
:May 31 17:57:54 lifeng-centos7 abrt-hook-ccpp[11245]: Process 11244 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:02:41 lifeng-centos7 php[16584]: DIGEST-MD5 common mech free
:May 31 18:02:43 lifeng-centos7 php[16639]: DIGEST-MD5 common mech free
:May 31 18:02:43 lifeng-centos7 kernel: php[16639]: segfault at 7f39e1c=
87fbe ip 00007f39e1c87fbe sp 00007ffcc5092d38 error 14 in locale-archiv=
e[7f39ea4d6000+652a000]
:May 31 18:02:43 lifeng-centos7 abrt-hook-ccpp[16640]: Process 16639 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:04:42 lifeng-centos7 php[18529]: DIGEST-MD5 common mech free
:May 31 18:04:45 lifeng-centos7 php[18589]: DIGEST-MD5 common mech free
:May 31 18:04:45 lifeng-centos7 kernel: php[18589]: segfault at 7fac1f8=
88fbe ip 00007fac1f888fbe sp 00007fff7aba6f68 error 14 in locale-archiv=
e[7fac280d6000+652a000]
:May 31 18:04:45 lifeng-centos7 abrt-hook-ccpp[18590]: Process 18589 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:09:48 lifeng-centos7 php[23264]: DIGEST-MD5 common mech free
:May 31 18:09:54 lifeng-centos7 php[23422]: DIGEST-MD5 common mech free
:May 31 18:09:54 lifeng-centos7 kernel: php[23422]: segfault at 7ff6440=
88fbe ip 00007ff644088fbe sp 00007fff3a194658 error 14 in locale-archiv=
e[7ff64c8d6000+652a000]
:May 31 18:09:54 lifeng-centos7 abrt-hook-ccpp[23423]: Process 23422 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:10:33 lifeng-centos7 php[24112]: DIGEST-MD5 common mech free
:May 31 18:10:33 lifeng-centos7 kernel: php[24112]: segfault at 7f000fe=
88fbe ip 00007f000fe88fbe sp 00007ffe9215b218 error 14 in locale-archiv=
e[7f00186d6000+652a000]
:May 31 18:10:33 lifeng-centos7 abrt-hook-ccpp[24118]: Process 24112 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:11:39 lifeng-centos7 php[25136]: DIGEST-MD5 common mech free
:May 31 18:11:39 lifeng-centos7 kernel: php[25136]: segfault at 7f6953a=
88fbe ip 00007f6953a88fbe sp 00007fff83af19d8 error 14 in locale-archiv=
e[7f695c2d6000+652a000]
:May 31 18:11:39 lifeng-centos7 abrt-hook-ccpp[25138]: Process 25136 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:16:45 lifeng-centos7 php[29905]: DIGEST-MD5 common mech free
:May 31 18:16:45 lifeng-centos7 kernel: php[29905]: segfault at 7f8b81c=
88fbe ip 00007f8b81c88fbe sp 00007fffdadf7668 error 14 in locale-archiv=
e[7f8b8a4d6000+652a000]
:May 31 18:16:45 lifeng-centos7 abrt-hook-ccpp[29906]: Process 29905 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:26:14 lifeng-centos7 php[38683]: DIGEST-MD5 common mech free
:May 31 18:26:15 lifeng-centos7 php[38740]: DIGEST-MD5 common mech free
:May 31 18:26:15 lifeng-centos7 kernel: php[38740]: segfault at 7feb55a=
88fbe ip 00007feb55a88fbe sp 00007ffca2e37da8 error 14 in locale-archiv=
e[7feb5e2d6000+652a000]
:May 31 18:26:15 lifeng-centos7 abrt-hook-ccpp[38741]: Process 38740 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:30:33 lifeng-centos7 php[42857]: DIGEST-MD5 common mech free
:May 31 18:30:33 lifeng-centos7 kernel: php[42857]: segfault at 7fd32bc=
88fbe ip 00007fd32bc88fbe sp 00007ffdeffeb8b8 error 14 in locale-archiv=
e[7fd3344d6000+652a000]
:May 31 18:30:33 lifeng-centos7 abrt-hook-ccpp[42863]: Process 42857 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:31:44 lifeng-centos7 php[44061]: DIGEST-MD5 common mech free
:May 31 18:31:46 lifeng-centos7 php[44072]: DIGEST-MD5 common mech free
:May 31 18:31:46 lifeng-centos7 kernel: php[44072]: segfault at 7fdaab2=
88fbe ip 00007fdaab288fbe sp 00007ffe6b45e0f8 error 14 in locale-archiv=
e[7fdab3ad6000+652a000]
:May 31 18:31:46 lifeng-centos7 abrt-hook-ccpp[44073]: Process 44072 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:49:07 lifeng-centos7 php[60058]: DIGEST-MD5 common mech free
:May 31 18:49:12 lifeng-centos7 php[60152]: DIGEST-MD5 common mech free
:May 31 18:49:12 lifeng-centos7 kernel: php[60152]: segfault at 7f40390=
88fbe ip 00007f4039088fbe sp 00007fffa063f178 error 14 in locale-archiv=
e[7f40418d6000+652a000]
:May 31 18:49:12 lifeng-centos7 abrt-hook-ccpp[60158]: Process 60152 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:50:09 lifeng-centos7 php[61128]: DIGEST-MD5 common mech free
:May 31 18:50:13 lifeng-centos7 kernel: php[61145]: segfault at 7fe1d34=
88fbe ip 00007fe1d3488fbe sp 00007ffc264c2e88 error 14 in locale-archiv=
e[7fe1dbcd6000+652a000]
:May 31 18:50:13 lifeng-centos7 php[61145]: DIGEST-MD5 common mech free
:May 31 18:50:13 lifeng-centos7 abrt-hook-ccpp[61151]: Process 61145 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:51:01 lifeng-centos7 php[61994]: DIGEST-MD5 common mech free
:May 31 18:51:04 lifeng-centos7 php[62065]: DIGEST-MD5 common mech free
:May 31 18:51:04 lifeng-centos7 kernel: php[62065]: segfault at 7f03ae6=
88fbe ip 00007f03ae688fbe sp 00007fffbfcf49a8 error 14 in locale-archiv=
e[7f03b6ed6000+652a000]
:May 31 18:51:04 lifeng-centos7 abrt-hook-ccpp[62066]: Process 62065 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:Jun 03 13:15:02 lifeng-centos7 php[112695]: DIGEST-MD5 common mech fre=
e
:Jun 03 13:15:05 lifeng-centos7 php[112788]: DIGEST-MD5 common mech fre=
e
:Jun 03 13:15:05 lifeng-centos7 kernel: php[112788]: segfault at 7efdd7=
688fbe ip 00007efdd7688fbe sp 00007ffcac6aea18 error 14 in locale-archi=
ve[7efddfed6000+652a000]
:Jun 03 13:15:05 lifeng-centos7 abrt-hook-ccpp[112789]: Process 112788 =
(php) of user 0 killed by SIGSEGV - dumping core
:Jun 03 13:18:29 lifeng-centos7 php[115969]: DIGEST-MD5 common mech fre=
e
:Jun 03 13:18:32 lifeng-centos7 php[115981]: DIGEST-MD5 common mech fre=
e
:Jun 03 13:18:32 lifeng-centos7 kernel: php[115981]: segfault at 7f275a=
688fbe ip 00007f275a688fbe sp 00007ffebb2609d8 error 14 in locale-archi=
ve[7f2762ed6000+652a000]
:Jun 03 13:18:32 lifeng-centos7 abrt-hook-ccpp[115982]: Process 115981 =
(php) of user 0 killed by SIGSEGV - dumping core
:Jun 03 13:18:58 lifeng-centos7 php[116489]: DIGEST-MD5 common mech fre=
e
:Jun 03 13:18:58 lifeng-centos7 kernel: php[116489]: segfault at 7f030e=
c88fbe ip 00007f030ec88fbe sp 00007ffdc8d13238 error 14 in locale-archi=
ve[7f03174d6000+652a000]
:Jun 03 13:18:58 lifeng-centos7 abrt-hook-ccpp[116490]: Process 116489 =
(php) of user 0 killed by SIGSEGV - dumping core
:[User Logs]:
:May 30 17:53:47 lifeng-centos7 php[126244]: DIGEST-MD5 common mech fre=
e
:May 30 17:53:47 lifeng-centos7 abrt-hook-ccpp[126245]: Process 126244 =
(php) of user 0 killed by SIGSEGV - ignoring (repeated crash)
:May 30 17:53:55 lifeng-centos7 php[126398]: DIGEST-MD5 common mech fre=
e
:May 30 17:54:09 lifeng-centos7 php[126556]: DIGEST-MD5 common mech fre=
e
:May 30 17:54:19 lifeng-centos7 php[126712]: DIGEST-MD5 common mech fre=
e
:May 30 17:54:19 lifeng-centos7 abrt-hook-ccpp[126713]: Process 126712 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 30 17:54:27 lifeng-centos7 php[126928]: DIGEST-MD5 common mech fre=
e
:May 30 17:54:36 lifeng-centos7 php[127081]: DIGEST-MD5 common mech fre=
e
:May 30 17:54:43 lifeng-centos7 php[127186]: DIGEST-MD5 common mech fre=
e
:May 30 17:54:51 lifeng-centos7 php[127291]: DIGEST-MD5 common mech fre=
e
:May 30 17:55:00 lifeng-centos7 php[127398]: DIGEST-MD5 common mech fre=
e
:May 30 17:55:00 lifeng-centos7 abrt-hook-ccpp[127399]: Process 127398 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 30 17:55:15 lifeng-centos7 php[127756]: DIGEST-MD5 common mech fre=
e
:May 30 17:55:15 lifeng-centos7 abrt-hook-ccpp[127757]: Process 127756 =
(php) of user 0 killed by SIGSEGV - ignoring (repeated crash)
:May 30 17:55:21 lifeng-centos7 php[127772]: DIGEST-MD5 common mech fre=
e
:May 30 17:55:21 lifeng-centos7 abrt-hook-ccpp[127773]: Process 127772 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 30 17:55:27 lifeng-centos7 php[127978]: DIGEST-MD5 common mech fre=
e
:May 30 17:55:27 lifeng-centos7 abrt-hook-ccpp[127979]: Process 127978 =
(php) of user 0 killed by SIGSEGV - ignoring (repeated crash)
:May 30 17:55:33 lifeng-centos7 php[128035]: DIGEST-MD5 common mech fre=
e
:May 30 17:55:33 lifeng-centos7 abrt-hook-ccpp[128036]: Process 128035 =
(php) of user 0 killed by SIGSEGV - ignoring (repeated crash)
:May 31 17:00:39 lifeng-centos7 php[88493]: DIGEST-MD5 common mech free
:May 31 17:01:13 lifeng-centos7 php[89052]: DIGEST-MD5 common mech free
:May 31 17:01:49 lifeng-centos7 php[89640]: DIGEST-MD5 common mech free
:May 31 17:02:11 lifeng-centos7 php[90021]: DIGEST-MD5 common mech free
:May 31 17:02:15 lifeng-centos7 php[90078]: DIGEST-MD5 common mech free
:May 31 17:03:02 lifeng-centos7 php[90817]: DIGEST-MD5 common mech free
:May 31 17:04:13 lifeng-centos7 php[91989]: DIGEST-MD5 common mech free
:May 31 17:04:16 lifeng-centos7 php[91995]: DIGEST-MD5 common mech free
:May 31 17:06:16 lifeng-centos7 php[93865]: DIGEST-MD5 common mech free
:May 31 17:06:50 lifeng-centos7 php[94428]: DIGEST-MD5 common mech free
:May 31 17:07:25 lifeng-centos7 php[94902]: DIGEST-MD5 common mech free
:May 31 17:07:25 lifeng-centos7 abrt-hook-ccpp[94903]: Process 94902 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 17:07:41 lifeng-centos7 php[95269]: DIGEST-MD5 common mech free
:May 31 17:07:41 lifeng-centos7 abrt-hook-ccpp[95270]: Process 95269 (p=
hp) of user 0 killed by SIGSEGV - ignoring (repeated crash)
:May 31 17:08:02 lifeng-centos7 php[95588]: DIGEST-MD5 common mech free
:May 31 17:40:02 lifeng-centos7 php[124951]: DIGEST-MD5 common mech fre=
e
:May 31 17:40:09 lifeng-centos7 php[125017]: DIGEST-MD5 common mech fre=
e
:May 31 17:40:31 lifeng-centos7 php[125357]: DIGEST-MD5 common mech fre=
e
:May 31 17:40:31 lifeng-centos7 abrt-hook-ccpp[125358]: Process 125357 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 31 17:41:13 lifeng-centos7 php[126127]: DIGEST-MD5 common mech fre=
e
:May 31 17:41:17 lifeng-centos7 php[126180]: DIGEST-MD5 common mech fre=
e
:May 31 17:41:17 lifeng-centos7 abrt-hook-ccpp[126181]: Process 126180 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 31 17:42:14 lifeng-centos7 php[127126]: DIGEST-MD5 common mech fre=
e
:May 31 17:42:17 lifeng-centos7 php[127189]: DIGEST-MD5 common mech fre=
e
:May 31 17:42:17 lifeng-centos7 abrt-hook-ccpp[127190]: Process 127189 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 31 17:45:46 lifeng-centos7 php[130415]: DIGEST-MD5 common mech fre=
e
:May 31 17:45:49 lifeng-centos7 php[130523]: DIGEST-MD5 common mech fre=
e
:May 31 17:45:49 lifeng-centos7 abrt-hook-ccpp[130524]: Process 130523 =
(php) of user 0 killed by SIGSEGV - dumping core
:May 31 17:48:51 lifeng-centos7 php[2679]: DIGEST-MD5 common mech free
:May 31 17:48:54 lifeng-centos7 php[2688]: DIGEST-MD5 common mech free
:May 31 17:48:54 lifeng-centos7 abrt-hook-ccpp[2689]: Process 2688 (php=
) of user 0 killed by SIGSEGV - dumping core
:May 31 17:51:55 lifeng-centos7 php[5588]: DIGEST-MD5 common mech free
:May 31 17:51:55 lifeng-centos7 abrt-hook-ccpp[5589]: Process 5588 (php=
) of user 0 killed by SIGSEGV - dumping core
:May 31 17:57:16 lifeng-centos7 php[10574]: DIGEST-MD5 common mech free
:May 31 17:57:19 lifeng-centos7 php[10683]: DIGEST-MD5 common mech free
:May 31 17:57:19 lifeng-centos7 abrt-hook-ccpp[10684]: Process 10683 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 17:57:49 lifeng-centos7 php[11209]: DIGEST-MD5 common mech free
:May 31 17:57:54 lifeng-centos7 php[11244]: DIGEST-MD5 common mech free
:May 31 17:57:54 lifeng-centos7 abrt-hook-ccpp[11245]: Process 11244 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:02:41 lifeng-centos7 php[16584]: DIGEST-MD5 common mech free
:May 31 18:02:43 lifeng-centos7 php[16639]: DIGEST-MD5 common mech free
:May 31 18:02:43 lifeng-centos7 abrt-hook-ccpp[16640]: Process 16639 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:04:42 lifeng-centos7 php[18529]: DIGEST-MD5 common mech free
:May 31 18:04:45 lifeng-centos7 php[18589]: DIGEST-MD5 common mech free
:May 31 18:04:45 lifeng-centos7 abrt-hook-ccpp[18590]: Process 18589 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:09:48 lifeng-centos7 php[23264]: DIGEST-MD5 common mech free
:May 31 18:09:54 lifeng-centos7 php[23422]: DIGEST-MD5 common mech free
:May 31 18:09:54 lifeng-centos7 abrt-hook-ccpp[23423]: Process 23422 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:10:33 lifeng-centos7 php[24112]: DIGEST-MD5 common mech free
:May 31 18:10:33 lifeng-centos7 abrt-hook-ccpp[24118]: Process 24112 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:11:39 lifeng-centos7 php[25136]: DIGEST-MD5 common mech free
:May 31 18:11:39 lifeng-centos7 abrt-hook-ccpp[25138]: Process 25136 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:16:45 lifeng-centos7 php[29905]: DIGEST-MD5 common mech free
:May 31 18:16:45 lifeng-centos7 abrt-hook-ccpp[29906]: Process 29905 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:26:14 lifeng-centos7 php[38683]: DIGEST-MD5 common mech free
:May 31 18:26:15 lifeng-centos7 php[38740]: DIGEST-MD5 common mech free
:May 31 18:26:15 lifeng-centos7 abrt-hook-ccpp[38741]: Process 38740 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:30:33 lifeng-centos7 php[42857]: DIGEST-MD5 common mech free
:May 31 18:30:33 lifeng-centos7 abrt-hook-ccpp[42863]: Process 42857 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:31:44 lifeng-centos7 php[44061]: DIGEST-MD5 common mech free
:May 31 18:31:46 lifeng-centos7 php[44072]: DIGEST-MD5 common mech free
:May 31 18:31:46 lifeng-centos7 abrt-hook-ccpp[44073]: Process 44072 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:49:07 lifeng-centos7 php[60058]: DIGEST-MD5 common mech free
:May 31 18:49:12 lifeng-centos7 php[60152]: DIGEST-MD5 common mech free
:May 31 18:49:12 lifeng-centos7 abrt-hook-ccpp[60158]: Process 60152 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:50:09 lifeng-centos7 php[61128]: DIGEST-MD5 common mech free
:May 31 18:50:13 lifeng-centos7 php[61145]: DIGEST-MD5 common mech free
:May 31 18:50:13 lifeng-centos7 abrt-hook-ccpp[61151]: Process 61145 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:May 31 18:51:01 lifeng-centos7 php[61994]: DIGEST-MD5 common mech free
:May 31 18:51:04 lifeng-centos7 php[62065]: DIGEST-MD5 common mech free
:May 31 18:51:04 lifeng-centos7 abrt-hook-ccpp[62066]: Process 62065 (p=
hp) of user 0 killed by SIGSEGV - dumping core
:Jun 03 13:15:02 lifeng-centos7 php[112695]: DIGEST-MD5 common mech fre=
e
:Jun 03 13:15:05 lifeng-centos7 php[112788]: DIGEST-MD5 common mech fre=
e
:Jun 03 13:15:05 lifeng-centos7 abrt-hook-ccpp[112789]: Process 112788 =
(php) of user 0 killed by SIGSEGV - dumping core
:Jun 03 13:18:29 lifeng-centos7 php[115969]: DIGEST-MD5 common mech fre=
e
:Jun 03 13:18:32 lifeng-centos7 php[115981]: DIGEST-MD5 common mech fre=
e
:Jun 03 13:18:32 lifeng-centos7 abrt-hook-ccpp[115982]: Process 115981 =
(php) of user 0 killed by SIGSEGV - dumping core
:Jun 03 13:18:58 lifeng-centos7 php[116489]: DIGEST-MD5 common mech fre=
e
:Jun 03 13:18:58 lifeng-centos7 abrt-hook-ccpp[116490]: Process 116489 =
(php) of user 0 killed by SIGSEGV - dumping core```
scorninpc commented 5 years ago

What is your PHP version?

Here, with php 7.3.5:

Seleção_712

Makefile

NAME                =   test

INI_DIR             =   /etc/php/7.3/mods-available/

EXTENSION           =   ${NAME}.so
INI                 =   ${NAME}.INI

COMPILER            =   g++
LINKER              =   g++

COMPILER_FLAGS      =   -Wall -c -O2 -std=c++11 -fpic -o
LINKER_FLAGS        =   -shared
LINKER_DEPENDENCIES =   -lphpcpp

RM                  =   rm -f
CP                  =   cp -f
MKDIR               =   mkdir -p

SOURCES             =   $(wildcard *.cpp)
OBJECTS             =   $(SOURCES:%.cpp=%.o)

all:                    ${OBJECTS} ${EXTENSION}

${EXTENSION}:           ${OBJECTS}
                        ${LINKER} ${LINKER_FLAGS} -o $@ ${OBJECTS} ${LINKER_DEPENDENCIES}

${OBJECTS}:
                        ${COMPILER} ${COMPILER_FLAGS} $@ ${@:%.o=%.cpp}

install:
                        ${CP} ${EXTENSION} ${EXTENSION_DIR}
                        ${CP} ${INI} ${INI_DIR}

clean:
                        ${RM} ${EXTENSION} ${OBJECTS}

main.cpp

#include <phpcpp.h>
#include <iostream>
#include <stdlib.h>
using namespace std;

void myFunction()
{
    Php::out << "example output" << std::endl;
}

Php::Value myFunction2() 
{
    int a = (int)rand();
    if( a % 2 == 0 ) {
       return "string";
    }
    else {
       return 123;
    }
}

Php::Value sum_everything(Php::Parameters &parameters) 
{
    int result=0;
    for(auto &param : parameters) result+=param;
        return result;
}

extern "C" {
    PHPCPP_EXPORT void *get_module() 
    {
        static Php::Extension extension("myFunctions", "1.0");

        extension.add<myFunction>("myFunction");
        extension.add<myFunction2>("myFunction2");
        extension.add<sum_everything>("sum_everything");

        return extension;
    }
}

test.php

<?php

myFunction();

$a = myFunction2();
var_dump($a);

$b = sum_everything(2, 2);
var_dump($b);
lifenglsf commented 5 years ago

@scorninpc php7.3.5,I tried it with your code.

lifenglsf commented 5 years ago

image https://rpms.remirepo.net/wizard/,i used this repo and multiple php versions I build from source, image image image image

lifenglsf commented 5 years ago

In /var/log/messages,i found some message

Jun  6 13:33:57 lifeng-centos7 kernel: php[20341]: segfault at 7fd0aa661fbe ip 00007fd0aa661fbe sp 00007ffc9b4259f8 error 14 in locale-archive[7fd0aaad6000+652a000]
Jun  6 13:33:57 lifeng-centos7 abrt-hook-ccpp: Process 20341 (php) of user 0 killed by SIGSEGV - dumping core
Jun  6 13:33:57 lifeng-centos7 abrt-hook-ccpp: Failed to create core_backtrace: dwfl_getthread_frames failed: No DWARF information found

but i do not know,what it exact mean.

gdb debug i got some message

#0  0x00007fffef461fbe in ?? ()
#1  0x00007fffef17db19 in (anonymous namespace)::run (p=<optimized out>) at ../../../../libstdc++-v3/libsupc++/atexit_thread.cc:64
#2  0x00007ffff674fb69 in __run_exit_handlers (status=status@entry=0, listp=0x7ffff6adc6c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:77
#3  0x00007ffff674fbb7 in __GI_exit (status=status@entry=0) at exit.c:99
#4  0x000000000043fa6b in main (argc=3, argv=0x1165d80) at /root/Downloads/php-7.3.5/sapi/cli/php_cli.c:1427
scorninpc commented 5 years ago

I think you compile php-cpp with one version of php, and update php.

Try compile php-cpp again with this version of PHP. Make sure dev package are the same of binary.

Post compile output if you still have problem

lifenglsf commented 5 years ago

I removed remi version,and built from source,nothing help. main.zip here is all my code.

scorninpc commented 5 years ago

Works fine. Today I upgrade to 7.3.6, but worked with 7.3.5 too

Seleção_110

ps: stdlib and std namespace are unuseful for your code

I dont know. I got segment fault when i try to clean memory, and PHP try to clear after again. But u dont do it anywere. I really don't know.

My last shot, are you try run a vbox with clean install to see if any of your machine are broken.

lifenglsf commented 5 years ago

Already in vmbox,I try new one.I confused too

lifenglsf commented 5 years ago

image minmal centos7.6,everything not change Thanks,anyway

scorninpc commented 5 years ago

Try to do hard debug if you dont know how to dbg:

1º - Run php file, only with some echo, not calling your functions, but with extension loaded if OK: 2º - Run php file, only with myFunction(), without showing result with var_dump if OK: 3º - Run php file, only with myFunction2(), without showing result with var_dump if OK: 4º - Run php file, only with sum_everything, without showing result with var_dump ...

Can you show this test for us?

lifenglsf commented 5 years ago

1.ok 2.segmentation fault 3.ok 4.ok The segmentation fault will only occur if myfunction is called.

scorninpc commented 5 years ago

Crash with myFunction() ? the simplest method?

Try replace Php::out to Php::call, to see if the problem is out put ou the method out()

Php::call("var_dump", "example output");
lifenglsf commented 5 years ago

Php::call works fine.

Crash with myFunction() ? the simplest method? Yes!

scorninpc commented 5 years ago

So try diferent methods of outputs

http://www.php-cpp.com/documentation/output-and-errors

Maybe some lib free buffer, and when PHP try free, this crash. Try use Php:echo or Php::call until you not find the wrong lib

lifenglsf commented 5 years ago

php::call works find only