DEP8 segfault on arm64

Bug #1843804 reported by Andreas Hasenack on 2019-09-12
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
Undecided
Unassigned
ruby-ferret (Ubuntu)
High
Unassigned
ruby2.5 (Ubuntu)
High
Unassigned

Bug Description

DEP8 tests are segfaulting on arm64:
...Stack trace:
Not available
E
===============================================================================
Error: test_key_used_for_id_field(IndexTest):
  StandardError: Signal occurred at <global.c>:422 in sighandler_crash
  Exiting on signal SIGSEGV (11)
/tmp/autopkgtest.emjxzb/build.gxX/src/test/unit/index/tc_index.rb:202:in `new'
/tmp/autopkgtest.emjxzb/build.gxX/src/test/unit/index/tc_index.rb:202:in `test_key_used_for_id_field'
     199: def test_key_used_for_id_field
     200: fs_path = File.expand_path(File.join(File.dirname(__FILE__), '../../temp/fsdir'))
     201:
  => 202: index = Index.new(:path => fs_path, :key => :my_id, :create => true)
     203: [
     204: {:my_id => "three", :id => "me"},
     205: {:my_id => "one", :field2 => "three"},
===============================================================================

Closest I got to debugging this is:
#0 0x0000ffffbf5a0744 in generic_ivar_get (undef=52, id=85987, obj=<optimized out>) at variable.c:990
        iv_index_tbl = <error reading variable iv_index_tbl (Cannot access memory at address 0x0)>
        index = 187649990798752
        ivtbl = 0xaaaaab0b2da0
        ivtbl = <optimized out>
        iv_index_tbl = <optimized out>
        index = <optimized out>
        ret = <optimized out>
#1 rb_ivar_lookup (obj=<optimized out>, id=id@entry=85987, undef=undef@entry=52) at variable.c:1205
        val = <optimized out>
        ptr = <optimized out>
        iv_index_tbl = <optimized out>
        len = <optimized out>
        index = 187649990798752
#2 0x0000ffffbf5a15e0 in rb_ivar_lookup (undef=52, id=85987, obj=<optimized out>) at variable.c:1184
        val = <optimized out>
        len = <optimized out>
        ptr = <optimized out>
        iv_index_tbl = <optimized out>
        index = <optimized out>
        val = <optimized out>
        ptr = <optimized out>
        iv_index_tbl = <optimized out>
        len = <optimized out>
        index = <optimized out>
#3 rb_ivar_get (obj=<optimized out>, id=85987) at variable.c:1214
        iv = <optimized out>
#4 0x0000ffffbeb1c12c in frb_fsdir_new (argc=<optimized out>, argv=<optimized out>, klass=<optimized out>) at r_store.c:375
        ref_cnt = <optimized out>
        self = 187649991624280
        rpath = 187649996041240
        rcreate = <optimized out>
        store = 0xaaaaab391410
        create = <optimized out>
        verify = <optimized out>

The full stack trace has 85 frames.

The NULL iv_index_tbl comes from;
        st_table *iv_index_tbl = RCLASS_IV_INDEX_TBL(rb_obj_class(obj));

Andreas Hasenack (ahasenack) wrote :

If I change this test to use another directory:

test/unit/index/tc_index.rb:
  def test_key_used_for_id_field
    fs_path = File.expand_path(File.join(File.dirname(__FILE__), '../../temp/fsdir'))
...

Like:
    fs_path = File.expand_path(File.join(File.dirname(__FILE__), '../../temp/fsdir2'))

Then the test passes without a segfault on arm64.

Andreas Hasenack (ahasenack) wrote :

To reproduce the segfault without having to run the full test suite, run this from within the root of the ruby-ferret source package directory:

export RUBYLIB=.

And then:
ruby2.5 debian/ruby-tests.rb

or

gdb ruby2.5
r debian/ruby-tests.rb

Andreas Hasenack (ahasenack) wrote :

The test also passes if I drop this hunk from d/p/disable_load_path_manipulation.patch:

https://salsa.debian.org/ruby-team/ruby-ferret/blob/master/debian/patches/disable_load_path_manipulation.patch#L18

tags: added: update-excuse

By blocking the glibc migration this also affects glibc (for tracking)

Changed in glibc (Ubuntu):
status: New → Invalid
Andreas Hasenack (ahasenack) wrote :

By blocking the ruby2.5 migration this also affects ruby2.5 (for tracking)

Changed in ruby-ferret (Ubuntu):
status: New → Triaged
Changed in ruby2.5 (Ubuntu):
status: New → Triaged
Changed in ruby-ferret (Ubuntu):
importance: Undecided → High
Changed in ruby2.5 (Ubuntu):
importance: Undecided → High
tags: added: server-next
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.