[#25936] [Bug:1.9] [rubygems] $LOAD_PATH includes bin directory — Nobuyoshi Nakada <nobu@...>

Hi,

10 messages 2009/10/05

[#25943] Disabling tainting — Tony Arcieri <tony@...>

Would it make sense to have a flag passed to the interpreter on startup that

16 messages 2009/10/05

[#26028] [Bug #2189] Math.atanh(1) & Math.atanh(-1) should not raise an error — Marc-Andre Lafortune <redmine@...>

Bug #2189: Math.atanh(1) & Math.atanh(-1) should not raise an error

14 messages 2009/10/10

[#26222] [Bug #2250] IO::for_fd() objects' finalization dangerously closes underlying fds — Mike Pomraning <redmine@...>

Bug #2250: IO::for_fd() objects' finalization dangerously closes underlying fds

11 messages 2009/10/22

[#26244] [Bug #2258] Kernel#require inside rb_require() inside rb_protect() inside SysV context fails — Suraj Kurapati <redmine@...>

Bug #2258: Kernel#require inside rb_require() inside rb_protect() inside SysV context fails

24 messages 2009/10/22

[#26361] [Feature #2294] [PATCH] ruby_bind_stack() to embed Ruby in coroutine — Suraj Kurapati <redmine@...>

Feature #2294: [PATCH] ruby_bind_stack() to embed Ruby in coroutine

42 messages 2009/10/27

[#26371] [Bug #2295] segmentation faults — tomer doron <redmine@...>

Bug #2295: segmentation faults

16 messages 2009/10/27

[ruby-core:26327] [Bug #2279] When embedding Ruby 1.9.1 it's impossible to disable GC

From: Roman Shterenzon <redmine@...>
Date: 2009-10-26 17:17:24 UTC
List: ruby-core #26327
Bug #2279: When embedding Ruby 1.9.1 it's impossible to disable GC
http://redmine.ruby-lang.org/issues/show/2279

Author: Roman Shterenzon
Status: Open, Priority: Normal
Category: core
ruby -v: ruby 1.9.1p291 (2009-10-25 revision 25484) [i386-darwin10.0.0]

The function vm_xmalloc() will call garbage_collect_with_gvl() even if dont_gc is set by rb_gc_disable().
This is ok (though wastes some CPU cycles) when the code is running in native Ruby interpreter, as later the garbage_collect checks this flag.
What happens in embedded ruby, is that in garbage_collect_with_gvl() the ruby_native_thread_p() returns false, and the process exits with "[FATAL] failed to allocate memory" (so it seems, that the problem is even more serious, as if the GC is enabled, and the code which triggers GC is in C, then the program will exit as well).

I propose not to invoke garbage_collect_with_gvl in the first place, or, exit it right away if dont_gc is true.


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

In This Thread

Prev Next