phalcon / cphalcon

High performance, full-stack PHP framework delivered as a C extension.
https://phalcon.io
BSD 3-Clause "New" or "Revised" License
10.78k stars 1.97k forks source link

illegal instruction in phalcon_realpath #2468

Closed TheIrritainer closed 9 years ago

TheIrritainer commented 10 years ago

i tried setting up another project with phalcon today, my first one didn't include views and it is workin superb. So now i fired up the phalcon devtools, created a skeleton project and used scaffold for a table; just a quickie.

on windows it is working fine but when i pushed it to my centos digitalocean server i ran into 'illegal instruction'.

server: centos 6.5 32 bit php: 5.3.3 Phalcon Version 1.3.1

did a core dump, seems that there goes something wrong in phalcon_realpath?

GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1) 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 "i686-redhat-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /usr/bin/php...Reading symbols from /usr/lib/debug/usr/bin/php.debug...done. done. [New Thread 11436]

... cutted ....

Core was generated by `php index.php'. Program terminated with signal 4, Illegal instruction.

0 0x03c3a118 in phalcon_realpath () from /usr/lib/php/modules/phalcon.so

Missing separate debuginfos, use: debuginfo-install audit-libs-2.2-2.el6.i686 cyrus-sasl-lib-2.1.23-13.el6_3.1.i686 freetype-2.3.11-14.el6_3.1.i686 keyutils-libs-1.4-4.el6.i686 libX11-1.5.0-4.el6.i686 libXau-1.0.6-4.el6.i686 libXpm-3.5.10-2.el6.i686 libc-client-2007e-11.el6.i686 libcurl-7.19.7-37.el6_4.i686 libedit-2.11-4.20080712cvs.1.el6.i686 libidn-1.18-2.el6.i686 libjpeg-turbo-1.2.1-3.el6_5.i686 libmcrypt-2.5.8-9.el6.i686 libpng-1.2.49-1.el6_2.i686 libselinux-2.0.94-5.3.el6_4.1.i686 libssh2-1.4.2-1.el6.i686 libxcb-1.8.1-1.el6.i686 mysql-libs-5.1.73-3.el6_5.i686 ncurses-libs-5.7-3.20090208.el6.i686 nspr-4.10.2-1.el6_5.i686 nss-3.15.3-6.el6_5.i686 nss-softokn-freebl-3.14.3-10.el6_5.i686 nss-util-3.15.3-1.el6_5.i686 openldap-2.4.23-34.el6_5.1.i686 pam-1.1.1-17.el6.i686 php-mcrypt-5.3.3-3.el6.i686 sqlite-3.6.20-1.el6.i686 [?1034h(gdb) quit


gcc info:

[root@emtay public]# gcc -march=native -mtune=native -Q -O2 --help=target The following options are target specific: -m128bit-long-double [disabled] -m32 [enabled] -m3dnow [disabled] -m3dnowa [disabled] -m64 [disabled] -m80387 [enabled] -m96bit-long-double [enabled] -mabm [disabled] -maccumulate-outgoing-args [disabled] -maes [disabled] -malign-double [disabled] -malign-functions= -malign-jumps= -malign-loops= -malign-stringops [enabled] -march= pentium-m -masm= -mavx [disabled] -mbmi [enabled] -mbranch-cost= -mcld [disabled] -mcmodel= -mcrc32 [disabled] -mcx16 [enabled] -mf16c [disabled] -mfancy-math-387 [enabled] -mfma [disabled] -mfma4 [disabled] -mforce-drap [disabled] -mfp-ret-in-387 [enabled] -mfpmath= -mfsgsbase [disabled] -mfused-madd [enabled] -mglibc [enabled] -mhard-float [enabled] -mieee-fp [enabled] -mincoming-stack-boundary= -minline-all-stringops [disabled] -minline-stringops-dynamically [disabled] -mintel-syntax [disabled] -mlarge-data-threshold= -mlwp [disabled] -mmmx [disabled] -mmovbe [disabled] -mms-bitfields [disabled] -mno-align-stringops [disabled] -mno-fancy-math-387 [disabled] -mno-push-args [disabled] -mno-red-zone [disabled] -mno-sse4 [enabled] -momit-leaf-frame-pointer [disabled] -mpc -mpclmul [disabled] -mpopcnt [enabled] -mpreferred-stack-boundary= -mpush-args [enabled] -mrdrnd [disabled] -mrecip [disabled] -mred-zone [enabled] -mregparm= -mrtd [disabled] -msahf [enabled] -msoft-float [disabled] -msse [disabled] -msse2 [disabled] -msse2avx [disabled] -msse3 [disabled] -msse4 [disabled] -msse4.1 [disabled] -msse4.2 [disabled] -msse4a [disabled] -msseregparm [disabled] -mssse3 [disabled] -mstack-arg-probe [disabled] -mstackrealign [enabled] -mstringop-strategy= -mtbm [disabled] -mtls-dialect= -mtls-direct-seg-refs [enabled] -mtune= generic -muclibc [disabled] -mveclibabi= -mxop [disabled]


[root@emtay public]# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 2 model name : QEMU Virtual CPU version 1.0 stepping : 3 cpu MHz : 2399.998 cache size : 4096 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 4 wp : yes flags : fpu de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm up unfair_spinlock pni vmx cx16 popcnt hypervisor lahf_lm bogomips : 4799.99 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management:

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

phalcon commented 10 years ago

Try compiling this way:

cd build/32bits
export CFLAGS="-O2 -fvisibility=hidden"
phpize
./configure --enable-phalcon
make
sudo make install
TheIrritainer commented 10 years ago

followed instructions but it didn't seem to help, the new phalcon.so file is copied to the modules directory and i did restart apache..

sjinks commented 10 years ago

What does

x/i $pc

show (must be run from (gdb) prompt)?

TheIrritainer commented 10 years ago

Loaded symbols for /lib/libnss_dns-2.12.so Core was generated by `php index.php'. Program terminated with signal 4, Illegal instruction.

