phalcon-devtools icon indicating copy to clipboard operation
phalcon-devtools copied to clipboard

Segmentation Fault for every project related action (create-model,.....)

Open Fuhunter opened this issue 7 years ago • 24 comments

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

Fuhunter avatar Apr 18 '19 11:04 Fuhunter

Thnx for your report. Can you list your extensions also? It could be that there is an extension missing.

ruudboon avatar Apr 18 '19 12:04 ruudboon

@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 avatar Apr 18 '19 12:04 Fuhunter

@Fuhunter Looks like you got them all. Where did you get the Phalcon.so from?

ruudboon avatar Apr 18 '19 12:04 ruudboon

@ruudboon Compiled from source Branch v3.4.X

Fuhunter avatar Apr 18 '19 12:04 Fuhunter

@Fuhunter Did you build it on the same Mac?

ruudboon avatar Apr 18 '19 12:04 ruudboon

@ruudboon yes

Fuhunter avatar Apr 18 '19 12:04 Fuhunter

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 avatar Apr 18 '19 12:04 Izopi4a

@Izopi4a I used the ./build/install file/folder

What does your change with the CFLAGS do? Whats the reason for it?

Fuhunter avatar Apr 18 '19 18:04 Fuhunter

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

Izopi4a avatar Apr 18 '19 18:04 Izopi4a

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 avatar Apr 23 '19 09:04 Fuhunter

@Fuhunter Try to upgrade to v3.4.1

Jeckerson avatar Apr 23 '19 09:04 Jeckerson

I deleted my local phalcon devtools folder, cloned it again from this repository and it still says Version 3.4.0

Fuhunter avatar Apr 23 '19 09:04 Fuhunter

Try to download from releases page - https://github.com/phalcon/phalcon-devtools/releases . Also, reboot your MAMP server.

Jeckerson avatar Apr 23 '19 09:04 Jeckerson

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

Izopi4a avatar Apr 23 '19 10:04 Izopi4a

@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 avatar May 02 '19 09:05 sergeyklay

@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)

ruudboon avatar May 02 '19 10:05 ruudboon

@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

sergeyklay avatar May 02 '19 13:05 sergeyklay

This is a nice framework, but the installation process is too cumbersome to extend(composer); For example --laravel ,The installation is very simple,

TOP-OWN avatar May 24 '19 02:05 TOP-OWN

@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

Fuhunter avatar May 24 '19 18:05 Fuhunter

I'll try to sort out as soon as I can

sergeyklay avatar May 25 '19 20:05 sergeyklay