Way to go, PHP. I have no idea why it does that

# /usr/share/drush/drush.php  --context_type='site' --platform='/var/aegir/hostmaster-0.4-alpha14-228-g625213c' --server='@server_master' --uri='test.aegir.koumbit.net' --site_path='/var/aegir/hostmaster-0.4-alpha14/sites/aegir.koumbit.net' --site_enabled --language='en' --client_email='webdev@rt.koumbit.net' --profile='hostmaster' --ssl_enabled='2' --ssl_key='koumbit.net' --loaded-config --name='test.aegir.koumbit.net' --debug provision-save 'test.aegir.koumbit.net'
Found command: provision-save (commandfile=provision) [0.12 sec, 7.36 MB]                                                                                                                                                           [bootstrap]
Initializing drush commandfile: drush_make [0.12 sec, 7.36 MB]                                                                                                                                                                      [bootstrap]
Initializing drush commandfile: drush_make_d_o [0.12 sec, 7.37 MB]                                                                                                                                                                  [bootstrap]
Initializing drush commandfile: provision [0.12 sec, 7.37 MB]                                                                                                                                                                       [bootstrap]
Load alias @self [0.12 sec, 7.37 MB]                                                                                                                                                                                                   [notice]
Erreur de segmentation
ceres:~/.drush$

This is trying to debug a alpha14 to HEAD upgrade, and I took that provision-save command from provision-clone:

drush @hostmaster provision-clone test.aegir.koumbit.net /var/aegir/hostmaster-0.4-alpha14-228-g625213c --debug

wtf?

Comments

anarcat’s picture

For the 'french-impared', "Erreur de segmentation" is "Segmentation fault".

That, is just weird.

anarcat’s picture

This also crashes the same way:

/usr/share/drush/drush.php  --context_type='site' --platform='/var/aegir/hostmaster-0.4-alpha14-228-g625213c' --server='@server_master' --uri='test.aegir.koumbit.net' --site_path='/var/aegir/hostmaster-0.4-alpha14/sites/aegir.koumbit.net' --site_enabled --language='en' --client_email='webdev@rt.koumbit.net' --profile='hostmaster' --ssl_enabled='2' --ssl_key='koumbit.net' --loaded-config--name='@test.aegir.koumbit.net' --debug provision-save '@test.aegir.koumbit.net'

I didn't have the right clone command... but this still fails.

anarcat’s picture

Priority: Critical » Normal

This happens because i am using the platform path instead of the alias.

We should still not core dump.

adrian’s picture

anarcat’s picture

This still core dumps after the commit, but I have other issues I will follow in other tickets.

anarcat’s picture

Or rather: the other issues are fixed with the above patch, but not the core dump problem.

This is not php 5.3.

Josh Benner’s picture

I am also getting segfaults on every provision-save that occurs as a result of running a verify on a site. If I run the provision-save command myself at the command line, it succeeds without a segfault.

This was happening to me with 0.4-beta2. I pulled the latest provision from Git, and I still see this behavior.

PHP 5.2.10.

Anonymous’s picture

Anarcat: Would be interested to know if this fixes it: http://git.aegirproject.org/?p=provision.git;a=commitdiff;h=c214fe6063fd...

anarcat’s picture

Status: Active » Postponed (maintainer needs more info)

I guess I'll see this when I upgrade our prod server to RC :P

anarcat’s picture

Status: Postponed (maintainer needs more info) » Active

i am seeing this in a production 0.4-rc1+ server, not sure why yet:

PHP 5.2.6-1+lenny9 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug  4 2010 06:06:53)
2.6.26-2-vserver-amd64
Debian GNU/Linux 5.0.8 (lenny)
provision-0.4-rc1-12-ga01ad03

after installing php5-xdebug, I see this:

