Ticket #6 (new defect)

Opened 18 months ago

Last modified 8 months ago

require 'sandbox' segfaults on x86_64 linux

Reported by: wmlele Owned by: somebody
Priority: minor Milestone:
Component: component1 Version:
Keywords: Cc:

Description

a script composed of just

require 'sandbox'

fails on x86_64 linux

/usr/lib64/ruby/site_ruby/1.8/x86_64-linux/sand_table.so: [BUG] Segmentation fault
ruby 1.8.5 (2006-08-25) [x86_64-linux]

while seems to work (but didn't perform much testing on the sandbox itself) on ix86. Version is svn head.

Attachments

131_sandbox.patch (11.0 kB) - added by jontec 8 months ago.
Debian changes to accomodate sandbox
904_why_sandbox.patch (2.3 kB) - added by jontec 8 months ago.
jontec's updated patch for sandbox on debian

Change History

in reply to: ↑ description ; follow-up: ↓ 2   Changed 17 months ago by lwu

  • priority changed from critical to minor

Replying to wmlele:

{{{ /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/sand_table.so: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [x86_64-linux] }}}

Did you apply the patch to Ruby required for sandbox to run?

See http://code.whytheluckystiff.net/sandbox/wiki/InstallingTheSandbox

It looks like you're running vanilla 1.8.5 which, well, crashes immediately too on my box.

in reply to: ↑ 1   Changed 17 months ago by wmlele

Replying to lwu:

Did you apply the patch to Ruby required for sandbox to run?

Yes I did. In fact, I am building ruby from the same custom made srpm on both i386 and x86_64, which is the opensuse supplied srpm *plus* the sandbox patch. The outcome is that i386 works while _64 doesn't

It *might* be some other patch of those that are applied by opensuse that gets triggered only on _64, but to my uneducated eye it seems unlikely. (but I could check by trying with a real vanilla ruby)

This might help:

Core was generated by `ruby sandbox.rb'.
Program terminated with signal 6, Aborted.
#0  0x00002b8025267535 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00002b8025267535 in raise () from /lib64/libc.so.6
#1  0x00002b8025268990 in abort () from /lib64/libc.so.6
#2  0x00002b80248cc860 in rb_bug () from /usr/lib64/libruby.so.1.8
#3  0x00002b8024930562 in Init_signal () from /usr/lib64/libruby.so.1.8
#4  <signal handler called>
#5  0x00002b8025607128 in sandbox_boot (kit=<value optimized out>, super=626747224) at sand_hacks.c:86
#6  0x00002b80256071c1 in sandbox_bootclass (kit=0x660d08, name=0x2b8025608042 "Module", super=24) at sand_hacks.c:170
#7  0x00002b80255e1fe2 in Init_kit (kit=0x2b802580c760, use_base=0) at sand_table.c:973
#8  0x00002b80256058b5 in Init_sand_table () at sand_table.c:3043
#9  0x00002b80248c9770 in dln_load () from /usr/lib64/libruby.so.1.8

  Changed 17 months ago by lwu

Can you do a 'ruby -v' again?

Ruby 1.8.5 (2006-08-25) is, I would guess, vanilla 1.8.5:

http://www2.ruby-lang.org/en/20060825.html

Sometimes one has multiple Ruby versions installed (ack!)

follow-up: ↓ 5   Changed 8 months ago by jontec

Unfortunately, I can confirm this error on (k)ubuntu 7.04, amd64, ruby 1.8.5 [patched]. I've actually just finished patching my ruby within a deb (I had to work through some research on the diffs that the debian debs had applied), rebuilt the package and re-installed sandbox. In my initial version (i.e. before the updated patch), I was simply getting an error like {{ LoadError?: /usr/local/lib/site_ruby/1.8/x86_64-linux/sand_table.so: undefined symbol: rb_syserr_tbl - /usr/local/lib/site_ruby/1.8/x86_64-linux/sand_table.so

from /usr/local/lib/site_ruby/1.8/x86_64-linux/sand_table.so from /usr/local/lib/site_ruby/1.8/sandbox.rb:1 from (irb):1:in `require' from (irb):1

}}

but now I'm getting the aformentioned segfault.

My ruby -v does indicate that I have ruby 1.8.5 (2006-08-25) [x86_64-linux], but apt-get assures me that the current libruby1.8 version is 1.8.5-4ubuntu2.sandbox, which I created myself.

I am attaching the specfic diff that I applied, based on the current diff in the repository, but truncated to some degree-- the debian maintainers had already applied a patch to some of the files that the current diff addresses (it was named sandbox itself). I had to pick through it to make sure that I didn't invalidate some of the later patches contained in the debian source, so I may have made some mistakes (but I don't think so).

I'm looking to integrate this into a project that I'm working with (:D scriptable output), so a speedy reply would be greatly appreciated.

in reply to: ↑ 4   Changed 8 months ago by jontec

Replying to jontec:

{{ LoadError?: /usr/local/lib/site_ruby/1.8/x86_64-linux/sand_table.so: undefined symbol:

rb_syserr_tbl - /usr/local/lib/site_ruby/1.8/x86_64-linux/sand_table.so

}}

Sorry, this was

LoadError: /usr/local/lib/site_ruby/1.8/x86_64-linux/sand_table.so: undefined symbol: rb_syserr_tbl - /usr/local/lib/site_ruby/1.8/x86_64-linux/sand_table.so
        from /usr/local/lib/site_ruby/1.8/x86_64-linux/sand_table.so
        from /usr/local/lib/site_ruby/1.8/sandbox.rb:1
        from (irb):1:in `require'
        from (irb):1

Changed 8 months ago by jontec

Debian changes to accomodate sandbox

Changed 8 months ago by jontec

jontec's updated patch for sandbox on debian

  Changed 8 months ago by jontec

I know that the problem is not with my patch or method-- I've just successfully installed sandbox on my 32-bit server. You can point ubuntu/debian users to that patch if they want to operate within package management.

Note: See TracTickets for help on using tickets.