[DSE-Dev] Bug#1095018: ruby-selinux: segfault with some combinations of ruby and ruby-selinux

Michael Stone mstone at debian.org
Sun Feb 2 18:25:21 GMT 2025


Package: ruby-selinux
Severity: important

With ruby-selinux 3.7-3.1 and ruby 1:3.1+support3.3 I observe this behavior:

debian-testing:~$ echo "require 'selinux'" | ruby
/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/3.1.0/selinux.so: [BUG] Segmentation fault at 0x0000000000000008
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]

-- Control frame information -----------------------------------------------
c:0005 p:-11766064464904 s:0020 e:000019 TOP    [FINISH]
c:0004 p:---- s:0017 e:000016 CFUNC  :require
c:0003 p:0037 s:0012 e:000011 METHOD <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:136
c:0002 p:0005 s:0006 e:000005 EVAL   -:1 [FINISH]
c:0001 p:0000 s:0003 E:000770 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
-:1:in `<main>'
<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:136:in `require'
<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:136:in `require'

-- Machine register context ------------------------------------------------
 RIP: 0x00007f998e5c0391 RBP: 0x0000000000000001 RSP: 0x00007ffec2079790
 RAX: 0x0000000000000008 RBX: 0x00007f998e5ce6c0 RCX: 0x000000000000000d
 RDX: 0x0000000000000000 RDI: 0x00007f99924b90d8 RSI: 0x00007f998e5c6408
  R8: 0x0000559c00a74f60  R9: 0x0000559c00a70f50 R10: 0x337a04da6c85a688
 R11: 0x00007f99924d4e10 R12: 0x00007f998e5c6408 R13: 0x00007ffec20797f0
 R14: 0x0000000000000000 R15: 0x0000559c00973980 EFL: 0x0000000000010202

-- C level backtrace information -------------------------------------------
/lib/x86_64-linux-gnu/libruby-3.1.so.3.1(0x7f999246d97c) [0x7f999246d97c]
/lib/x86_64-linux-gnu/libruby-3.1.so.3.1(0x7f99922b3994) [0x7f99922b3994]
/lib/x86_64-linux-gnu/libruby-3.1.so.3.1(0x7f99923dd4af) [0x7f99923dd4af]
/lib/x86_64-linux-gnu/libc.so.6(0x7f9991f63da0) [0x7f9991f63da0]
/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/3.1.0/selinux.so(Init_selinux+0x91) [0x7f998e5c0391]
/lib/x86_64-linux-gnu/libruby-3.1.so.3.1(dln_load+0x1b6) [0x7f999223bfe6]
/lib/x86_64-linux-gnu/libruby-3.1.so.3.1(0x7f9992455bd1) [0x7f9992455bd1]
/lib/x86_64-linux-gnu/libruby-3.1.so.3.1(0x7f999230d8b8) [0x7f999230d8b8]
[continues]


Downgrading to 3.7-3 corrects this issue. I also don't observe the problem when
ruby-selinux 3.7-3.1 is run with ruby 1:3.3~3.2 (as in current sid). This may
be a problem which corrects itself when the newer version of ruby enters
testing (though I have not tested a partial upgrade scenario from bookworm,
which may require additional Breaks). If for some reason ruby 3.3 doesn't enter
testing prior to freeze, this will need to be addressed in ruby-selinux.



More information about the SELinux-devel mailing list