Found command: provision-save (commandfile=provision) [0.07 sec, 9.61 MB]                                                                                                                                [bootstrap]
Initializing drush commandfile: drush_make [0.07 sec, 9.61 MB]                                                                                                                                           [bootstrap]
Initializing drush commandfile: drush_make_d_o [0.07 sec, 9.62 MB]                                                                                                                                       [bootstrap]
Initializing drush commandfile: provision [0.07 sec, 9.62 MB]                                                                                                                                            [bootstrap]
Load alias @self [0.07 sec, 9.62 MB]                                                                                                                                                                        [notice]
Load alias @server_master [0.08 sec, 9.63 MB]                                                                                                                                                               [notice]
Loading apache driver for the http service [0.08 sec, 9.66 MB]                                                                                                                                              [notice]
Load alias @platform_Drupal617 [0.08 sec, 9.67 MB]                                                                                                                                                          [notice]

Fatal error: Maximum function nesting level of '100' reached, aborting! in /srv/aegir/.drush/provision/provision.context.inc on line 23

Call Stack:
    0.0004     183176   1. {main}() /srv/aegir/drush/drush.php:0
    0.0092    2422968   2. drush_main() /srv/aegir/drush/drush.php:40
    0.0731   10078592   3. drush_dispatch() /srv/aegir/drush/drush.php:90
    0.0732   10078984   4. call_user_func_array() /srv/aegir/drush/includes/drush.inc:51
    0.0732   10078984   5. drush_command() /srv/aegir/drush/includes/drush.inc:0
    0.0744   10085872   6. call_user_func_array() /srv/aegir/drush/includes/command.inc:376
    0.0744   10085872   7. provision_drush_init() /srv/aegir/drush/includes/command.inc:0
    0.0744   10085984   8. d() /srv/aegir/.drush/provision/provision.drush.inc:60
    0.0766   10093216   9. provisionContext->method_invoke() /srv/aegir/.drush/provision/provision.context.inc:44
    0.0818   10144400  10. provisionContext->services_invoke() /srv/aegir/.drush/provision/provision.context.inc:209
    0.0818   10144400  11. provisionContext->get_services() /srv/aegir/.drush/provision/provision.context.inc:357
    0.0818   10144400  12. provisionContext->__get() /srv/aegir/.drush/provision/provision.context.inc:0
    0.0818   10144400  13. d() /srv/aegir/.drush/provision/provision.context.inc:140
    0.0839   10145536  14. provisionContext->method_invoke() /srv/aegir/.drush/provision/provision.context.inc:44
    0.0844   10146680  15. provisionContext->services_invoke() /srv/aegir/.drush/provision/provision.context.inc:209
    0.0844   10146680  16. provisionContext->get_services() /srv/aegir/.drush/provision/provision.context.inc:357
    0.0844   10146680  17. provisionContext->get_services() /srv/aegir/.drush/provision/provision.context.inc:376
[...]
    0.0856   10197040  98. provisionContext->__get() /srv/aegir/.drush/provision/provision.context.inc:0
    0.0856   10197272  99. d() /srv/aegir/.drush/provision/provision.context.inc:140
Anonymous’s picture

I wonder if this is the same infinite loop/recursion Drush Alias/context issue that unconed identified when he was working on Clusters?

#1016890: Create Server as cluster is broken after save

See patch in #4

anarcat’s picture

Title: provision-save core dumps on me » provision-save core dumps or loops

That issue doesn't seem to indicate the same error messages. However, the patch in #4 could fix the issue. Not sure I'll have time to fix it, but this should be fairly simple to reproduce and test.

anarcat’s picture

Title: provision-save core dumps or loops » provision-save core dumps on loops
Version: » 6.x-1.0-rc7

See also http://community.aegirproject.org/node/267

I do think this is a machine that unconed put his finger in. Glad he was able to get it out in time. Not sure i want to get my pinky in there. :P

guypaddock’s picture

Version: 6.x-1.0-rc7 » 6.x-1.3
Issue tags: +Suhosin, +aegir, +infinite recursion, +segmentation fault

