[MacPorts] #22361: Ruby 1.87 Hash equivalence fails on large Fixnums

View: New views
8 Messages — Rating Filter:   Alert me  

[MacPorts] #22361: Ruby 1.87 Hash equivalence fails on large Fixnums

by MacPorts :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#22361: Ruby 1.87 Hash equivalence fails on large Fixnums
----------------------------+-----------------------------------------------
 Reporter:  ben@…           |       Owner:  macports-tickets@…                  
     Type:  defect          |      Status:  new                                  
 Priority:  Normal          |   Milestone:                                      
Component:  ports           |     Version:  1.8.1                                
 Keywords:  ruby hash       |        Port:                                      
----------------------------+-----------------------------------------------
 On MacOS Leopard 10.5.8 with Ruby 1.87 (all patchlevels <= 174) and all
 compatible versions of MacPorts (<= 1.8.1)

 Hash equivalence fails when a value is a Fixnum > 536870911.

 >> {:a => 536870911}.hash == {:a => 536870911}.hash
 => true

 >> {:a => 536870912}.hash == {:a => 536870912}.hash
 => false

--
Ticket URL: <http://trac.macports.org/ticket/22361>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
_______________________________________________
macports-tickets mailing list
macports-tickets@...
http://lists.macosforge.org/mailman/listinfo.cgi/macports-tickets

Re: [MacPorts] #22361: Ruby 1.87 Hash equivalence fails on large Fixnums

by MacPorts :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#22361: Ruby 1.87 Hash equivalence fails on large Fixnums
----------------------------+-----------------------------------------------
 Reporter:  ben@…           |       Owner:  macports-tickets@…                  
     Type:  defect          |      Status:  new                                  
 Priority:  Normal          |   Milestone:                                      
Component:  ports           |     Version:  1.8.1                                
 Keywords:  ruby hash       |        Port:                                      
----------------------------+-----------------------------------------------

Comment(by visnupx@…):

 btw, 2**29 == 536870912.  also, works on snow leopard:

 {{{
 >> {:a => 2**29-1}.hash
 => 2146753031
 >> {:a => 2**29-1}.hash
 => 2146753031
 >> {:a => 2**29}.hash
 => -2146753029
 >> {:a => 2**29}.hash
 => -2146753029
 }}}

--
Ticket URL: <http://trac.macports.org/ticket/22361#comment:1>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
_______________________________________________
macports-tickets mailing list
macports-tickets@...
http://lists.macosforge.org/mailman/listinfo.cgi/macports-tickets

Re: [MacPorts] #22361: Ruby 1.87 Hash equivalence fails on large Fixnums

by MacPorts :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#22361: Ruby 1.87 Hash equivalence fails on large Fixnums
----------------------------+-----------------------------------------------
 Reporter:  ben@…           |       Owner:  macports-tickets@…                  
     Type:  defect          |      Status:  new                                  
 Priority:  Normal          |   Milestone:                                      
Component:  ports           |     Version:  1.8.1                                
 Keywords:  ruby hash       |        Port:                                      
----------------------------+-----------------------------------------------

Comment(by visnupx@…):

 apple's /usr/bin/ruby in snow leopard 10.6.1

--
Ticket URL: <http://trac.macports.org/ticket/22361#comment:2>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
_______________________________________________
macports-tickets mailing list
macports-tickets@...
http://lists.macosforge.org/mailman/listinfo.cgi/macports-tickets

Re: [MacPorts] #22361: Ruby 1.87 Hash equivalence fails on large Fixnums

by MacPorts :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#22361: Ruby 1.87 Hash equivalence fails on large Fixnums
----------------------------+-----------------------------------------------
 Reporter:  ben@…           |       Owner:  kimuraw@…          
     Type:  defect          |      Status:  new                
 Priority:  Normal          |   Milestone:                      
Component:  ports           |     Version:  1.8.1              
 Keywords:                  |        Port:  ruby                
----------------------------+-----------------------------------------------
Changes (by macsforever2000@…):

  * keywords:  ruby hash =>
  * owner:  macports-tickets@… => kimuraw@…
  * port:  => ruby


--
Ticket URL: <http://trac.macports.org/ticket/22361#comment:3>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
_______________________________________________
macports-tickets mailing list
macports-tickets@...
http://lists.macosforge.org/mailman/listinfo.cgi/macports-tickets

Re: [MacPorts] #22361: Ruby 1.87 Hash equivalence fails on large Fixnums

by MacPorts :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#22361: Ruby 1.87 Hash equivalence fails on large Fixnums
----------------------------+-----------------------------------------------
 Reporter:  ben@…           |       Owner:  kimuraw@…          
     Type:  defect          |      Status:  new                
 Priority:  Normal          |   Milestone:                      
Component:  ports           |     Version:  1.8.1              
 Keywords:                  |        Port:  ruby                
