Ruby Issue Tracking System: Issueshttps://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112008-11-21T08:26:31ZRuby Issue Tracking System
Redmine Ruby 1.8 - Bug #769 (Closed): Mathn's Rational#power2 is broken on 1.8.6 and 1.8.7https://bugs.ruby-lang.org/issues/7692008-11-21T08:26:31Zjredville (Jim Deville)jdeville@microsoft.com
<p>=begin<br>
Mathn's Rational#power2 method is broken in multiple places.</p>
<ol>
<li>The loop has no variant, it can go into an infinite loop, unless the conditional is true from the start.</li>
<li>1.8.6 still has the neaed typo (Redmine <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Rational#power2 raises a NameError or causes infinite loops when passed a Rational (Closed)" href="https://bugs.ruby-lang.org/issues/175">#175</a>)</li>
<li>assignment to nearn on line 208</li>
<li>Construction of a Rational with 2 non-existant variables: num and den (dem is used, but not den)</li>
</ol>
<p>Some test cases that demonstrate the broken code:<br>
(Rational.new!(1, 4).power2(Rational.new!(1, 2))) #(NameError for neaed)<br>
(Rational.new!(3, 4).power2(Rational.new!(0, 3))) #Infinite loop<br>
=end</p> Ruby 1.8 - Bug #768 (Closed): Mathn's Rational#power2 is broken on 1.8.6 and 1.8.7https://bugs.ruby-lang.org/issues/7682008-11-21T08:26:31Zjredville (Jim Deville)jdeville@microsoft.com
<p>=begin<br>
Mathn's Rational#power2 method is broken in multiple places.</p>
<ol>
<li>The loop has no variant, it can go into an infinite loop, unless the conditional is true from the start.</li>
<li>1.8.6 still has the neaed typo (Redmine <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Rational#power2 raises a NameError or causes infinite loops when passed a Rational (Closed)" href="https://bugs.ruby-lang.org/issues/175">#175</a>)</li>
<li>assignment to nearn on line 208</li>
<li>Construction of a Rational with 2 non-existant variables: num and den (dem is used, but not den)</li>
</ol>
<p>Some test cases that demonstrate the broken code:<br>
(Rational.new!(1, 4).power2(Rational.new!(1, 2))) #(NameError for neaed)<br>
(Rational.new!(3, 4).power2(Rational.new!(0, 3))) #Infinite loop<br>
=end</p> Ruby 1.8 - Bug #745 (Rejected): IO associates with the file descriptor, not the streamhttps://bugs.ruby-lang.org/issues/7452008-11-12T05:48:36Zjredville (Jim Deville)jdeville@microsoft.com
<p>=begin<br>
When IO.new is called with a file descriptor, it is linked to the file descriptor, not the associated stream.</p>
<p>f = File.open("test.rb", "w") #f.to_i == 3 on windows<br>
i = IO.new(f.to_i, "w")<br>
f.close #file descriptor 3 is now free'd, so it can be reused<br>
g = File.open("test2","w") # g.to_i == 3 because f was closed<br>
i.write "foo" #the stream that i was opened on is now closed, but i is still active<br>
i.flush</p>
<p>i.close #this closes the stream! Not just the FD<br>
g.close #this throws an error, because i.close closed g's stream</p>
<p>This has been observed on Windows, and OS X with Ruby 1.8.6 p111. I expect i.write to fail because the stream has already been closed. If there is good reason to keep i associated with the fd, then i.close shouldn't close g.<br>
=end</p> Ruby 1.8 - Bug #620 (Closed): #dup'd module autoload brokenhttps://bugs.ruby-lang.org/issues/6202008-10-08T08:31:04Zjredville (Jim Deville)jdeville@microsoft.com
<p>=begin<br>
In the attached code,a TypeError is thrown on line 9, this appears to be related to the dup on line 4. The presence of the autoload is messing up constant look up semantics, and causing an error to be thrown. I'd expect the used autoload (used by the constant lookup on line 6) to be a no-op and allow the constant lookup to work as expected.<br>
=end</p> Ruby 1.8 - Bug #576 (Closed): Segfault if Class.new is aliasedhttps://bugs.ruby-lang.org/issues/5762008-09-20T05:49:50Zjredville (Jim Deville)jdeville@microsoft.com
<p>=begin<br>
By aliasing Class.new, one can get around the lack of MatchData.new (and presumably other hidden new methods). If one uses this to try and create a new MatchData, and then calls an instance method of the new MatchData object, Ruby segfaults. This has been tested and reproduced on Ruby 1.8.6p111 and Ruby 1.8.6 HEAD.<br>
=end</p> Ruby 1.8 - Bug #238 (Rejected): Ruby doesn't respect the Windows read-only flaghttps://bugs.ruby-lang.org/issues/2382008-07-09T07:26:58Zjredville (Jim Deville)jdeville@microsoft.com
<p>=begin<br>
If you create a file on Windows, attrib +r the file, to give it read-only permissions, and then run Ruby 1.8 or 1.9 and do a Dir.delete on that file, Ruby will delete the file. It should probably throw a SystemCallError to match other platforms.</p>
<p>This has been tested on Vista SP1 with Ruby 1.8 and 1.9.<br>
=end</p>