[Rubygems-developers] [ rubygems-Bugs-26958 ] Gem::Specification.hash can cause to_yaml RangeError

noreply at rubyforge.org noreply at rubyforge.org
Sat Feb 27 08:12:41 EST 2010


Bugs item #26958, was opened at 20/08/2009 07:18
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=26958&group_id=126

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Simon Chiang (prosperity)
Assigned to: Nobody (None)
Summary: Gem::Specification.hash can cause to_yaml RangeError

Initial Comment:
Array.hash for objects do not produce a Fixnum hash will blow up. Gem::Specification often produces a Bignum and this prevents an array of specifications from being converted to YAML.

This issue (which is really a ruby issue) will be fixed in a future release but I thought you might like to know in case you wanted to patch RubyGems for versions prior to the fix.

(see http://redmine.ruby-lang.org/issues/show/1883)

==========================
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.1
  - RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-9
  - GEM PATHS:
     - /Library/Ruby/Gems/1.8
     - /Users/simonchiang/.gem/ruby/1.8
     - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org/", "http://gems.github.com"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com


----------------------------------------------------------------------

Comment By: Bruno Michel (nono)
Date: 27/02/2010 14:12

Message:
Bundler also seems to convert specs to yaml. See this message on the Rails-core mailing-list: http://groups.google.com/group/rubyonrails-core/browse_thread/thread/a0ba2eacb26b5524?hl=en#

----------------------------------------------------------------------

Comment By: Eric Hodel (drbrain)
Date: 21/08/2009 00:54

Message:
You probably wanted to use pp then.

----------------------------------------------------------------------

Comment By: Simon Chiang (prosperity)
Date: 21/08/2009 00:25

Message:
@chad

Ok, great.  I'll work a little something up when I get a
free minute.

@eric

A framework I'm working on (http://tap.rubyforge.org)
discovers resources within gems and my environment ends up
referencing an array of specs.  At some point I dumped the
environment and found the error.  Honestly, it's just
something I stumbled on.  I don't actually have a specific
need to convert the specs to YAML.



----------------------------------------------------------------------

Comment By: Eric Hodel (drbrain)
Date: 20/08/2009 22:48

Message:
Why are you converting specs to YAML in the first place?

----------------------------------------------------------------------

Comment By: Chad Woolley (thewoolleyman)
Date: 20/08/2009 19:55

Message:
This looks reasonable and is reproducible, but I'm not sure what is dependent upon the current implementation of hash.  Maybe someone else can weigh in...

Regardless, can you please submit this as a proper patch, with your failing tests added to the appropriate file (test_gem_specification.rb) - and, of course, ensure nothing else in the test suite breaks?

Thanks,
-- Chad

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=26958&group_id=126


More information about the Rubygems-developers mailing list