I'm seeing similar behavior... after initial install, things were working fine. Then, after having some strange problems verifying platforms, I purged that install completely and started over. Now, I can't create platforms because "provision-save" seg-faults when verifying new platforms.

I have PHP 5.2.17, Suhosin-Patch 0.9.7, and eAccelerator v0.9.6.1 installed. At first I suspected Suhosin because the core-dump from the segmentation fault indicated infinite recursion among zend_do_fcall_common_helper_SPEC, suhosin_execute_ex, and execute. But, even after disabling Suhosin, I was seeing the same behavior (minus suhosin_execute_ex calls in the stack trace).

When I enable XDebug and set a stack depth limit of 1000, the error message in the Aegir log changes to:

The external command could not be executed due to an application error.

Without Xdebug, the message is:

The command could not be executed successfully (returned: sh: line 1: 15639 Segmentation fault (core dumped) /usr/bin/php /opt/drush/drush.php --php='/usr/bin/php' --root='/opt/aegir/platforms/standard-development-drupal-7.7' provision-save '@platform_StandardDevelopmentDrupal77' --backend 2>&1 , code: 139).

Xdebug doesn't print any error message to the console, but I enabled profiling and found that provisionContext->service() on line 334 of provision/provision.context.inc is invoked 980 times before the stack limit is reached. I believe that's where the infinite loop is.

Thoughts?

guypaddock’s picture

Hrm, this is precisely the issue I have:
http://community.aegirproject.org/node/266

guypaddock’s picture

BTW Here's the log from Aegir for the platform verify task:

Task starts processing
Trying to get property of non-object hosting.module:855
Running: /usr/bin/php /opt/drush/drush.php --php='/usr/bin/php' --root='/opt/aegir/platforms/standard-development-drupal-7.7' provision-save '@platform_StandardDevelopmentDrupal77' --backend 2>&1
Undefined offset: 1 backend.inc:163
Undefined variable: output backend.inc:170
The command could not be executed successfully (returned: sh: line 1: 27685 Segmentation fault /usr/bin/php /opt/drush/drush.php --php='/usr/bin/php' --root='/opt/aegir/platforms/standard-development-drupal-7.7' provision-save '@platform_StandardDevelopmentDrupal77' --backend 2>&1 , code: 139)
Running: /usr/bin/php /opt/drush/drush.php --php='/usr/bin/php' @platform_StandardDevelopmentDrupal77 provision-verify --backend 2>&1
Bootstrap to phase 0.
Drush bootstrap phase : _drush_bootstrap_drush()
Load alias @platform_StandardDevelopmentDrupal77
Bootstrap to phase 5.
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Loading drushrc "/opt/aegir/hostmaster-6.x-1.3/drushrc.php" into "drupal" scope.
Initialized Drupal 6.22 root directory at /opt/aegir/hostmaster-6.x-1.3
The drush command '@platform_StandardDevelopmentDrupal77 provision-verify' could not be found.
Could not find a Drupal settings.php file at ./sites/default/settings.php.
Undefined property: stdClass::$task_args hosting_task.module:572
Command dispatch complete
Peak memory usage was 23.87 MB

When I do a debug_print_backtrace() on the line before the warning "Trying to get property of non-object hosting.module:855" appears, this is what I get:

