hi all,

i'm trying to use drush with php cli, but i can't make it work. The only response i get is "Segmentation fault". I tried to find a link with the php version i use but the problem seems to be elsewhere.
here is the result of php -v

PHP 5.2.0-8+etch13 (cli) (built: Oct  2 2008 08:26:18)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

Any help would be appreciated.
Thx in advance

Comments

greggles’s picture

Do any commands work? drush help for example should be pretty simple and just output some data (even if it's an error from drush, getting anything would be useful in debugging the problem).

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)
IncrediblyKenzi’s picture

I ran into something similar when running drush update. This is on a mac running MAMP with php5:

PHP 5.2.5 (cli) (built: Nov 29 2007 09:31:38) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
    with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend Technologies
    with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies

When running under gdb:

gdb --args php -q ./drush update force
(gdb) run
....
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xf06fff5c
0x034023cc in get_module ()
(gdb) bt
#0  0x034023cc in get_module ()
#1  0x052c6584 in ?? ()

Any thoughts?
Cannot access memory at address 0xf06fff60

RockyRoad’s picture

I have the same issue, with any command arguments, including none.
The funny thing is, don't ask for help to display it :D

mich@home:/usr/local/share/drupal$ php --version
PHP 5.2.4-2ubuntu5.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 11 2009 20:09:52) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
    with Xdebug v2.0.2, Copyright (c) 2002-2007, by Derick Rethans

mich@home:/usr/local/share/drupal$ ../drush/drush.php help
E: Invalid command help.
Segmentation fault

mich@home:/usr/local/share/drupal$ gdb --args php -q ../drush/drush.php
GNU gdb 6.8-debian
Copyright (C) 2008 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 "i486-linux-gnu"...
(no debugging symbols found)
(gdb) run
Starting program: /usr/bin/php -q ../drush/drush.php
(no debugging symbols found)
...
(no debugging symbols found)
[New Thread 0xb77a76d0 (LWP 26407)]

Usage: drush.php [options] <command> <command> ...

Run "drush help [command]" to view command-specific help.
...
  generate content 	Creates content.                                                     

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb77a76d0 (LWP 26407)]
0xb7042010 in ?? ()

HTH

moshe weitzman’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)
graytech’s picture

I am having a similar issue. but it only occurs when I use 'drush dl '. I have created a support request at http://drupal.org/node/606828

Did this issue ever get resolved?

~Gray~

graytech’s picture

Status: Closed (fixed) » Active
greggles’s picture

Status: Active » Closed (fixed)

If you created another issue don't re-open this one.

graytech’s picture

Forgive me. I think I may have done that by accident. I'll take more care in the future ;)

btw .. The issue was resolved by updating the libxml library on our server. Drush is working perfectly now.

take care,
~Gray~

mail@victorquinn.com’s picture

I know this is a bit of an old thread, but I just ran into this problem and solved it and thought I'd post my solution here in case it helps anyone.

My issue was that I needed to use "sudo drush" instead of just "drush."

Sudo-ing stopped the segmentation fault error for a bit longer into the command, but it still occurred. I was stumped until I found this link:
PHP CLI Segmentation Fault PGSQL

Chris Charlton’s picture

Using sudo didn't work for me. This error popped up for me just this morning with no real change done to my system. I am using MAMP and I was getting a mysql.sock error which I fixed through a symlink and it worked before without issue. Now I get "Segmentation fault".

kenorb’s picture

Component: Installation » PM (dl, en, up ...)

I've got SEGV crash when using var_export() in the code once enabling the module.
See: http://bugs.xdebug.org/view.php?id=850

DaPooch’s picture

I've seen this before when memory gets scarce on a server with no swapfile enabled. Killing off some bloated processes and restarting others freed up memory and it started working right again.

benjarlett’s picture

Version: 6.x-1.2 » 8.x-6.x-dev
Issue summary: View changes

I concur... my site developed a memory full situation, drush stopped working, couldn't work out how to disable anything, used an automated backup to roll site back to before I'd created the memory full situation, and all worked again... i'd say it's a symptom of a memory full situation... it was for me anyway.

dinesh18’s picture

I am facing the same issue in PHP 7.0. What could be the issue?

rinku_talukdar’s picture

@Dinesh18 Did you dot some solution? I also got the same issue.

nitin.k’s picture

Component: PM (dl, en, up ...) » Core Commands

Hi Guys,

Am getting the below error when i am updating the drupal core from 8.8.1 to 8.9.20.

root@drupal:/var/www/html# drush status
Segmentation fault (core dumped)

drush -d status

Drush bootstrap phase : bootstrap_drupal_database() [0.57 sec, 3.1 MB] [bootstrap]
Successfully connected to the Drupal database. [0.57 sec, 3.1 MB] [bootstrap]
Find command files for phase 4 (max=7) [0.57 sec, 3.1 MB] [debug]
Drush bootstrap phase : bootstrap_drupal_full() [0.57 sec, 3.1 MB] [bootstrap]
About to bootstrap the Drupal 8 Kernel. [0.57 sec, 3.1 MB] [debug]
Segmentation fault (core dumped)

cc: Manmathan M