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

noreply at rubyforge.org noreply at rubyforge.org
Fri Nov 12 17:46:26 EST 2010


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

Category: None
Group: None
>Status: Closed
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: Ryan Davis (zenspider)
Date: 2010-11-12 14:46

Message:
This ticket has been deemed stale and we're closing it in order to catch up 
with our ticket list. If you think it is still valid, please reopen.

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

Comment By: Bruno Michel (nono)
Date: 2010-02-27 05: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: 2009-08-20 15:54

Message:
You probably wanted to use pp then.

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

Comment By: Simon Chiang (prosperity)
Date: 2009-08-20 15: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: 2009-08-20 13:48

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

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

Comment By: Chad Woolley (thewoolleyman)
Date: 2009-08-20 10: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