Bug#996324: ruby-netcdf: FTBFS with ruby3.0: ERROR: Test "ruby3.0" failed: Segmentation fault at 0x0000000000000034

Sergio Durigan Junior sergiodj at sergiodj.net
Fri Nov 5 19:58:31 GMT 2021


On Tuesday, October 12 2021, Antonio Terceiro wrote:

> We are about to enable building against ruby3.0 on unstable. During a test
> rebuild, ruby-netcdf was found to fail to build in that situation.
>
> To reproduce this locally, you need to install ruby-all-dev from experimental
> on an unstable system or build chroot.
>
> Relevant part (hopefully):
>> /usr/bin/ruby3.0 /usr/bin/gem2deb-test-runner
>> 
>> ┌──────────────────────────────────────────────────────────────────────────────┐
>> │ Run tests for ruby3.0 from debian/ruby-test-files.yaml                       │
>> └──────────────────────────────────────────────────────────────────────────────┘
>> 
>> RUBYLIB=/<<PKGBUILDDIR>>/debian/ruby-netcdf/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/3.0.0:/<<PKGBUILDDIR>>/debian/ruby-netcdf/usr/lib/ruby/vendor_ruby:. GEM_PATH=/<<PKGBUILDDIR>>/debian/ruby-netcdf/usr/share/rubygems-integration/3.0.0:/var/lib/gems/3.0.0:/usr/local/lib/ruby/gems/3.0.0:/usr/lib/ruby/gems/3.0.0:/usr/lib/x86_64-linux-gnu/ruby/gems/3.0.0:/usr/share/rubygems-integration/3.0.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-linux-gnu/rubygems-integration/3.0.0 ruby3.0 -ryaml -e YAML.load_file\(\"debian/ruby-test-files.yaml\"\).each\ \{\ \|f\|\ require\ f\ \}
>> Loaded suite -e
>> Started
>> ....................
>> Finished in 0.028058613 seconds.
>> -------------------------------------------------------------------------------
>> 20 tests, 127 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
>> 100% passed
>> -------------------------------------------------------------------------------
>> 712.79 tests/s, 4526.24 assertions/s-e: [BUG] Segmentation fault at 0x0000000000000034
>> ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
>> 
>> -- Control frame information -----------------------------------------------
>> c:0001 p:0000 s:0003 E:001f10 (none) [FINISH]
>> 
>> 
>> -- Machine register context ------------------------------------------------
>>  RIP: 0x0000000000000034 RBP: 0x00005644105564a0 RSP: 0x00007ffc66891258
>>  RAX: 0x0000000000000034 RBX: 0x0000564410569488 RCX: 0x0000000000000001
>>  RDX: 0x0000564410569b18 RDI: 0x0000000000000034 RSI: 0x00007ffc66891278
>>   R8: 0x0000564410569780  R9: 0x0000000000000001 R10: 0x00007ffc668911e0
>>  R11: 0x0000000000000246 R12: 0x0000564410568000 R13: 0x0000564410564a30
>>  R14: 0x0000564410569488 R15: 0x000056440ff00760 EFL: 0x0000000000010202
>> 
>> -- C level backtrace information -------------------------------------------
>> ERROR: Test "ruby3.0" failed.

I spent some time investigating this one, here are my findings.

- The exact test that triggers this problem is test/clone.rb.

- It seems that this bug is at least somewhat related to the following
  Ruby upstream PR:

    https://github.com/ruby/ruby/pull/5012

- Unfortunately, even after building a new version of Ruby using the
  patches available in the PR above I still managed to reproduce the
  bug.

- I found myself getting deeper and deeper into the rabbit hole here,
  debugging the Ruby interpreted with GDB and trying to understand its
  internals, when I decided it was time to stop because I had other
  things on my TODO list.

- The netcdf upstream project seems to be inactive, to say the least.
  The last release happened in 2015, and I could not find a git
  repository for it.


Having said all that, I am inclined to say that this package
could/should be removed from Debian if it causes delays in the Ruby 3.0
transition.  As a side note, I think it would also be interesting to
leave a comment on the Ruby upstream PR mentioned above saying that this
specific test causes Ruby to segfault even with the patches applied.  I
will see about doing that later.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
https://sergiodj.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20211105/592d5ada/attachment.sig>


More information about the Pkg-grass-devel mailing list