Segmentation Fault for every project related action (create-model,.....)
Relating to this Forum Post: https://forum.phalconphp.com/edit/discussion/19579
Hey Guys,
I set up a new environment on macOS 10.14.4 using MAMP with PHP 7.3.1. The Phalcon extension is working fine, but I always get a segmentation fault when generating a model.
Details
- System info and versions (if possible): (
phalcon info): Phalcon DevTools (3.4.0)
Environment: OS: Darwin 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64 PHP Version: 7.3.1 PHP SAPI: cli PHP Bin: /Applications/MAMP/bin/php/php7.3.1/bin/php PHP Extension Dir: /Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731 PHP Bin Dir: /Applications/MAMP/bin/php/php7.3.1/bin Loaded PHP config: /Applications/MAMP/bin/php/php7.3.1/conf/php.ini Versions: Phalcon DevTools Version: 3.4.0 Phalcon Version: 3.4.2 AdminLTE Version: 2.3.6
- Phalcon Framework version: (
php --ri phalcon) 3.4.3 - PHP Version: (
php -v) 7.3.1 - Operating System: macOS 10.14.4
- Server: Apache
- Other related info (Database, table schema): mysql database
Thnx for your report. Can you list your extensions also? It could be that there is an extension missing.
@ruudboon
Here it goes:
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
phalcon
Phar
posix
readline
Reflection
session
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib
@Fuhunter Looks like you got them all. Where did you get the Phalcon.so from?
@ruudboon Compiled from source Branch v3.4.X
@Fuhunter Did you build it on the same Mac?
@ruudboon yes
Compiled from source Branch v3.4.X
if you used zephir 0.11 = don't. for phalcon 3 use zephir 0.10.
If you used ./build/install take a look at this commit ( this commit exists on my fork only ! )
https://github.com/Izopi4a/cphalcon/commit/a138e23047f3bd785e4b9401126c3822e9a47427
@Izopi4a I used the ./build/install file/folder
What does your change with the CFLAGS do? Whats the reason for it?
https://en.wikipedia.org/wiki/CFLAGS http://sdf.org/~riley/blog/2014/10/30/march-mtune/ for mac os i suggest using already compiled extensions tho
But doesn't the devtools just use Phalcon itself? Connect to the database, read the table columns and finally build a php model file? (Much simplified, I know)
Where does those CFLAGS optimisations about my processor fit in?
(Am I the only one affected by it?)
@Fuhunter Try to upgrade to v3.4.1
I deleted my local phalcon devtools folder, cloned it again from this repository and it still says Version 3.4.0
Try to download from releases page - https://github.com/phalcon/phalcon-devtools/releases . Also, reboot your MAMP server.
segfault comes from phalcon. As i said i remember some problems compiling it yourself on mac. If you know what you are doing then probably is fine. otherwise i suggest you use pre-compiled phalcon extension
@ruudboon As I remember you're created a PR to Phalcon repo to fix this. Could you send the same patch to 3.4.x branch so that we'll have at least ready to git clone branch.
@sergeyklay No problem. But don't think this is related. My fix was an issue where you could not run phalcon on a different machine (with older cpu)
@Fuhunter Could you please re-install Phalcon using 3.4.x branch and test again? Just clone the 3.4.x branch, go to build directory and call ./install script
This is a nice framework, but the installation process is too cumbersome to extend(composer); For example --laravel ,The installation is very simple,
@sergeyklay Sorry for the late response
Installed Phalcon from 3.4.x Branch, but still get the segmentation fault within phalcon-devtools when creating a model
I'll try to sort out as soon as I can