ruby 1.9 segmentation fault on exit


i'm getting crazy here, just trying to deploy a little test app on my server, and i keep getting a seg fault whenever ruby quits (i.e. after running rake assets:precompile, or quitting console etc). just running

script/rails r -e production "puts 1"

will lead to

1 [BUG] Segmentation fault ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] -- C level backtrace information ------------------------------------------- /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/libruby.so.1.9 [0x7f92fd681f25] /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/libruby.so.1.9 [0x7f92fd55608c] /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/libruby.so.1.9(rb_bug+0xb8) [0x7f92fd556208] error.c:277 /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/libruby.so.1.9 [0x7f92fd60db77] /lib/libpthread.so.0 [0x7f92fd2e5a80] /lib/libselinux.so.1 [0x7f92f0db831d] /lib/libselinux.so.1 [0x7f92f0dab57f] -- Other runtime information ----------------------------------------------- Segmentation fault

note that the scripts/rake tasks, whatever do run, but on exit -> seg fault

the weird thing is, this 1. happens only on my server (debian lenny, rvm, ruby 1.9.2 or 1.9.3 ) and only in production mode. so naturally i thought, some production group gem is causing this, and i tried switching off the production group in my Gemfile, as well as switching production <-> development gems, no change, everytime ruby quits -> seg fault

what the hell can i do? can somebody give me please some debugging tips to get to the root of this, the backtrace for this seg fault leaves me with absolutely no hint

(i tried removing ruby, and recompiling, and i tried 1.9.2-p290 AND 1.9.3, same result)

okay, backtrace time:

#0 rb_string_value (ptr=0x5a8) at string.c:1406 1406 VALUE s = *ptr; (gdb) where #0 rb_string_value (ptr=0x5a8) at string.c:1406 #1 0x00007f3c5b619428 in rb_string_value_cstr (ptr=0x5a8) at string.c:1424 #2 0x00007f3c5b6708cc in rb_vm_bugreport () at vm_dump.c:826 #3 0x00007f3c5b549f1c in report_bug (file=<value optimized out>, line=<value optimized out>, fmt=0x7f3c5b69e88b "Segmentation fault", args=0x66cd40) at error.c:258 #4 0x00007f3c5b54a098 in rb_bug (fmt=0x7f3c5b69e88b "Segmentation fault") at error.c:277 #5 0x00007f3c5b5fe037 in sigsegv (sig=<value optimized out>, info=<value optimized out>, ctx=<value optimized out>) at signal.c:609 #6 <signal handler called> #7 0x00007f3c4e6fa18d in fini_context_translations () at setrans_client.c:211 #8 0x00007f3c4e6ed5df in __do_global_dtors_aux () from /lib/libselinux.so.1 #9 0x0000000000400850 in setlocale@plt () #10 0x00007fffffffdec0 in ?? () #11 0x00007f3c4e6fb991 in _fini () from /lib/libselinux.so.1 #12 0x000000000000005f in ?? () #13 0x00007f3c5b933d94 in ?? () from /lib64/ld-linux-x86-64.so.2 Backtrace stopped: previous frame inner to this frame (corrupt stack?)


okay, i got it! it's actually this bug <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505920" rel="nofollow">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505920</a> in libselinux, which has been fixed a while ago, but the updates didn't make it into lenny? i took the liberty and installed the libselinux1 deb from squeeze, i'm not sure if this is actually a good idea, but at least the problem is gone.


  • Why do native C++ projects have a TargetFrameworkVersion?
  • Error:Execution failed for task ':app:dexDebug'. when importing ParseLoginUI as a module
  • Vim ctags behaves strangely
  • Android libgdx prefs getting lost
  • Attemping to change attributes of $(this) inside success function
  • Autohotkey script running program with command line arguments
  • get all processes in parallel
  • runtime error when linking ffmpeg libraries in qt creator
  • python: forcing relative imports to search from script file
  • Python 3.2.2, error(scripts to exe)
  • Ruby on Rails App deployed to heroku showing “We're sorry, but something went wrong”
  • Detecting null parameter in preprocessor macro
  • C# program and C++ DLL compiled for 32-bit system crash on 64-bit system
  • Using JRuby with Rails 3.2
  • Code in Job's Script Block after Start-Process Does not Execute
  • Test if a set exists before trying to drop it
  • Obtain ObjectIdHex value from mgo query
  • Apache 2.4 - remove | delete | uninstall
  • Hibernate gives error error as “Access to DialectResolutionInfo cannot be null when 'hibernate.
  • How to delete a row from a dynamic generate table using jquery?
  • Python: how to group similar lists together in a list of lists?
  • Rails 2: use form_for to build a form covering multiple objects of the same class
  • Codeigniter doesn't let me update entry, because some fields must be unique
  • Free memory of cv::Mat loaded using FileStorage API
  • Trying to get generic when generic is not available
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Getting Messege Twice Using IMvxMessenger
  • Change div Background jquery
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How to get Windows thread pool to call class member function?
  • Bitwise OR returns boolean when one of operands is nil
  • Append folder name and increment by 1 using batch script
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • Easiest way to encapsulate a HTML5 webpage into an android app?
  • Busy indicator not showing up in wpf window [duplicate]
  • costura.fody for a dll that references another dll
  • Observable and ngFor in Angular 2
  • How to Embed XSL into XML
  • UserPrincipal.Current returns apppool on IIS
  • Conditional In-Line CSS for IE and Others?