Debian Bug report logs -
#969130
libruby2.7: ENOENT error crash some ruby scripts
Reported by: Antoni Villalonga <antoni@friki.cat>
Date: Fri, 28 Aug 2020 00:27:02 UTC
Severity: important
Found in version ruby2.7/2.7.1-3
Fixed in version ruby2.7/2.7.2-2
Done: Utkarsh Gupta <utkarsh@debian.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, antoni@friki.cat, Debian Ruby Team <pkg-ruby-extras-maintainers@lists.alioth.debian.org>:
Bug#969130; Package libruby2.7.
(Fri, 28 Aug 2020 00:27:04 GMT) (full text, mbox, link).
Acknowledgement sent
to Antoni Villalonga <antoni@friki.cat>:
New Bug report received and forwarded. Copy sent to antoni@friki.cat, Debian Ruby Team <pkg-ruby-extras-maintainers@lists.alioth.debian.org>.
(Fri, 28 Aug 2020 00:27:04 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: libruby2.7
Version: 2.7.1-3
Severity: important
X-Debbugs-Cc: antoni@friki.cat
Dear Maintainer,
Some ruby scripts fail to run from a removed directory.
% cat /tmp/test.rb
#!/usr/bin/ruby
require 'unicode'
% mkdir /tmp/foo
% cd /tmp/foo
% rmdir /tmp/foo
% /tmp/test.rb
Traceback (most recent call last):
5: from /tmp/test.rb:2:in `<main>'
4: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
3: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
2: from /usr/lib/ruby/vendor_ruby/unicode.rb:2:in `<top (required)>'
1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- unicode/2.7/unicode_native (LoadError)
16: from /tmp/test.rb:2:in `<main>'
15: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
14: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
13: from /usr/lib/ruby/vendor_ruby/unicode.rb:2:in `<top (required)>'
12: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:156:in `require'
11: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:161:in `rescue in require'
10: from /usr/lib/ruby/2.7.0/rubygems.rb:204:in `try_activate'
9: from /usr/lib/ruby/2.7.0/rubygems/specification.rb:996:in `find_by_path'
8: from /usr/lib/ruby/2.7.0/rubygems/specification.rb:996:in `find'
7: from /usr/lib/ruby/2.7.0/rubygems/specification.rb:996:in `each'
6: from /usr/lib/ruby/2.7.0/rubygems/specification.rb:997:in `block in find_by_path'
5: from /usr/lib/ruby/2.7.0/rubygems/bundler_version_finder.rb:39:in `compatible?'
4: from /usr/lib/ruby/2.7.0/rubygems/bundler_version_finder.rb:7:in `bundler_version'
3: from /usr/lib/ruby/2.7.0/rubygems/bundler_version_finder.rb:22:in `bundler_version_with_reason'
2: from /usr/lib/ruby/2.7.0/rubygems/bundler_version_finder.rb:73:in `lockfile_version'
1: from /usr/lib/ruby/2.7.0/rubygems/bundler_version_finder.rb:85:in `lockfile_contents'
/usr/lib/ruby/2.7.0/rubygems/bundler_version_finder.rb:85:in `pwd': No such file or directory - getcwd (Errno::ENOENT)
If apt-listchanges package is installed apt crashes that way. That's why I've
switched to "important".
Following inline patch fixes the issue.
----
From: Antoni Villalonga <antoni@friki.cat>
Date: Fri, 28 Aug 2020 02:09:42 +0200
Subject: Rescue getcwd ENOENT error
Forwarded: not-needed
Upstream-Author: David Rodríguez
Rescue ENOENT error allowing run ruby scripts when cwd does not exists.
Cherry-pick from upstream 96064e6f1ce100a37680dc8f9509f06b3350e9c8
--- a/lib/rubygems/bundler_version_finder.rb
+++ b/lib/rubygems/bundler_version_finder.rb
@@ -82,12 +82,19 @@
def self.lockfile_contents
gemfile = ENV["BUNDLE_GEMFILE"]
gemfile = nil if gemfile && gemfile.empty?
- Gem::Util.traverse_parents Dir.pwd do |directory|
- next unless gemfile = Gem::GEM_DEP_FILES.find { |f| File.file?(f.tap(&Gem::UNTAINT)) }
- gemfile = File.join directory, gemfile
- break
- end unless gemfile
+ unless gemfile
+ begin
+ Gem::Util.traverse_parents(Dir.pwd) do |directory|
+ next unless gemfile = Gem::GEM_DEP_FILES.find { |f| File.file?(f.tap(&Gem::UNTAINT)) }
+
+ gemfile = File.join directory, gemfile
+ break
+ end
+ rescue Errno::ENOENT
+ return
+ end
+ end
return unless gemfile
----
Regards,
Message sent on
to Antoni Villalonga <antoni@friki.cat>:
Bug#969130.
(Tue, 13 Oct 2020 08:15:12 GMT) (full text, mbox, link).
Message #8 received at 969130-submitter@bugs.debian.org (full text, mbox, reply):
Control: tag -1 pending
Hello,
Bug #969130 in ruby reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:
https://salsa.debian.org/ruby-team/ruby/-/commit/227fe97ddd3fcb952632abe5f3b14e615645e088
------------------------------------------------------------------------
Add patch to fix ENOENT error when cwd does not exists
(Closes: #969130)
------------------------------------------------------------------------
(this message was generated automatically)
--
Greetings
https://bugs.debian.org/969130
Added tag(s) pending.
Request was from Utkarsh Gupta <utkarsh@debian.org>
to 969130-submitter@bugs.debian.org.
(Tue, 13 Oct 2020 08:15:12 GMT) (full text, mbox, link).
Reply sent
to Utkarsh Gupta <utkarsh@debian.org>:
You have taken responsibility.
(Tue, 13 Oct 2020 14:48:07 GMT) (full text, mbox, link).
Notification sent
to Antoni Villalonga <antoni@friki.cat>:
Bug acknowledged by developer.
(Tue, 13 Oct 2020 14:48:08 GMT) (full text, mbox, link).
Message #15 received at 969130-close@bugs.debian.org (full text, mbox, reply):
Source: ruby2.7
Source-Version: 2.7.2-2
Done: Utkarsh Gupta <utkarsh@debian.org>
We believe that the bug you reported is fixed in the latest version of
ruby2.7, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 969130@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Utkarsh Gupta <utkarsh@debian.org> (supplier of updated ruby2.7 package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Tue, 13 Oct 2020 18:48:32 +0530
Source: ruby2.7
Architecture: source
Version: 2.7.2-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Ruby Team <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
Changed-By: Utkarsh Gupta <utkarsh@debian.org>
Closes: 968203 969130 970469
Changes:
ruby2.7 (2.7.2-2) unstable; urgency=medium
.
* Add patch to fix ENOENT error when cwd does not exists. (Closes: #969130)
- Thanks, Antoni Villalonga, for the patch.
* Place arch-qualified tools in rbconfig.rb. (Closes: #970469)
- Thanks, Helmut Grohne, for the debdiff.
* Disable test_find_proxy_no_proxy test. (Closes: #968203)
- Tries to parse http://example.org and thus causes FTBFS on buster.
Checksums-Sha1:
aba495bb896133c89f69753618819e0e129f0984 2505 ruby2.7_2.7.2-2.dsc
a3b3fda80555a59f75faeb4b892da307cb44236c 112764 ruby2.7_2.7.2-2.debian.tar.xz
574ef8332111d24bb4247b5318c8052bce179e5b 8215 ruby2.7_2.7.2-2_amd64.buildinfo
Checksums-Sha256:
ff4b983b688cac0b9244459b43269adbb6fd306633ec8e3fac95a0226a329633 2505 ruby2.7_2.7.2-2.dsc
3b3daac70e9076c61a3f7f511fdc065d805ff89eefcaa69883ce2280c01a9860 112764 ruby2.7_2.7.2-2.debian.tar.xz
aee226df3ecb4d6b5632e7d72464bc8799e83209dcbc88999ff78a3c6ed4b5ba 8215 ruby2.7_2.7.2-2_amd64.buildinfo
Files:
59ce1be2a693afa41f474f35d92a4a76 2505 ruby optional ruby2.7_2.7.2-2.dsc
c80f8c00e5cbaf4bdbee54984259c83c 112764 ruby optional ruby2.7_2.7.2-2.debian.tar.xz
7d2862a77b91b7720175447f8cc0ecc5 8215 ruby optional ruby2.7_2.7.2-2_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQJHBAEBCAAxFiEEbJ0QSEqa5Mw4X3xxgj6WdgbDS5YFAl+FslcTHHV0a2Fyc2hA
ZGViaWFuLm9yZwAKCRCCPpZ2BsNLlnJ4EACe+pidkqJuuDHe7jTRhXc7k7HKi9zd
EYYyY6sJaCovJmxjv3rZCNc2MEycabmP1XAEoTVtOVJ4nppu+Ua8Ku31I1IyyB94
Ga+vwpKgSUR8F5ZybscI9InqJEfxSkL7HOlv5A9YLkPSWjoQ1KIvJfCKiyTcCZ6n
clP31DJXek1VTqNYIklk7cI36pihekLtsm6i1gbcllzRd7JG+aLyhtQgPcLduw3v
18gdgWHveD1jlgbq5C9mV6yb37Np4z/iD7bxRyDSRlOqKT+57tNKEcVOdKX7nKuP
L5Y7cMFXaxlmcqWxVTzspNVh0SW8plVYsXgQJRKmO/7mNg2GQbRq5eAE1oQGHdIs
MrmD3b6BTweLT+skwgfqF49ZajBnMiAMwYQr27VJ7fHqap3o6bTlMMxnxMmJwCsU
5bIV3gFL4LRtOWR1oENBJu+gad2mITQEviPGGWbujjRxhPEr50mk0TJIVxuyTpin
N4ye8d3MRPGipttvNK1TAY4/gnrNSl4zNKLdRlO0wj0hglpOr4E92OoZffUAN6ak
1r/085uk63D1HkWS4XEbygGNuHdeSNRePS1YqyG38NlXxtSNJF2JsLSTrerWlAKj
6YSITzkZNvGpwTdsFjZJtlKFLp8iA7Bx94SYfVaUyqrlgSYlQQjBclQOsuCHy6CR
arpjJS1UdZdwPw==
=yl5N
-----END PGP SIGNATURE-----
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Mon, 16 Nov 2020 07:27:17 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sun Oct 8 03:05:08 2023;
Machine Name:
bembo
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.