#0 hosting_context_name(0) called at [/opt/aegir/hostmaster-6.x-1.3/profiles/hostmaster/modules/hosting/platform/hosting_platform.drush.inc:12] 
#1 hosting_hosting_platform_context_options(stdClass Object ([nid] => 80,
   [type] => task,
   [language] => ,
   [uid] => 1,
   [status] => 1,
   [created] => 1314809381,
   [changed] => 1314809695,
   [comment] => 0,
   [promote] => 0,
   [moderate] => 0,
   [sticky] => 0,
   [tnid] => 0,
   [translate] => 0,
   [revision_uid] => 1,
   [title] => Verify: Standard Development (Drupal 7.7),
   [body] => ,
   [teaser] => ,
   [log] => ,
   [revision_timestamp] => 1314809683,
   [format] => 0,
   [name] => admin,
   [picture] => ,
   [data] => a:1:{s:13:"form_build_id";s:37:"form-f9199c4292a1dae1c67f912697d5cfbe";},
   [task_type] => verify,
   [executed] => 1314809695,
   [delta] => 0,
   [rid] => 79,
   [task_status] => -1,
   [ref] => stdClass Object ([nid] => 79,
   [type] => platform,
   [language] => ,
   [uid] => 1,
   [status] => 1,
   [created] => 1314809380,
   [changed] => 1314809380,
   [comment] => 0,
   [promote] => 0,
   [moderate] => 0,
   [sticky] => 0,
   [tnid] => 0,
   [translate] => 0,
   [vid] => 85,
   [revision_uid] => 1,
   [title] => Standard Development (Drupal 7.7),
   [body] => ,
   [teaser] => ,
   [log] => ,
   [revision_timestamp] => 1314809380,
   [format] => 0,
   [name] => admin,
   [picture] => ,
   [data] => a:1:{s:13:"form_build_id";s:37:"form-f9199c4292a1dae1c67f912697d5cfbe";},
   [publish_path] => /opt/aegir/platforms/standard-development-drupal-7.7,
   [makefile] => ,
   [verified] => 0,
   [web_server] => 0,
   [platform_status] => 0,
   [release] => ,
   [profiles] => Array (),
   [hosting_name] => platform_StandardDevelopmentDrupal77),
   [options] => Array (),
   [context_options] => Array ([context_type] => platform,
   [master_url] => http://aegir.mysite_was_removed_here.com/,
   [root] => ,
   [uri] => ,
   [server] => @server_master),
   [args] => Array (),
   [revision] => 1,
   [is_new] => ,
   [old_vid] => 94,
   [timestamp] => 1314809695,
   [vid] => 95)) 
#2 call_user_func(hosting_hosting_platform_context_options,
    stdClass Object ([nid] => 80,
   [type] => task,
   [language] => ,
   [uid] => 1,
   [status] => 1,
   [created] => 1314809381,
   [changed] => 1314809695,
   [comment] => 0,
   [promote] => 0,
   [moderate] => 0,
   [sticky] => 0,
   [tnid] => 0,
   [translate] => 0,
   [revision_uid] => 1,
   [title] => Verify: Standard Development (Drupal 7.7),
   [body] => ,
   [teaser] => ,
   [log] => ,
   [revision_timestamp] => 1314809683,
   [format] => 0,
   [name] => admin,
   [picture] => ,
   [data] => a:1:{s:13:"form_build_id";s:37:"form-f9199c4292a1dae1c67f912697d5cfbe";},
   [task_type] => verify,
   [executed] => 1314809695,
   [delta] => 0,
   [rid] => 79,
   [task_status] => -1,
   [ref] => stdClass Object ([nid] => 79,
   [type] => platform,
   [language] => ,
   [uid] => 1,
   [status] => 1,
   [created] => 1314809380,
   [changed] => 1314809380,
   [comment] => 0,
   [promote] => 0,
   [moderate] => 0,
   [sticky] => 0,
   [tnid] => 0,
   [translate] => 0,
   [vid] => 85,
   [revision_uid] => 1,
   [title] => Standard Development (Drupal 7.7),
   [body] => ,
   [teaser] => ,
   [log] => ,
   [revision_timestamp] => 1314809380,
   [format] => 0,
   [name] => admin,
   [picture] => ,
   [data] => a:1:{s:13:"form_build_id";s:37:"form-f9199c4292a1dae1c67f912697d5cfbe";},
   [publish_path] => /opt/aegir/platforms/standard-development-drupal-7.7,
   [makefile] => ,
   [verified] => 0,
   [web_server] => 0,
   [platform_status] => 0,
   [release] => ,
   [profiles] => Array (),
   [hosting_name] => platform_StandardDevelopmentDrupal77),
   [options] => Array (),
   [context_options] => Array ([context_type] => platform,
   [master_url] => http://aegir.mysite_was_removed_here.com/,
   [root] => ,
   [uri] => ,
   [server] => @server_master),
   [args] => Array (),
   [revision] => 1,
   [is_new] => ,
   [old_vid] => 94,
   [timestamp] => 1314809695,
   [vid] => 95)) called at [/opt/aegir/hostmaster-6.x-1.3/profiles/hostmaster/modules/hosting/task.hosting.inc:101] 
