[#35027] [Ruby 1.9-Bug#4352][Open] [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s) — "James M. Lawrence" <redmine@...>

Bug #4352: [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s)

16 messages 2011/02/01

[#35114] [Ruby 1.9-Bug#4373][Open] http.rb:677: [BUG] Segmentation fault — Christian Fazzini <redmine@...>

Bug #4373: http.rb:677: [BUG] Segmentation fault

59 messages 2011/02/06

[#35171] [Ruby 1.9-Bug#4386][Open] encoding: directive does not affect regex expressions — mathew murphy <redmine@...>

Bug #4386: encoding: directive does not affect regex expressions

9 messages 2011/02/09

[#35237] [Ruby 1.9-Bug#4400][Open] nested at_exit hooks run in strange order — Suraj Kurapati <redmine@...>

Bug #4400: nested at_exit hooks run in strange order

12 messages 2011/02/15

[ruby-core:35280] [Ruby 1.9-Bug#4405][Open] WIN32OLE & Threads incompatible

From: Lars Christensen <redmine@...>
Date: 2011-02-17 08:45:15 UTC
List: ruby-core #35280
Bug #4405: WIN32OLE & Threads incompatible
http://redmine.ruby-lang.org/issues/show/4405

Author: Lars Christensen
Status: Open, Priority: Normal
Category: ext
ruby -v: ruby 1.9.2p136 (2010-12-25) [i386-mingw32]

The WIN32OLE library does not work when using Ruby threads. It may raise exceptions such as this:

(druby://localhost:2002) threadsys.rb:7:in `connect': failed to parse display name of moniker `winmgmts://localhost/root/cimv2' (WIN32OLERuntimeError)

WIN32 OLE api's are not generally Thread safe, and it can be argued that it is the user's task to ensure that it is accessed only from one thread, or the main thread. However, there are some complications;

- Using WIN32OLE from DRb (DRb can not be used without Threads).
- Using WIN32OLE indirectly (e.g. through Sys::ProcTable).

My specific case was a DRb server that examined processes using Sys::ProcTable, which happen to use WIN32OLE.  This causes an exception. Attached is a simple script that recreates the problem. Note that in this simple case, WIN32OLE is only invokes once, and only from one single thread (and it still throws the exception).


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

Attachments (1)

threadsys.rb (257 Bytes, text/x-ruby)
require 'drb'
require 'win32ole'
class Server
  def serve
    WIN32OLE.connect("winmgmts://localhost/root/cimv2")
  end
end
server = Server.new
DRb.start_service("druby://:2002", server)
s = DRbObject.new(nil, "druby://localhost:2002")
p s.serve

In This Thread

Prev Next