Chef client segment fault on lib/chef/mixin/command/unix.rb:190


#1

Is there anybody know about the following segmentation fault? Where is the core
file located?

===>
/usr/lib/ruby/gems/1.8/gems/chef-0.10.6/bin/…/lib/chef/mixin/command/unix.rb:190:
[BUG] Segmentation fault


#2

On Friday, November 9, 2012 at 5:49 PM, xyuan@mspot.com wrote:

Is there anybody know about the following segmentation fault? Where is the core
file located?

===>
/usr/lib/ruby/gems/1.8/gems/chef-0.10.6/bin/…/lib/chef/mixin/command/unix.rb:190:
[BUG] Segmentation fault

When researching a similar bug, I found that ruby was allocating objects during GC, which then triggered the segfault[0]

If this is blocking you, your options are:

  • Upgrade ruby. If you install Chef with the omnibus packages, this is taken care of for you. (see: http://www.opscode.com/chef/install/)
  • Modify the provider that’s triggering this error to use mixlib-shellout instead of run_command or popen4. mixlib-shellout has a workaround for the bug.


Daniel DeLeo

  1. See comments in here: https://github.com/opscode/mixlib-shellout/blob/master/lib/mixlib/shellout/unix.rb

#3

On Fri, Nov 9, 2012 at 8:49 PM, xyuan@mspot.com wrote:

Is there anybody know about the following segmentation fault? Where is the core
file located?

===>
/usr/lib/ruby/gems/1.8/gems/chef-0.10.6/bin/…/lib/chef/mixin/command/unix.rb:190:
[BUG] Segmentation fault

We worked around more of these segfaults in 0.10.10. Could you try
upgrading to at least that version?

http://tickets.opscode.com/browse/CHEF-2916

A newer Chef (with the workaround) or a newer Ruby (with the fix)
should prevent these.

Bryan


#4

Hi,
I’m also getting this segmentation fault:

115.146.84.xxx [2012-12-04T11:01:18+11:00] INFO: Processing
cookbook_file[/mnt/data/Microscopy/Biology/mosquito.tif] action create
(/var/chef/cache/cookbooks/atom-dataset-provider/recipes/default.rb line
126)
115.146.84.xxx /usr/lib/ruby/1.8/timeout.rb:58:
115.146.84.xxx [BUG]
115.146.84.xxx Segmentation fault
115.146.84.xxx
115.146.84.xxx ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
115.146.84.xxx

Sorry for the dumb question, but what’s the correct way to upgrade Chef or
Ruby? This server is built fresh from Ubuntu 12.04, then bootstrapped:

knife bootstrap -d ubuntu12.04-gems …

So upgrading a component on the VM isn’t that straightforward? (I assume
from the output that the segfault is happening at the server end, not in
the local chef client)

Steve

On 15 November 2012 06:44, Bryan McLellan btm@loftninjas.org wrote:

On Fri, Nov 9, 2012 at 8:49 PM, xyuan@mspot.com wrote:

Is there anybody know about the following segmentation fault? Where is
the core
file located?

===>

/usr/lib/ruby/gems/1.8/gems/chef-0.10.6/bin/…/lib/chef/mixin/command/unix.rb:190:

[BUG] Segmentation fault

We worked around more of these segfaults in 0.10.10. Could you try
upgrading to at least that version?

http://tickets.opscode.com/browse/CHEF-2916

A newer Chef (with the workaround) or a newer Ruby (with the fix)
should prevent these.

Bryan


#5

I’m not trying to sidestep your original question about the segfault but
why are you bootstrapping chef using the gems install? The default
bootstrap template is the omnibus install which is nice and clean, easy to
upgrade and might even resolve your original problem.

To install the omnibus chef just don’t specify “-d” in your bootstrap
command. Then to upgrade later you just run the install/upgrade command
found here: http://www.opscode.com/chef/install/

This is the method I use for my Ubuntu 12.04 servers.
On Dec 3, 2012 7:50 PM, “Steve Bennett” stevage@gmail.com wrote:

Hi,
I’m also getting this segmentation fault:

115.146.84.xxx [2012-12-04T11:01:18+11:00] INFO: Processing
cookbook_file[/mnt/data/Microscopy/Biology/mosquito.tif] action create
(/var/chef/cache/cookbooks/atom-dataset-provider/recipes/default.rb line
126)
115.146.84.xxx /usr/lib/ruby/1.8/timeout.rb:58:
115.146.84.xxx [BUG]
115.146.84.xxx Segmentation fault
115.146.84.xxx
115.146.84.xxx ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
115.146.84.xxx

Sorry for the dumb question, but what’s the correct way to upgrade Chef or
Ruby? This server is built fresh from Ubuntu 12.04, then bootstrapped:

knife bootstrap -d ubuntu12.04-gems …

So upgrading a component on the VM isn’t that straightforward? (I assume
from the output that the segfault is happening at the server end, not in
the local chef client)

Steve

On 15 November 2012 06:44, Bryan McLellan btm@loftninjas.org wrote:

On Fri, Nov 9, 2012 at 8:49 PM, xyuan@mspot.com wrote:

Is there anybody know about the following segmentation fault? Where is
the core
file located?

===>

/usr/lib/ruby/gems/1.8/gems/chef-0.10.6/bin/…/lib/chef/mixin/command/unix.rb:190:

[BUG] Segmentation fault

We worked around more of these segfaults in 0.10.10. Could you try
upgrading to at least that version?

http://tickets.opscode.com/browse/CHEF-2916

A newer Chef (with the workaround) or a newer Ruby (with the fix)
should prevent these.

Bryan


#6

On Monday, December 3, 2012 at 4:49 PM, Steve Bennett wrote:

Hi,
I’m also getting this segmentation fault:

115.146.84.xxx (http://115.146.84.xxx) [2012-12-04T11:01:18+11:00] INFO: Processing cookbook_file[/mnt/data/Microscopy/Biology/mosquito.tif] action create (/var/chef/cache/cookbooks/atom-dataset-provider/recipes/default.rb line 126)
115.146.84.xxx (http://115.146.84.xxx) /usr/lib/ruby/1.8/timeout.rb:58:
115.146.84.xxx (http://115.146.84.xxx) [BUG]
115.146.84.xxx (http://115.146.84.xxx) Segmentation fault
115.146.84.xxx (http://115.146.84.xxx)
115.146.84.xxx (http://115.146.84.xxx) ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
115.146.84.xxx (http://115.146.84.xxx)

Sorry for the dumb question, but what’s the correct way to upgrade Chef or Ruby? This server is built fresh from Ubuntu 12.04, then bootstrapped:

knife bootstrap -d ubuntu12.04-gems …

So upgrading a component on the VM isn’t that straightforward? (I assume from the output that the segfault is happening at the server end, not in the local chef client)

Steve

Your assumption is correct.

What version of Chef do you have on your workstation (e.g., knife -v)? Knife will bootstrap nodes to the same version of Chef as itself in order to prevent you from accidentally deploying a major version update.

Also, as mentioned, you can deploy with omnibus to get a newer version of ruby that should fix the segfault issues. Otherwise, you need to create a derivative of the ubuntu12.04-gems bootstrap template that installs a different ruby. I think the ubuntu-provided rubies now use alternatives to select which ruby version to call ruby rather than installing ruby 1.9 as ruby19, but I haven’t payed a lot of attention to that recently.


Daniel DeLeo