[#8484] strptime fails to properly parse certain inputs — <noreply@...>

Bugs item #5263, was opened at 2006-08-01 23:14

13 messages 2006/08/02
[#8485] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — Yukihiro Matsumoto <matz@...> 2006/08/02

Hi,

[#8538] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — nobu@... 2006/08/06

Hi,

[#8561] sandbox timers & block scopes — why the lucky stiff <ruby-core@...>

Two puzzles I am trying to solve:

28 messages 2006/08/08
[#8624] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

raise ThisDecayingInquisition, "anyone? anyone at all?"

[#8627] Re: sandbox timers & block scopes — MenTaLguY <mental@...> 2006/08/15

On Wed, 2006-08-16 at 00:35 +0900, why the lucky stiff wrote:

[#8628] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

On Wed, Aug 16, 2006 at 02:46:30AM +0900, MenTaLguY wrote:

[#8629] Re: sandbox timers & block scopes — "Charles O Nutter" <headius@...> 2006/08/15

On 8/15/06, why the lucky stiff <ruby-core@whytheluckystiff.net> wrote:

[#8690] a ruby-core primer — why the lucky stiff <ruby-core@...>

Hello, all. I've been working on the ruby-core page for the new Ruby site.

21 messages 2006/08/22

sandbox r50, here we go, loading conflicting gems

From: why the lucky stiff <ruby-core@...>
Date: 2006-08-30 18:20:30 UTC
List: ruby-core #8758
Checky.

  require 'sandbox'
  
  hpricot = Sandbox.new :init => [:all]
  hpricot.eval(%{
    require 'rubygems'
    require_gem 'hpricot', '=0.4.47'
    require 'hpricot'
    puts Hpricot("<a class=test>link</a>").search(".test")
  })
  
  hpricot2 = Sandbox.new :init => [:all]
  hpricot2.eval(%{
    require 'rubygems'
    require_gem 'hpricot', '=0.4'
    require 'hpricot'
    puts Hpricot("<a class=test>link</a>").search(".test")
  })

This proves existence of a bug in Hpricot 0.4, which was extinguished in 0.4.47.
The output is:

  <a class="test">link</a>
  /home/why/sand/RUBY-1_8_5/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/traverse.rb:110:in
  `_eval': NoMethodError: undefined method `[]=' for #<MatchData:0x8510448>
  (Sandbox::Exception)
          from ./lib/sandbox.rb:19:in `eval'
          from test.rb:21

In other words, 0.4.47 finds the link, but 0.4 raises the MatchData exception.

This new version requires a new patch.  Indeed, swapping ruby_cref was the
finishing touch.  Be aware, some globals and constants are not yet implemented.

_why

Attachments (1)

ruby-1.8.5-crefs_exposed.patch (846 Bytes, text/x-diff)
diff -wur ruby-1.8.5/eval.c ruby-1.8.5-top_cref_exposed/eval.c
--- ruby-1.8.5/eval.c	Sun Aug  6 21:43:39 2006
+++ ruby-1.8.5-top_cref_exposed/eval.c	Wed Aug 30 12:46:07 2006
@@ -1061,8 +1061,8 @@
 #define POP_CLASS() ruby_class = _class; \
 } while (0)
 
-static NODE *ruby_cref = 0;
-static NODE *top_cref;
+NODE *ruby_cref = 0;
+NODE *top_cref;
 #define PUSH_CREF(c) ruby_cref = NEW_NODE(NODE_CREF,(c),0,ruby_cref)
 #define POP_CREF() ruby_cref = ruby_cref->nd_next
 
diff -wur ruby-1.8.5/node.h ruby-1.8.5-top_cref_exposed/node.h
--- ruby-1.8.5/node.h	Mon Feb 13 02:10:53 2006
+++ ruby-1.8.5-top_cref_exposed/node.h	Wed Aug 30 12:46:21 2006
@@ -151,6 +151,9 @@
     } u3;
 } NODE;
 
+extern NODE *ruby_cref;
+extern NODE *top_cref;
+
 #define RNODE(obj)  (R_CAST(RNode)(obj))
 
 #define nd_type(n) ((int)(((RNODE(n))->flags>>FL_USHIFT)&0xff))

In This Thread

Prev Next