----------------------------+-----------------------------------------------
Description changed by macsforever2000@…:

Old description:

> On MacOS Leopard 10.5.8 with Ruby 1.87 (all patchlevels <= 174) and all
> compatible versions of MacPorts (<= 1.8.1)
>
> Hash equivalence fails when a value is a Fixnum > 536870911.
>
> >> {:a => 536870911}.hash == {:a => 536870911}.hash
> => true
>
> >> {:a => 536870912}.hash == {:a => 536870912}.hash
> => false

New description:

 On MacOS Leopard 10.5.8 with Ruby 1.87 (all patchlevels <= 174) and all
 compatible versions of MacPorts (<= 1.8.1)

 Hash equivalence fails when a value is a Fixnum > 536870911.

 {{{
 >> {:a => 536870911}.hash == {:a => 536870911}.hash
 => true
 }}}

 {{{
 >> {:a => 536870912}.hash == {:a => 536870912}.hash
 => false
 }}}

--

--
Ticket URL: <http://trac.macports.org/ticket/22361#comment:4>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
_______________________________________________
macports-tickets mailing list
macports-tickets@...
http://lists.macosforge.org/mailman/listinfo.cgi/macports-tickets

Re: [MacPorts] #22361: Ruby 1.87 Hash equivalence fails on large Fixnums

by MacPorts :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#22361: Ruby 1.87 Hash equivalence fails on large Fixnums
----------------------------+-----------------------------------------------
 Reporter:  ben@…           |       Owner:  kimuraw@…          
     Type:  defect          |      Status:  assigned            
 Priority:  Normal          |   Milestone:                      
Component:  ports           |     Version:  1.8.1              
 Keywords:                  |        Port:  ruby                
----------------------------+-----------------------------------------------
Changes (by kimuraw@…):

  * status:  new => assigned


Comment:

 I reproduced this on snow leopard built-in ruby.


 {{{
   % arch -x86_64 /usr/bin/ruby -e 'p ({:a=>2**61}.hash ==
 {:a=>2**61}.hash)'
   false
   % arch -i386 /usr/bin/ruby -e 'p ({:a=>2**29}.hash == {:a=>2**29}.hash)'
   false
 }}}

--
Ticket URL: <http://trac.macports.org/ticket/22361#comment:6>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
_______________________________________________
macports-tickets mailing list
macports-tickets@...
http://lists.macosforge.org/mailman/listinfo.cgi/macports-tickets

Re: [MacPorts] #22361: Ruby 1.87 Hash equivalence fails on large Fixnums

by MacPorts :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#22361: Ruby 1.87 Hash equivalence fails on large Fixnums
----------------------------+-----------------------------------------------
 Reporter:  ben@…           |       Owner:  kimuraw@…          
     Type:  defect          |      Status:  assigned            
 Priority:  Normal          |   Milestone:                      
Component:  ports           |     Version:  1.8.1              
 Keywords:                  |        Port:  ruby                
----------------------------+-----------------------------------------------

Comment(by kimuraw@…):

 Hash#hash returns different values from each invocations.

 {{{
 % ruby -v
 ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]
 % irb --simple-prompt
 >> h = {:a => 2**61}
 => {:a=>2305843009213693952}
 >> h.hash
 => 3933384
 >> h.hash
 => 4179968
 }}}

 I think this is a problem of ruby. I filed a ticket for redmine.ruby-
 lang.org (in japanese).

 http://redmine.ruby-lang.org/issues/show/2334

--
Ticket URL: <http://trac.macports.org/ticket/22361#comment:7>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
_______________________________________________
macports-tickets mailing list
macports-tickets@...
http://lists.macosforge.org/mailman/listinfo.cgi/macports-tickets

Re: [MacPorts] #22361: Ruby 1.87 Hash equivalence fails on large Fixnums

by MacPorts :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#22361: Ruby 1.87 Hash equivalence fails on large Fixnums
-----------------------------+----------------------------------------------
  Reporter:  ben@…           |       Owner:  kimuraw@…          
      Type:  defect          |      Status:  closed              
  Priority:  Normal          |   Milestone:                      
 Component:  ports           |     Version:  1.8.1              
Resolution:  fixed           |    Keywords:                      
      Port:  ruby            |  
-----------------------------+----------------------------------------------
Changes (by kimuraw@…):

  * status:  assigned => closed
  * resolution:  => fixed


Comment:

 ruby core team solved this issue.

 I made a patch from ruby-1.8 changes and added the patch to port:ruby at
 r60220.
 the latest port:ruby (1.8.7-p174_1) works fine.

--
Ticket URL: <http://trac.macports.org/ticket/22361#comment:8>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
_______________________________________________
macports-tickets mailing list
macports-tickets@...
http://lists.macosforge.org/mailman/listinfo.cgi/macports-tickets