0 0x068ee118 in ?? ()

Missing separate debuginfos, use: debuginfo-install audit-libs-2.2-2.el6.i686 cyrus-sasl-lib-2.1.23-13.el6_3.1.i686 freetype-2.3.11-14.el6_3.1.i686 keyutils-libs-1.4-4.el6.i686 libX11-1.5.0-4.el6.i686 libXau-1.0.6-4.el6.i686 libXpm-3.5.10-2.el6.i686 libc-client-2007e-11.el6.i686 libcurl-7.19.7-37.el6_4.i686 libedit-2.11-4.20080712cvs.1.el6.i686 libidn-1.18-2.el6.i686 libjpeg-turbo-1.2.1-3.el6_5.i686 libmcrypt-2.5.8-9.el6.i686 libpng-1.2.49-1.el6_2.i686 libselinux-2.0.94-5.3.el6_4.1.i686 libssh2-1.4.2-1.el6.i686 libxcb-1.8.1-1.el6.i686 mysql-libs-5.1.73-3.el6_5.i686 ncurses-libs-5.7-3.20090208.el6.i686 nspr-4.10.2-1.el6_5.i686 nss-3.15.3-6.el6_5.i686 nss-softokn-freebl-3.14.3-10.el6_5.i686 nss-util-3.15.3-1.el6_5.i686 openldap-2.4.23-34.el6_5.1.i686 pam-1.1.1-17.el6.i686 php-mcrypt-5.3.3-3.el6.i686 sqlite-3.6.20-1.el6.i686 (gdb) x/i $pc => 0x68ee118: Cannot access memory at address 0x68ee118 (gdb)

sjinks commented 10 years ago

OK, please try to compile Phalcon this way:

cd build/32bits
export CFLAGS="-O0 -g3 -fvisibility=hidden"
phpize
./configure --enable-phalcon
make
sudo make install

and then generate backtrace at the gdb prompt with bt full.

TheIrritainer commented 10 years ago

