Segmentation fault when I upload cookbooks


#1

Hi all,

I’m getting the following segfault when I upload cookbooks to chef server:

 /usr/lib/ruby/vendor_ruby/chef/checksum_cache.rb:174: [BUG] 

Segmentation fault
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

When I run “knife cookbooks upload -a”, the process of uploading works
fine until it breaks with a segfault. If I re-run the upload process,
sometimes it breaks in a diferent cookbook from the previous one, and
sometimes it works fine.

I’m running chef server and clients on Debian Squeeze amd64.

I would appreciate any help.

Gustavo Ajeitos.

Gustavo Ajeitos | * Developer *| Tel: +54 2293 44 7531 |
gustavo.ajeitos@spamina.com mailto:gustavo.ajeitos@spamina.com |
www.spamina.com http://www.spamina.com

Spamina | Cloud Email & Web Security
Cloud Email Firewall | Cloud Email Archiving | Cloud Email
Encryption & DLP | Cloud Web Security
Advanced threat protection is better done in the Cloud and helps your
organisation reduce costs, request a free trial
http://www.spamina.com/eng/evaluacion%20gratuita.phpnow and find out why.


#2

I had this the other day, it seemed to happen for me when I was running it in a subshell without a tty attached (I was doing knife commands via bash $( ) declarations. When I switched to using expect, or had a tty assigned, it worked fine.

Not sure if thats any help…

A segmentation fault is generally a bug in ruby itself though

On 16 Mar 2012, at 00:42, Gustavo wrote:

Hi all,

I’m getting the following segfault when I upload cookbooks to chef server:

/usr/lib/ruby/vendor_ruby/chef/checksum_cache.rb:174: [BUG] Segmentation fault
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

When I run “knife cookbooks upload -a”, the process of uploading works fine until it breaks with a segfault. If I re-run the upload process, sometimes it breaks in a diferent cookbook from the previous one, and sometimes it works fine.

I’m running chef server and clients on Debian Squeeze amd64.

I would appreciate any help.

Gustavo Ajeitos.

Gustavo Ajeitos | Developer | Tel: +54 2293 44 7531 | gustavo.ajeitos@spamina.com | www.spamina.com
Spamina | Cloud Email & Web Security
Cloud Email Firewall | Cloud Email Archiving | Cloud Email Encryption & DLP | Cloud Web Security
Advanced threat protection is better done in the Cloud and helps your organisation reduce costs, request a free trial now and find out why.


#3

On Thu, Mar 15, 2012 at 8:42 PM, Gustavo gustavo.ajeitos@spamina.com wrote:

I’m getting the following segfault when I upload cookbooks to chef server:

/usr/lib/ruby/vendor_ruby/chef/checksum_cache.rb:174: [BUG] Segmentation

fault
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

I’m running chef server and clients on Debian Squeeze amd64.

The ‘easiest’ path for Ruby segfaults most of the time is upgrading to
a newer Ruby. These patches rarely get backported.

A few routes:

  1. Backporting Ruby from wheezy/testing, it contains Ruby 1.8.7.352-2.
    For instance, using pbuilder:
    http://edseek.com/~jasonb/articles/pbuilder_backports/
  2. Upgrade to Debian wheezy/testing.
  3. Remove all ruby packages from apt and install Ruby from source
  4. Use RVM to install a confined Ruby (and live with the consequences
    of what it does to your environment)

Bryan


#4

On Mar 16, 2012, at 9:09 AM, Bryan McLellan wrote:

On Thu, Mar 15, 2012 at 8:42 PM, Gustavo gustavo.ajeitos@spamina.com wrote:

I’m getting the following segfault when I upload cookbooks to chef server:

/usr/lib/ruby/vendor_ruby/chef/checksum_cache.rb:174: [BUG] Segmentation

fault
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

I’m running chef server and clients on Debian Squeeze amd64.

The ‘easiest’ path for Ruby segfaults most of the time is upgrading to
a newer Ruby. These patches rarely get backported.

A few routes:

  1. Backporting Ruby from wheezy/testing, it contains Ruby 1.8.7.352-2.
    For instance, using pbuilder:
    http://edseek.com/~jasonb/articles/pbuilder_backports/
  2. Upgrade to Debian wheezy/testing.
  3. Remove all ruby packages from apt and install Ruby from source
  4. Use RVM to install a confined Ruby (and live with the consequences
    of what it does to your environment)

There is also rbenv which purports to be a simpler and less invasive implementation of RVM’s central concept, namely sandboxed Ruby installations that you can switch among on the fly. It lives here: https://github.com/sstephenson/rbenv

I use RVM personally, so caveat emptor.

Bryan


#5

Thanks to all for the information / suggestion !

Now I understand that it is a ruby bug/problem.
I will try to backport Ruby from wheezy in order to be in the “Debian’s
way”.

Regards,
Gustavo

El 16/03/12 12:15, Wes Morgan escribió:

On Mar 16, 2012, at 9:09 AM, Bryan McLellan wrote:

On Thu, Mar 15, 2012 at 8:42 PM, Gustavogustavo.ajeitos@spamina.com wrote:

I’m getting the following segfault when I upload cookbooks to chef server:

 /usr/lib/ruby/vendor_ruby/chef/checksum_cache.rb:174: [BUG] Segmentation

fault
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

I’m running chef server and clients on Debian Squeeze amd64.
The ‘easiest’ path for Ruby segfaults most of the time is upgrading to
a newer Ruby. These patches rarely get backported.

A few routes:

  1. Backporting Ruby from wheezy/testing, it contains Ruby 1.8.7.352-2.
    For instance, using pbuilder:
    http://edseek.com/~jasonb/articles/pbuilder_backports/
  2. Upgrade to Debian wheezy/testing.
  3. Remove all ruby packages from apt and install Ruby from source
  4. Use RVM to install a confined Ruby (and live with the consequences
    of what it does to your environment)
    There is also rbenv which purports to be a simpler and less invasive implementation of RVM’s central concept, namely sandboxed Ruby installations that you can switch among on the fly. It lives here: https://github.com/sstephenson/rbenv

I use RVM personally, so caveat emptor.

Bryan