[#36711] [Ruby 1.9 - Bug #4821][Open] Random Segfaults (in start_thread?) — Ivan Bortko <b2630639@...>

22 messages 2011/06/03

[#36730] [Ruby 1.9 - Feature #4824][Open] Provide method Kernel#executed? — Lazaridis Ilias <ilias@...>

56 messages 2011/06/04

[#36750] [Ruby 1.9 - Feature #4830][Open] Provide Default Variables for Array#each and other iterators — Lazaridis Ilias <ilias@...>

24 messages 2011/06/05

[#36785] [Ruby 1.9 - Feature #4840][Open] Allow returning from require — Rodrigo Rosenfeld Rosas <rr.rosas@...>

53 messages 2011/06/06
[#36811] Re: [Ruby 1.9 - Feature #4840][Open] Allow returning from require — Yusuke ENDOH <mame@...> 2011/06/07

Hello,

[#36799] [Ruby 1.9 - Feature #4845][Open] Provide Class#cb_object_instantiated_from_literal(object) — Lazaridis Ilias <ilias@...>

11 messages 2011/06/06

[#36834] [Ruby 1.9 - Feature #3905] rb_clear_cache_by_class() called often during GC for non-blocking I/O — Charles Nutter <headius@...>

10 messages 2011/06/08
[#36860] Re: [Ruby 1.9 - Feature #3905] rb_clear_cache_by_class() called often during GC for non-blocking I/O — Eric Wong <normalperson@...> 2011/06/08

Charles Nutter <headius@headius.com> wrote:

[#36863] Object#trust vs Object#taint — Aaron Patterson <aaron@...>

Hi,

16 messages 2011/06/08
[#36866] Re: Object#trust vs Object#taint — Yukihiro Matsumoto <matz@...> 2011/06/08

Hi,

[#36873] Re: Object#trust vs Object#taint — Aaron Patterson <aaron@...> 2011/06/09

On Thu, Jun 09, 2011 at 07:49:06AM +0900, Yukihiro Matsumoto wrote:

[#37071] [Ruby 1.9 - Feature #4877][Open] Unify Variable Expansion within Strings — Lazaridis Ilias <ilias@...>

12 messages 2011/06/12

[#37106] ruby core tutorials location — Roger Pack <rogerdpack2@...>

Hello all.

10 messages 2011/06/13
[#37107] Re: ruby core tutorials location — Jon <jon.forums@...> 2011/06/13

> Hello all.

[#37115] Re: ruby core tutorials location — Roger Pack <rogerdpack2@...> 2011/06/13

> Rather than adding links to source code, I would prefer the wikibooks link and others under a new Tutorials section of http://www.ruby-lang.org/en/documentation/ as well as adding http://ruby.runpaint.org/ to the existing Getting Started section.

[#37117] Re: ruby core tutorials location — Jon <jon.forums@...> 2011/06/13

> > Rather than adding links to source code, I would prefer the wikibooks link and others under a new Tutorials section of http://www.ruby-lang.org/en/documentation/ as well as adding http://ruby.runpaint.org/ to the existing Getting Started section.

[#37128] Re: ruby core tutorials location — Roger Pack <rogerdpack2@...> 2011/06/14

> I like what you're trying to do and see how great that tutorial connection from rdoc/yard could be, say, mixing with existing ruby-doc.org and rubydoc.info. ut I question embedding source links to info in which the info can easily grow outdated or abandoned as time passes. I also question the ongoing maintenance burdens.

[#37137] Re: ruby core tutorials location — Jon <jon.forums@...> 2011/06/14

> > I like what you're trying to do and see how great that tutorial connection from rdoc/yard could be, say, mixing with existing ruby-doc.org and rubydoc.info. ut I question embedding source links to info in which the info can easily grow outdated or abandoned as time passes. I also question the ongoing maintenance burdens.

[#37164] [Ruby 1.9 - Feature #4890][Open] Enumerable#lazy — Yutaka HARA <redmine@...>

30 messages 2011/06/16

[#37170] [Ruby 1.9 - Bug #4893][Open] Literal Instantiation breaks Object Model — Lazaridis Ilias <ilias@...>

61 messages 2011/06/16

[#37207] [Ruby 1.9 - Feature #4897][Open] Define Math::TAU and BigMath.TAU. The "true" circle constant, Tau=2*Pi. See http://tauday.com/ — Simon Baird <simon.baird@...>

43 messages 2011/06/17

[#37286] [Ruby 1.9 - Bug #4916][Open] [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eoc — Hiroshi NAKAMURA <nakahiro@...>

9 messages 2011/06/22

[#37324] [Ruby 1.9 - Bug #4923][Open] [ext/openssl] test_ssl.rb: test_client_auth fails — Martin Bosslet <Martin.Bosslet@...>

19 messages 2011/06/23

[#37576] [Ruby 1.9 - Feature #4938][Open] Add Random.bytes [patch] — Marc-Andre Lafortune <ruby-core@...>

13 messages 2011/06/27

[#37612] [Ruby 1.9 - Bug #4941][Open] cannot load such file -- rubygems.rb (LoadError) — Lazaridis Ilias <ilias@...>

25 messages 2011/06/28

[ruby-core:36981] [Ruby 1.9 - Bug #3841] RubyVM::InstructionSequence.to_a() and disasm() do not work properly for "for <var> in <list>"

From: Koichi Sasada <redmine@...>
Date: 2011-06-11 06:18:54 UTC
List: ruby-core #36981
Issue #3841 has been updated by Koichi Sasada.

Priority changed from Normal to Low
Target version set to 1.9.x

If I have a time, I'll check it.

----------------------------------------
Bug #3841: RubyVM::InstructionSequence.to_a() and disasm() do not work properly for "for <var> in <list>"
http://redmine.ruby-lang.org/issues/3841

Author: Sean O'Neil
Status: Assigned
Priority: Low
Assignee: Koichi Sasada
Category: 
Target version: 1.9.x
ruby -v: ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-mswin32_90]


=begin
 I have been playing with the concept of caching compiled Ruby instruction sequences and reloading them later. For now the simplest way to do it is to use RubyVM::InstructionSequence.to_a() and Marshal.dump() to convert the resulting array to a smaller binary byte sequence. While testing this, I found that some Ruby scripts worked fine when an instruction sequence was reloaded, but others broke.
 
 As a test, I decided to try compiling irb.rb and its dependencies. When I try to reload the compiled sequences, the first file that breaks is irb/extend-command.rb. I tracked it down to the way "for <vars> in <list>" code block and parameters are handled, but I am not sure how to fix it. When I converted each "for <vars> in <list>" loop to "<list>.each {|<vars>|", it started working perfectly. Here's an example of how the disassembly differs between the two loops:
 
 def self.install_extend_commands
   @EXTEND_COMMANDS.each {|args|
     def_extend_command(*args)
   }
 end
 == disasm: <RubyVM::InstructionSequence:block in install_extend_commands@irb/extend-command.rb>
 == catch table
 | catch type: redo   st: 0000 ed: 0012 sp: 0000 cont: 0000
 | catch type: next   st: 0000 ed: 0012 sp: 0000 cont: 0012
 |------------------------------------------------------------------------
 local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1] s3)
 [ 2] args<Arg>  
 0000 trace            1                                               ( 110)
 0002 putnil           
 0003 getdynamic       args, 0
 0006 send             :def_extend_command, 1, nil, 10, <ic:0>
 0012 leave            
 
 def self.install_extend_commands
   for args in @EXTEND_COMMANDS
     def_extend_command(*args)
   end
 end
 == disasm: <RubyVM::InstructionSequence:block in install_extend_commands@irb/extend-command.rb>
 == catch table
 | catch type: redo   st: 0005 ed: 0016 sp: 0000 cont: 0005
 | catch type: next   st: 0005 ed: 0016 sp: 0000 cont: 0016
 |------------------------------------------------------------------------
 local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1] s3)
 [ 2] ?<Arg>     
 0000 getdynamic       *, 0                                            ( 206)
 0003 setlocal         args                                            ( 204)
 0005 trace            1                                               ( 205)
 0007 putnil           
 0008 getlocal         args
 0010 send             :def_extend_command, 1, nil, 10, <ic:0>
 0016 leave            
 
 In this example, rb_id2name() returns NULL for the name of the argument passed to the code block. That is why it puts a "?" in the local table and a "*" in the getdynamic command. The to_a() method has a similar problem, and it appears to put a number there instead. When I use the load() method to convert the array back into an instruction sequence and try to execute it, the code block ends up receiving a number as a parameter instead of the entry in the list it is supposed to get.
 
 I imagine this is not a high priority for the Ruby core team, and I don't mind putting in some work to fix it. However, it looks like it would take me a while to figure out, so I would appreciate any tips you could give me to point me in the right direction.
 
 Thank you,
 Sean O'Neil
=end



-- 
http://redmine.ruby-lang.org

In This Thread

Prev Next