[root@emtay public]# php index.php Illegal instruction (core dumped) [root@emtay public]# ls core.10772 core.32284 index.php output.txt [root@emtay public]# ls -la total 9332 drwxr-xr-x 2 apache apache 4096 Jun 10 15:11 . drwxr-xr-x 5 apache apache 4096 May 25 10:16 .. -rw------- 1 root root 5603328 Jun 10 15:11 core.10772 -rw------- 1 root root 5603328 Jun 6 04:24 core.32284 -rw-r--r-- 1 apache apache 212 May 25 10:15 .htaccess -rw-r--r-- 1 apache apache 562 May 25 10:58 index.php -rw-r--r-- 1 root root 12496 May 25 11:21 output.txt [root@emtay public]# gdb core.10772 GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el64.1) 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 "i686-redhat-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /usr/bin/php...Reading symbols from /usr/lib/debug/usr/bin/php.debug...done. done. [New Thread 10772] Missing separate debuginfo for /usr/lib/php/modules/apc.so Try: yum --disablerepo='' --enablerepo='-debug' install /usr/lib/debug/.build-id/98/9a428a98bc1910f867b97a8c326ce2fea03288 Missing separate debuginfo for /usr/lib/php/modules/phalcon.so Try: yum --disablerepo='' --enablerepo='-debug' install /usr/lib/debug/.build-id/74/75544d0e259aa594432c455673e3f8a68867c8 Missing separate debuginfo for Try: yum --disablerepo='' --enablerepo='_-debug*' install /usr/lib/debug/.build-id/92/876f81fbe25861f1165b46aa18d8a554011c42 Reading symbols from /lib/libcrypt-2.12.so...Reading symbols from /usr/lib/debug/lib/libcrypt-2.12.so.debug...done. done. Loaded symbols for /lib/libcrypt-2.12.so Reading symbols from /usr/lib/sse2/libgmp.so.3.5.0...Reading symbols from /usr/lib/debug/usr/lib/sse2/libgmp.so.3.5.0.debug... warning: "/usr/lib/debug/usr/lib/sse2/libgmp.so.3.5.0.debug": separate debug info file has no debug info (no debugging symbols found)...done. (no debugging symbols found)...done. Loaded symbols for /usr/lib/sse2/libgmp.so.3.5.0 Reading symbols from /lib/libbz2.so.1.0.4...Reading symbols from /usr/lib/debug/lib/libbz2.so.1.0.4.debug...done. done. Loaded symbols for /lib/libbz2.so.1.0.4 Reading symbols from /lib/libz.so.1.2.3...Reading symbols from /usr/lib/debug/lib/libz.so.1.2.3.debug...done. done. Loaded symbols for /lib/libz.so.1.2.3 Reading symbols from /lib/libpcre.so.0.0.1...Reading symbols from /usr/lib/debug/lib/libpcre.so.0.0.1.debug...done. done. Loaded symbols for /lib/libpcre.so.0.0.1 Reading symbols from /lib/libm-2.12.so...Reading symbols from /usr/lib/debug/lib/libm-2.12.so.debug...done. done. Loaded symbols for /lib/libm-2.12.so Reading symbols from /lib/libdl-2.12.so...Reading symbols from /usr/lib/debug/lib/libdl-2.12.so.debug...done. done. Loaded symbols for /lib/libdl-2.12.so Reading symbols from /lib/libnsl-2.12.so...Reading symbols from /usr/lib/debug/lib/libnsl-2.12.so.debug...done. done. Loaded symbols for /lib/libnsl-2.12.so Reading symbols from /usr/lib/libxml2.so.2.7.6...Reading symbols from /usr/lib/debug/usr/lib/libxml2.so.2.7.6.debug...done. done. Loaded symbols for /usr/lib/libxml2.so.2.7.6 Reading symbols from /lib/libgssapi_krb5.so.2.2...Reading symbols from /usr/lib/debug/lib/libgssapi_krb5.so.2.2.debug...done. done. Loaded symbols for /lib/libgssapi_krb5.so.2.2 Reading symbols from /lib/libkrb5.so.3.3...Reading symbols from /usr/lib/debug/lib/libkrb5.so.3.3.debug...done. done. Loaded symbols for /lib/libkrb5.so.3.3 Reading symbols from /lib/libk5crypto.so.3.1...Reading symbols from /usr/lib/debug/lib/libk5crypto.so.3.1.debug...done. done. Loaded symbols for /lib/libk5crypto.so.3.1 Reading symbols from /lib/libcom_err.so.2.1...Reading symbols from /usr/lib/debug/lib/libcom_err.so.2.1.debug...done. done. Loaded symbols for /lib/libcom_err.so.2.1 Reading symbols from /usr/lib/libssl.so.1.0.1e...Reading symbols from /usr/lib/debug/usr/lib/libssl.so.1.0.1e.debug...done. done. Loaded symbols for /usr/lib/libssl.so.1.0.1e Reading symbols from /usr/lib/libcrypto.so.1.0.1e...Reading symbols from /usr/lib/debug/usr/lib/libcrypto.so.1.0.1e.debug...done. done. Loaded symbols for /usr/lib/libcrypto.so.1.0.1e Reading symbols from /lib/libc-2.12.so...Reading symbols from /usr/lib/debug/lib/libc-2.12.so.debug...done. done. Loaded symbols for /lib/libc-2.12.so Reading symbols from /lib/libresolv-2.12.so...Reading symbols from /usr/lib/debug/lib/libresolv-2.12.so.debug...done. done. Loaded symbols for /lib/libresolv-2.12.so Reading symbols from /lib/ld-2.12.so...Reading symbols from /usr/lib/debug/lib/ld-2.12.so.debug...done. done. Loaded symbols for /lib/ld-2.12.so Reading symbols from /lib/libkrb5support.so.0.1...Reading symbols from /usr/lib/debug/lib/libkrb5support.so.0.1.debug...done. done. Loaded symbols for /lib/libkrb5support.so.0.1 Reading symbols from /lib/libpthread-2.12.so...Reading symbols from /usr/lib/debug/lib/libpthread-2.12.so.debug...done. [Thread debugging using libthread_db enabled] done. Loaded symbols for /lib/libpthread-2.12.so Reading symbols from /lib/librt-2.12.so...Reading symbols from /usr/lib/debug/lib/librt-2.12.so.debug...done. done. Loaded symbols for /lib/librt-2.12.so Reading symbols from /usr/lib/php/modules/curl.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/curl.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/curl.so Reading symbols from /usr/lib/php/modules/fileinfo.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/fileinfo.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/fileinfo.so Reading symbols from /usr/lib/php/modules/gd.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/gd.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/gd.so Reading symbols from /usr/lib/php/modules/imap.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/imap.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/imap.so Reading symbols from /usr/lib/php/modules/json.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/json.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/json.so Reading symbols from /usr/lib/php/modules/mbstring.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/mbstring.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/mbstring.so Reading symbols from /usr/lib/php/modules/mysql.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/mysql.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/mysql.so Reading symbols from /usr/lib/php/modules/mysqli.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/mysqli.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/mysqli.so Reading symbols from /usr/lib/php/modules/pdo.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/pdo.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/pdo.so Reading symbols from /usr/lib/php/modules/pdo_mysql.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/pdo_mysql.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/pdo_mysql.so Reading symbols from /usr/lib/php/modules/pdo_sqlite.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/pdo_sqlite.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/pdo_sqlite.so Reading symbols from /usr/lib/php/modules/phar.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/phar.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/phar.so Reading symbols from /usr/lib/php/modules/sqlite3.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/sqlite3.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/sqlite3.so Reading symbols from /usr/lib/php/modules/zip.so...Reading symbols from /usr/lib/debug/usr/lib/php/modules/zip.so.debug...done. done. Loaded symbols for /usr/lib/php/modules/zip.so Reading symbols from /lib/libnss_files-2.12.so...Reading symbols from /usr/lib/debug/lib/libnss_files-2.12.so.debug...done. done. Loaded symbols for /lib/libnss_files-2.12.so Reading symbols from /lib/libnss_dns-2.12.so...Reading symbols from /usr/lib/debug/lib/libnss_dns-2.12.so.debug...done. done. Loaded symbols for /lib/libnss_dns-2.12.so Core was generated by `php index.php'. Program terminated with signal 4, Illegal instruction.

