Bug #19147
closed`TestFileExhaustive#test_expand_path_for_existent_username` and `TestDir#test_home` fails on i686
Description
Testing with git|66e5200ba4 on Fedora Rawhide, I observe following error just on i686 (other platforms are passing just fine):
1) Error:
TestFileExhaustive#test_expand_path_for_existent_username:
RuntimeError: can't set length of shared string
/builddir/build/BUILD/ruby-3.2.0-66e5200ba4/test/ruby/test_file_exhaustive.rb:1122:in `expand_path'
/builddir/build/BUILD/ruby-3.2.0-66e5200ba4/test/ruby/test_file_exhaustive.rb:1122:in `test_expand_path_for_existent_username'
2) Error:
TestDir#test_home:
RuntimeError: can't set length of shared string
/builddir/build/BUILD/ruby-3.2.0-66e5200ba4/test/ruby/test_dir.rb:537:in `expand_path'
/builddir/build/BUILD/ruby-3.2.0-66e5200ba4/test/ruby/test_dir.rb:537:in `block in test_home'
Previously testing with git|4b1504ae0a, the tests were passing just fine.
Updated by vo.x (Vit Ondruch) over 1 year ago
Maybe some of the recent changes in the string.c might be the reason?
Updated by mtasaka (Mamoru TASAKA) over 1 year ago
Yes, I was about to report this, however Vít was ahead of me 👍
At least 3.2.0preview3 ( git|28611be6ee84ba8eb19e667a70ae129833b98b8b ) was already failing, git|6bf458eefd seemed to be okay, I have not tried bisect.
For git|a1d70f5b12 (still failing): for the failing test
vo.x (Vit Ondruch) wrote:
- Error:
TestDir#test_home:
RuntimeError: can't set length of shared string
/builddir/build/BUILD/ruby-3.2.0-66e5200ba4/test/ruby/test_dir.rb:537:inexpand_path' /builddir/build/BUILD/ruby-3.2.0-66e5200ba4/test/ruby/test_dir.rb:537:in
block in test_home'
Backtrace is:
[mockbuild@3caf95c4eff64519bbdc3426938b6da2 redhat-linux-build]$ gdb --args ./miniruby -I/builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/lib -I. -I.ext/common /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/tool/runruby.rb --extout=.ext -- --disable-gems /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/test/ruby/test_dir.rb
GNU gdb (GDB) Fedora Linux 12.1-9.fc38
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "i686-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./miniruby...
(gdb) break vfork
Breakpoint 1 at 0x1e860
(gdb) r
Starting program: /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/redhat-linux-build/miniruby -I/builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/lib -I. -I.ext/common /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/tool/runruby.rb --extout=.ext -- --disable-gems /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/test/ruby/test_dir.rb
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
process 4106 is executing new program: /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/redhat-linux-build/ruby
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.36.9000-13.fc38.i686 gmp-6.2.1-3.fc37.i686 libgcc-12.2.1-4.fc38.i686 libxcrypt-4.4.33-3.fc38.i686 zlib-1.2.12-5.fc38.i686
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Run options:
--seed=42337
# Running tests:
Breakpoint 1, 0xf78e5e60 in vfork () from /lib/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.36.9000-13.fc38.i686 gmp-6.2.1-3.fc37.i686 libgcc-12.2.1-4.fc38.i686 libxcrypt-4.4.33-3.fc38.i686 zlib-1.2.12-5.fc38.i686
(gdb) break string.c:3021
Breakpoint 2 at 0xf7bc1379: file /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/string.c, line 3021.
(gdb) c
Continuing.
[Detaching after vfork from child process 4109]
[18/36] TestDir#test_glob_too_may_open_files
Breakpoint 1, 0xf78e5e60 in vfork () from /lib/libc.so.6
(gdb) c
Continuing.
[Detaching after vfork from child process 4110]
[New Thread 0xf4b44b40 (LWP 4111)]
[24/36] TestDir#test_glob_gc_for_fd
Thread 1 "ruby" hit Breakpoint 1, 0xf78e5e60 in vfork () from /lib/libc.so.6
(gdb)
Continuing.
[Detaching after vfork from child process 4112]
[Thread 0xf4b44b40 (LWP 4111) exited]
[New Thread 0xf4b44b40 (LWP 4113)]
[33/36] TestDir#test_home
Thread 1 "ruby" hit Breakpoint 2, rb_str_set_len (str=4105702440, len=9) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/string.c:3021
3021 rb_raise(rb_eRuntimeError, "can't set length of shared string");
(gdb) bt
#0 rb_str_set_len (str=4105702440, len=9) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/string.c:3021
#1 0xf7aa9fb1 in rb_file_expand_path_internal (fname=<optimized out>, fname@entry=4105702460, dname=dname@entry=2, abs_mode=abs_mode@entry=0, long_name=1, result=4105702440)
at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/file.c:3895
#2 0xf7aaa8f6 in rb_file_expand_path (fname=4105702460, dname=2) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/file.c:4151
#3 0xf7aaa94b in rb_file_s_expand_path (argc=1, argv=0xf776a290) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/file.c:4164
#4 0xf7aaa980 in s_expand_path (c=1, v=0xf776a290, _=4151513920) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/file.c:4198
#5 0xf7c1b86a in vm_call_cfunc_with_frame (ec=0x5655c0bc, reg_cfp=0xf77e9cb0, calling=0xffffbba0) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_insnhelper.c:3233
#6 0xf7c1f7b9 in vm_sendish (ec=0x5655c0bc, reg_cfp=0xf77e9cb0, cd=0x56626b50, block_handler=0, method_explorer=mexp_search_method) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_callinfo.h:367
#7 0xf7c21a54 in vm_exec_core (ec=0x6001, initial=9437189) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/redhat-linux-build/insns.def:820
#8 0xf7c38154 in rb_vm_exec (ec=0x5655c0bc, jit_enable_p=true) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:2370
#9 0xf7c2b854 in invoke_block (captured=0xf77e9d9c, opt_pc=<optimized out>, type=572653569, cref=0x0, self=4105695760, iseq=0xf775e980, ec=0x5655c0bc)
at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1389
#10 invoke_iseq_block_from_c (me=0x0, is_lambda=<optimized out>, cref=0x0, passed_block_handler=0, kw_splat=0, argv=0xffffbee0, argc=1, self=4105695760, captured=<optimized out>, ec=0x5655c0bc)
at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1445
#11 invoke_block_from_c_bh (force_blockarg=<optimized out>, is_lambda=<optimized out>, cref=<optimized out>, passed_block_handler=<optimized out>, kw_splat=<optimized out>, argv=<optimized out>,
argc=<optimized out>, block_handler=<optimized out>, ec=<optimized out>) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1463
#12 vm_yield_with_cref (is_lambda=0, cref=0x0, kw_splat=0, argv=0xffffbee0, argc=1, ec=0x5655c0bc) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1500
#13 vm_yield (kw_splat=0, argv=0xffffbee0, argc=1, ec=0x5655c0bc) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1508
#14 rb_yield_0 (argv=0xffffbee0, argc=1) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_eval.c:1348
#15 rb_yield (val=<optimized out>) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_eval.c:1364
#16 0xf7a3017c in rb_ary_collect (ary=4105689900) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/array.c:3830
#17 0xf7c1b86a in vm_call_cfunc_with_frame (ec=0x5655c0bc, reg_cfp=0xf77e9d90, calling=0xffffbff0) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_insnhelper.c:3233
#18 0xf7c1f7b9 in vm_sendish (ec=0x5655c0bc, reg_cfp=0xf77e9d90, cd=0x566a0f08, block_handler=4152270237, method_explorer=mexp_search_method) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_callinfo.h:367
#19 0xf7c223e3 in vm_exec_core (ec=0x6001, initial=9437189) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/redhat-linux-build/insns.def:801
#20 0xf7c38154 in rb_vm_exec (ec=0x5655c0bc, jit_enable_p=true) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:2370
#21 0xf7c2b854 in invoke_block (captured=0xf77e9e1c, opt_pc=<optimized out>, type=572653569, cref=0x0, self=4105695760, iseq=0xf4bd082c, ec=0x5655c0bc)
at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1389
#22 invoke_iseq_block_from_c (me=0x0, is_lambda=<optimized out>, cref=0x0, passed_block_handler=0, kw_splat=0, argv=0xffffc330, argc=1, self=4105695760, captured=<optimized out>, ec=0x5655c0bc)
at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1445
#23 invoke_block_from_c_bh (force_blockarg=<optimized out>, is_lambda=<optimized out>, cref=<optimized out>, passed_block_handler=<optimized out>, kw_splat=<optimized out>, argv=<optimized out>,
argc=<optimized out>, block_handler=<optimized out>, ec=<optimized out>) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1463
#24 vm_yield_with_cref (is_lambda=0, cref=0x0, kw_splat=0, argv=0xffffc330, argc=1, ec=0x5655c0bc) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1500
#25 vm_yield (kw_splat=0, argv=0xffffc330, argc=1, ec=0x5655c0bc) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1508
#26 rb_yield_0 (argv=0xffffc330, argc=1) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_eval.c:1348
#27 rb_yield (val=<optimized out>) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_eval.c:1364
#28 0xf7a2ff2a in rb_ary_each (ary=<optimized out>) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/array.c:2733
#29 rb_ary_each (ary=4106062620) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/array.c:2727
#30 0xf7c1b86a in vm_call_cfunc_with_frame (ec=0x5655c0bc, reg_cfp=0xf77e9e10, calling=0xffffc430) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_insnhelper.c:3233
#31 0xf7c1f7b9 in vm_sendish (ec=0x5655c0bc, reg_cfp=0xf77e9e10, cd=0x566449d0, block_handler=4152270365, method_explorer=mexp_search_method) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_callinfo.h:367
#32 0xf7c223e3 in vm_exec_core (ec=0x6001, initial=9437189) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/redhat-linux-build/insns.def:801
#33 0xf7c38154 in rb_vm_exec (ec=0x5655c0bc, jit_enable_p=true) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:2370
#34 0xf7c2b854 in invoke_block (captured=0xf77e9efc, opt_pc=<optimized out>, type=572653569, cref=0x0, self=4105695760, iseq=0xf775dbc0, ec=0x5655c0bc)
at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1389
#35 invoke_iseq_block_from_c (me=0x0, is_lambda=<optimized out>, cref=0x0, passed_block_handler=0, kw_splat=0, argv=0xffffc770, argc=1, self=4105695760, captured=<optimized out>, ec=0x5655c0bc)
at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1445
--Type <RET> for more, q to quit, c to continue without paging--
#36 invoke_block_from_c_bh (force_blockarg=<optimized out>, is_lambda=<optimized out>, cref=<optimized out>, passed_block_handler=<optimized out>, kw_splat=<optimized out>, argv=<optimized out>,
argc=<optimized out>, block_handler=<optimized out>, ec=<optimized out>) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1463
#37 vm_yield_with_cref (is_lambda=0, cref=0x0, kw_splat=0, argv=0xffffc770, argc=1, ec=0x5655c0bc) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1500
#38 vm_yield (kw_splat=0, argv=0xffffc770, argc=1, ec=0x5655c0bc) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1508
#39 rb_yield_0 (argv=0xffffc770, argc=1) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_eval.c:1348
#40 rb_yield (val=<optimized out>) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_eval.c:1364
#41 0xf7a2ff2a in rb_ary_each (ary=<optimized out>) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/array.c:2733
#42 rb_ary_each (ary=4106063400) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/array.c:2727
#43 0xf7c1b86a in vm_call_cfunc_with_frame (ec=0x5655c0bc, reg_cfp=0xf77e9ef0, calling=0xffffc870) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_insnhelper.c:3233
#44 0xf7c1f7b9 in vm_sendish (ec=0x5655c0bc, reg_cfp=0xf77e9ef0, cd=0x566a44a0, block_handler=4152270589, method_explorer=mexp_search_method) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm_callinfo.h:367
#45 0xf7c223e3 in vm_exec_core (ec=0x6001, initial=9437189) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/redhat-linux-build/insns.def:801
#46 0xf7c38154 in rb_vm_exec (ec=0x5655c0bc, jit_enable_p=true) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:2370
#47 0xf7c39044 in invoke_block (captured=0x567345a0, opt_pc=<optimized out>, type=<optimized out>, cref=0x0, self=<optimized out>, iseq=<optimized out>, ec=0x5655c0bc)
at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1389
#48 invoke_iseq_block_from_c (me=0x0, is_lambda=<optimized out>, cref=0x0, passed_block_handler=0, kw_splat=0, argv=<optimized out>, argc=0, self=4105727080, captured=0x567345a0, ec=0x5655c0bc)
at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1445
#49 invoke_block_from_c_proc (me=0x0, is_lambda=<optimized out>, passed_block_handler=0, kw_splat=0, argv=<optimized out>, argc=0, self=4105727080, proc=<optimized out>, ec=0x5655c0bc)
at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1543
#50 vm_invoke_proc (ec=0x5655c0bc, proc=<optimized out>, self=4105727080, argc=0, argv=0xf4b7f4c0, kw_splat=0, passed_block_handler=0) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/vm.c:1573
#51 0xf7b60938 in rb_proc_call_kw (self=<optimized out>, args=<optimized out>, kw_splat=0) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/proc.c:995
#52 0xf7b609d2 in rb_proc_call (self=4105722640, args=4105696440) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/proc.c:1005
#53 0xf7a9c805 in rb_call_end_proc (data=4105722640) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/eval_jump.c:13
#54 0xf7a9c5c6 in exec_end_procs_chain (errp=0x5655c0f8, procs=0xf7dfea04 <end_procs.lto_priv>) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/eval_jump.c:105
#55 rb_ec_exec_end_proc (ec=ec@entry=0x5655c0bc) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/eval_jump.c:120
#56 0xf7a9d655 in rb_ec_teardown (ec=0x5655c0bc) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/eval.c:159
#57 0xf7a9d8f1 in rb_ec_cleanup (ec=ec@entry=0x5655c0bc, ex=RUBY_TAG_NONE) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/eval.c:212
#58 0xf7a9e096 in ruby_run_node (n=0xf775a448) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/eval.c:330
#59 0x565561da in rb_main (argv=0xffffd064, argc=3) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/main.c:38
#60 main (argc=<optimized out>, argv=<optimized out>) at /builddir/build/BUILD/ruby-3.2.0-a1d70f5b12/main.c:57
Updated by vo.x (Vit Ondruch) over 1 year ago
Interestingly, testing with git|0436f1e15a, there are now additional spec failures which appears to be the same issue:
1)
File.expand_path expands ~ENV['USER'] to the user's home directory ERROR
RuntimeError: can't set length of shared string
/builddir/build/BUILD/ruby-3.2.0-0436f1e15a/spec/ruby/core/file/expand_path_spec.rb:99:in `expand_path'
/builddir/build/BUILD/ruby-3.2.0-0436f1e15a/spec/ruby/core/file/expand_path_spec.rb:99:in `block (3 levels) in <top (required)>'
/builddir/build/BUILD/ruby-3.2.0-0436f1e15a/spec/ruby/core/file/expand_path_spec.rb:7:in `<top (required)>'
2)
File.expand_path expands ~ENV['USER']/a to a in the user's home directory ERROR
RuntimeError: can't set length of shared string
/builddir/build/BUILD/ruby-3.2.0-0436f1e15a/spec/ruby/core/file/expand_path_spec.rb:103:in `expand_path'
/builddir/build/BUILD/ruby-3.2.0-0436f1e15a/spec/ruby/core/file/expand_path_spec.rb:103:in `block (3 levels) in <top (required)>'
/builddir/build/BUILD/ruby-3.2.0-0436f1e15a/spec/ruby/core/file/expand_path_spec.rb:7:in `<top (required)>'
Updated by vo.x (Vit Ondruch) 9 months ago
This was already fixed at 3.2.0 release it seems. Nevertheless, I am still unsure, what was cause and fix for this.
Updated by jeremyevans0 (Jeremy Evans) 9 months ago
- Status changed from Open to Closed
Updated by vo.x (Vit Ondruch) 9 months ago
Testing further, there might be issue in some other places. While I can't reproduce the issue on Fedora Rawhide, it still fails on Fedora 38. I was not expecting this. Might the culprit be e.g. glibc? Or is it FS type related?