RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 722887 - Load paths duplicated for i386 =>ActiveSupport build fails on i386
Summary: Load paths duplicated for i386 =>ActiveSupport build fails on i386
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ruby
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Vít Ondruch
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On: 718695
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-18 11:21 UTC by Vít Ondruch
Modified: 2011-12-06 12:08 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 718695
Environment:
Last Closed: 2011-12-06 12:08:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1581 0 normal SHIPPED_LIVE Low: ruby security, bug fix, and enhancement update 2011-12-06 00:38:54 UTC

Description Vít Ondruch 2011-07-18 11:21:27 UTC
+++ This bug was initially created as a clone of Bug #718695 +++

Description of problem:
The load paths are duplicated on i386. Due to this duplication, one of ActiveSupport 3.0.9 test fails:

  1) Failure:
test_uniq_load_paths(LoadPathsTest)
    [./test/load_paths_test.rb:14:in `test_uniq_load_paths'
     /usr/lib/ruby/gems/1.8/gems/mocha-0.9.8/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in `__send__'
     /usr/lib/ruby/gems/1.8/gems/mocha-0.9.8/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in `run']:
[["/usr/lib/ruby/1.8", 2], ["/usr/lib/ruby/site_ruby", 2], ["/usr/lib/ruby/site_ruby/1.8", 2]].
<false> is not true. 

This is the test code:

require 'abstract_unit'

class LoadPathsTest < Test::Unit::TestCase
  def test_uniq_load_paths
    load_paths_count = $LOAD_PATH.inject({}) { |paths, path|
      expanded_path = File.expand_path(path)
      paths[expanded_path] ||= 0
      paths[expanded_path] += 1
      paths
    }
    load_paths_count[File.expand_path('../../lib', __FILE__)] -= 1

    filtered = load_paths_count.select { |k, v| v > 1 }
    assert filtered.empty?, filtered.inspect
  end
end

This is not issue for x86_64

Version-Release number of selected component (if applicable):
> rpm -q ruby
ruby-1.8.7.334-2.fc16.i686

> rpm -q ruby
ruby-1.8.7.334-2.fc16.x86_64

How reproducible:
Always


Steps to Reproduce:
1. 
> ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
> ruby -e "puts $:"
/usr/lib/ruby/site_ruby/1.8
/usr/lib64/ruby/site_ruby/1.8
/usr/lib64/ruby/site_ruby/1.8/x86_64-linux
/usr/lib/ruby/site_ruby
/usr/lib64/ruby/site_ruby
/usr/lib64/site_ruby/1.8
/usr/lib64/site_ruby/1.8/x86_64-linux
/usr/lib64/site_ruby
/usr/lib/ruby/1.8
/usr/lib64/ruby/1.8
/usr/lib64/ruby/1.8/x86_64-linux
.

2.
> ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-linux]
> ruby -e "puts $:"
/usr/lib/ruby/site_ruby/1.8
/usr/lib/ruby/site_ruby/1.8
/usr/lib/ruby/site_ruby/1.8/i386-linux
/usr/lib/ruby/site_ruby
/usr/lib/ruby/site_ruby
/usr/lib/site_ruby/1.8
/usr/lib/site_ruby/1.8/i386-linux
/usr/lib/site_ruby
/usr/lib/ruby/1.8
/usr/lib/ruby/1.8
/usr/lib/ruby/1.8/i386-linux
.

Expected results:
The paths in load path should not be duplicated

--- Additional comment from mtasaka on 2011-07-04 07:51:51 EDT ---

Any reason that mocha should raise error for this issue?

(Well, it may be that there aren't any duplicate path, however I don't think raising error for this reason is preferable).

--- Additional comment from vondruch on 2011-07-04 08:01:39 EDT ---

That is not mocha issue. If you'll take a look closer on my steps to reproduce, you will see that there are duplicated paths for i386.

The reason is because on x86_64 the paths are duplicated to load libraries from both, lib and lib64 where on i386 the lib64 falls back to lib and that creates the duplicated entries.

--- Additional comment from mtasaka on 2011-07-04 08:03:10 EDT ---

(This is not ruby, however for example as root:

# echo $PATH
/usr/lib/qt-3.3/bin:/usr/lib/mpich2/bin:/usr//sbin:/usr//bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

So "duplicate path" is not ruby specific but somewhat common issue and we usually ignore this )

--- Additional comment from mtasaka on 2011-07-04 08:05:01 EDT ---

(In reply to comment #2)
> That is not mocha issue. If you'll take a look closer on my steps to reproduce,
> you will see that there are duplicated paths for i386.
> 
> The reason is because on x86_64 the paths are duplicated to load libraries from
> both, lib and lib64 where on i386 the lib64 falls back to lib and that creates
> the duplicated entries.

What I am saying is that I wonder there is any reason why mocha should complain and raise error for ruby that ruby has duplicate paths.

--- Additional comment from mtasaka on 2011-07-04 08:08:21 EDT ---

In other words, I wonder why duplicate paths on ruby really matters on mocha (although it may be that fixing this is preferable)

--- Additional comment from vondruch on 2011-07-04 08:45:54 EDT ---

(In reply to comment #5)
> In other words, I wonder why duplicate paths on ruby really matters on mocha
> (although it may be that fixing this is preferable)

Mocha is not complaining about anything. ActiveSupport test is complaining. Here [1] is the patch which introduces the test case. Unfortunately there is no other explanation.

Since this problem is IMO introduced by ruby-1.8.7-lib-paths.patch patch, I would like to see it fixed in Fedora.

[1] https://github.com/rails/rails/commit/4419497e403387a3cc93c4c1a3b6a07314a85e43

--- Additional comment from tagoh on 2011-07-04 21:47:49 EDT ---

IMHO expecting no duplicate load path may be wrong assumption. though that may directly affects the performance to find libs out. so that should be better fixed, but it's another issue.

--- Additional comment from updates on 2011-07-15 21:51:02 EDT ---

ruby-1.8.7.352-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/ruby-1.8.7.352-1.fc14

--- Additional comment from updates on 2011-07-15 21:51:44 EDT ---

ruby-1.8.7.352-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/ruby-1.8.7.352-1.fc15

--- Additional comment from updates on 2011-07-16 03:25:00 EDT ---

Package ruby-1.8.7.352-1.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ruby-1.8.7.352-1.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/ruby-1.8.7.352-1.fc15
then log in and leave karma (feedback).

--- Additional comment from vondruch on 2011-07-18 03:55:24 EDT ---

I did not tested it yet, but thank you for the fix anyway :)

Comment 6 errata-xmlrpc 2011-12-06 12:08:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2011-1581.html


Note You need to log in before you can comment on or make changes to this bug.