0 0x04a0a118 in ?? ()

Missing separate debuginfos, use: debuginfo-install audit-libs-2.2-2.el6.i686 cyrus-sasl-lib-2.1.23-13.el6_3.1.i686 freetype-2.3.11-14.el6_3.1.i686 keyutils-libs-1.4-4.el6.i686 libX11-1.5.0-4.el6.i686 libXau-1.0.6-4.el6.i686 libXpm-3.5.10-2.el6.i686 libc-client-2007e-11.el6.i686 libcurl-7.19.7-37.el6_4.i686 libedit-2.11-4.20080712cvs.1.el6.i686 libidn-1.18-2.el6.i686 libjpeg-turbo-1.2.1-3.el6_5.i686 libmcrypt-2.5.8-9.el6.i686 libpng-1.2.49-1.el6_2.i686 libselinux-2.0.94-5.3.el6_4.1.i686 libssh2-1.4.2-1.el6.i686 libxcb-1.8.1-1.el6.i686 mysql-libs-5.1.73-3.el6_5.i686 ncurses-libs-5.7-3.20090208.el6.i686 nspr-4.10.2-1.el6_5.i686 nss-3.15.3-6.el6_5.i686 nss-softokn-freebl-3.14.3-10.el6_5.i686 nss-util-3.15.3-1.el6_5.i686 openldap-2.4.23-34.el6_5.1.i686 pam-1.1.1-17.el6.i686 php-mcrypt-5.3.3-3.el6.i686 sqlite-3.6.20-1.el6.i686 (gdb) bt full

0 0x04a0a118 in ?? ()

No symbol table info available.

1 0x09542cb0 in ?? ()

No symbol table info available. Backtrace stopped: previous frame inner to this frame (corrupt stack?) (gdb)

andresgutierrez commented 9 years ago

Could you please try again using Phalcon 2 or close this issue as 1.3.x is no longer supported