#3 drush_hosting_task(80) 
#4 call_user_func_array(drush_hosting_task,
    Array ([0] => 80)) called at [/opt/drush/includes/command.inc:134] 
#5 _drush_invoke_args(hosting-task,
    Array ([0] => 80),
    hosting) called at [/opt/drush/includes/command.inc:806] 
#6 drush_command(80) 
#7 call_user_func_array(drush_command,
    Array ([0] => 80)) called at [/opt/drush/includes/command.inc:214] 
#8 drush_dispatch(Array ([description] => execute a specific queue item,
   [arguments] => Array ([0] => 80),
   [bootstrap] => 5,
   [command] => hosting-task,
   [command-hook] => hosting-task,
   [callback arguments] => Array (),
   [commandfile] => hosting,
   [path] => profiles/hostmaster/modules/hosting,
   [engines] => Array (),
   [callback] => drush_command,
   [sections] => Array ([examples] => Examples,
   [arguments] => Arguments,
   [options] => Options),
   [options] => Array (),
   [examples] => Array (),
   [aliases] => Array (),
   [deprecated-aliases] => Array (),
   [core] => Array (),
   [scope] => site,
   [drupal dependencies] => Array (),
   [drush dependencies] => Array (),
   [bootstrap_errors] => Array (),
   [topics] => Array (),
   [hidden] => )) called at [/opt/drush/drush.php:101] 
#9 drush_main() called at [/opt/drush/drush.php:41] 

It looks like hosting_hosting_platform_context_options() expects $task->ref->web_server to be set, but it's not, so hosting_context_name() gets passed NULL. Not sure why it's not there in the object, though...

Here's the offending code in hosting_hosting_platform_context_options():

/**
 * Implementation of hook_hosting_TASK_OBJECT_context_options().
 */
function hosting_hosting_platform_context_options(&$task) {
  $task->context_options['server'] = '@server_master';
  $task->context_options['web_server'] = hosting_context_name($task->ref->web_server); // GAP: $task->ref->web_server is not set!
  // Trim the path so we dont pass extra spaces.
  $task->context_options['root'] = trim($task->ref->publish_path, " ");
  if ($task->ref->makefile) {
    $task->context_options['makefile'] = $task->ref->makefile;
  }
}
steven jones’s picture

I purged that install completely and started over.

Did you just remove hostmaster and re-install?

It would appear that you're somehow managing to create platforms that don't have a webserver associated with them, which is then cascading down the stack causing lots of errors. Can you confirm that your platforms don't have a webserver and you're still being allowed to create them in the UI?

mrfelton’s picture

Looks like a similar problem to what I'm experiencing. The following results in a Segmentation Fault:

drush --root='/var/aegir/platforms/example_7_x_1_x_stage__2' provision-save '@platform_example_7_x_1_x_stage__2' --context_type='platform' --web_server='@server_server_wwwexamplecom' -v -d

However, if I remove the --web_server='@server_server_wwwexamplecom' part then it works.

EDIT: Well, turns out @server_server_wwwexamplecom should have actually been @server_wwwexamplecom in our case, so the error was on our part, but still, a useful error message rather than a seg fault might be better!

steven jones’s picture

omega8cc’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
steven jones’s picture

If someone could try the patch in #1454316: Provision recurses infinitely on reading in context, if it works for them, then we can mark this issue as a duplicate.

steven jones’s picture

Status: Active » Closed (duplicate)

Fairly certain this issue was a duplicate of #1454316: Provision recurses infinitely on reading in context