Bug 1975144
| Summary: | ruby: FTBFS with test suite failure (glibc 2.34 related) | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Florian Weimer <fweimer> |
| Component: | ruby | Assignee: | ruby maint <ruby-maint> |
| Status: | CLOSED NOTABUG | QA Contact: | Jan Houska <jhouska> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 9.0 | CC: | extras-qa, jaruga, jhouska, joe, jprokop, mo, mtasaka, pvalena, ruby-packagers-sig, s, strzibny, vanmeeuwen+fedora, vondruch |
| Target Milestone: | beta | Keywords: | Triaged |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1975140 | Environment: | |
| Last Closed: | 2021-07-07 12:53:55 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1975140, 1981798 | ||
| Bug Blocks: | |||
|
Description
Florian Weimer
2021-06-23 08:00:46 UTC
> This issue looks like it might impact ruby in Red Hat Enterprise Linux 9 once we switch to glibc 2.34.
I see the glibc version is 2.33.9000 on Fedora rawhide. So, the glibc 2.34 is newer than Fedora rawhide.
(In reply to Jun Aruga from comment #1) > > This issue looks like it might impact ruby in Red Hat Enterprise Linux 9 once we switch to glibc 2.34. > > I see the glibc version is 2.33.9000 on Fedora rawhide. So, the glibc 2.34 > is newer than Fedora rawhide. 2.33.9000 is the version number of the glibc 2.34 pre-releases. This is likely a bug in the glibc 2.34 time64 support code. How can I run the failing test in isolation? It is likely test_timestamp in test/socket/test_socket.rb. Unfortunately I do not know anything about Ruby and its testsuite. To rerun that single test I run: ~~~ $ ./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems "./test/runner.rb" --ruby="./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=./test/excludes --name='!/memory_leak/' -v -n test_timestamp -- test/socket/test_socket.rb ~~~ In the Ruby build dir: `/builddir/build/BUILD/ruby-2.7.3` -- I have Ruby 2.7.3 but it should be applicable to Ruby 3.0 as well without a problem AFAIK. (In reply to Jarek Prokop from comment #4) > To rerun that single test I run: > ~~~ > $ ./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- > --disable-gems "./test/runner.rb" --ruby="./miniruby -I./lib -I. > -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" > --excludes-dir=./test/excludes --name='!/memory_leak/' -v -n test_timestamp > -- test/socket/test_socket.rb > ~~~ > > In the Ruby build dir: `/builddir/build/BUILD/ruby-2.7.3` -- I have Ruby > 2.7.3 but it should be applicable to Ruby 3.0 as well without a problem > AFAIK. And one can get to the command above via: ~~~ $ make test-all TESTS='-v test/socket/test_socket.rb -n /test_timestamp$$/' ./revision.h unchanged Run options: --seed=68017 "--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=./test/excludes --name=!/memory_leak/ -v -n "/test_timestamp$/" # Running tests: [1/1] TestSocket#test_timestamp = 0.00 s Finished tests in 0.008270s, 120.9123 tests/s, 1450.9482 assertions/s. 1 tests, 12 assertions, 0 failures, 0 errors, 0 skips ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux] ~~~ BTW the `miniruby` is statically linked version of Ruby, which might be missing some features, but should be good enough for debugging. And I guess that the Jarek's version could have been further shortened, there is still quite some noise. > How can I run the failing test in isolation? It is likely test_timestamp in test/socket/test_socket.rb.
Florian, Here is my way.
Run the configure script with your preferred flags.
```
$ autoconf
$ optflags=-O0 debugflags="-g3 -ggdb3 -gdwarf-4" \
./configure \
--prefix=path/to/prefix \
--enable-shared
$ make
```
Run the specific test, seeing the actual executed command with `V=1`.
```
$ make test-all V=1 TESTS="-v test/socket/test_socket.rb -n TestSocket#test_timestamp"
exec ./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems "./test/runner.rb" --ruby="./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=./test/excludes --name=!/memory_leak/ -v test/socket/test_socket.rb -n TestSocket#test_timestamp
...
[1/0] TestSocket#test_timestamp = 0.00 s
Finished tests in 0.005708s, 175.2008 tests/s, 2102.4094 assertions/s.
1 tests, 12 assertions, 0 failures, 0 errors, 0 skips
ruby -v: ruby 3.1.0dev (2021-06-23T12:48:42Z master 7c31ecd3ac) [aarch64-linux]
```
Add the `gdb` command before the binary `miniruby` of above command line, removing `--name=!/memory_leak/`.
```
$ gdb -q -ex "set breakpoint pending on" --args ./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems "./test/runner.rb" --ruby="./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=./test/excludes -v test/socket/test_socket.rb -n TestSocket#test_timestamp
Reading symbols from ./miniruby...
warning: File "/home/jaruga/git/ruby/ruby/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /home/jaruga/git/ruby/ruby/.gdbinit
line to your configuration file "/home/jaruga/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/jaruga/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
(gdb)
```
As an alternative. There is `make gdb-ruby` command. But I have not succeeded to run it properly yet.
```
$ make gdb-ruby V=1 TESTRUN_SCRIPT='./test/runner.rb -v test/socket/test_socket.rb -n TestSocket#test_timestamp'
```
Another way to debug is to create a minimal reproducer script based on the test `test_timestamp`. https://github.com/ruby/ruby/blob/v3_0_1/test/socket/test_socket.rb#L496-L510 Then run it from `ruby` command like this. ``` $ gdb -q -ex "set breakpoint pending on" --args path/to/ruby test.rb ``` Though I haven't checked the ruby on RHEL 9. If the rubypick RPM is installed on RHEL 9 like Fedora, the `/usr/bin/ruby` might be a shell script, not binary. On the environment you can specify the `ruby-mri` to debug instead of `ruby`. Here is the result on my Fedora 33. ``` $ cat /etc/fedora-release Fedora release 33 (Thirty Three) $ file /usr/bin/ruby /usr/bin/ruby: Bourne-Again shell script, ASCII text executable $ file /usr/bin/ruby-mri /usr/bin/ruby-mri: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=f1f73707ee8fdb0ccc6fe7d8c9eacb2ed19e9e39, for GNU/Linux 3.2.0, stripped ``` > As an alternative. There is `make gdb-ruby` command. But I have not succeeded to run it properly yet.
I found the way to run it properly. You can edit `run.gdb` file adding a breakpoint, then run.
```
$ cp -p run.gdb run.gdb.org
$ vi run.gdb
$ diff -u run.gdb.org run.gdb
--- run.gdb.org 2021-06-25 16:10:56.044523121 +0000
+++ run.gdb 2021-06-25 16:10:19.452419169 +0000
@@ -1,4 +1,5 @@
set breakpoint pending on
+b main
b rb_assert_failure
b rb_bug
b ruby_debug_breakpoint
$ make gdb-ruby V=1 TESTRUN_SCRIPT='./test/runner.rb -v test/socket/test_socket.rb -n TestSocket#test_timestamp'
...
Breakpoint 1, main (argc=6, argv=0xfffffffff3a8) at ./main.c:35
35 {
(gdb)
```
Thanks for the suggestions. I think I see what is going on, and I've raised the issue here:
[PATCH v3 05/24] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}
https://sourceware.org/pipermail/libc-alpha/2021-June/128113.html
This is not a ruby bug, see bug 1975140. |