kgio RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <>
To: Petr Novodvorskiy <>
Cc:, Lara Martin <>,
	Nick Astete <>
Subject: [PATCH] tryopen: add RB_GC_GUARD for Ruby 1.8
Date: Fri, 9 Jan 2015 02:10:30 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Petr, I haven't heard from you, but I'm nearly certain adding
one RB_GC_GUARD will solve your problem and will push out the
following patch, thanks.

From: Eric Wong <>
Subject: [PATCH] tryopen: add RB_GC_GUARD for Ruby 1.8

Calling rb_intern(RSTRING_PTR(err)) was unsafe as the `err'
value could be GC-ed inside rb_intern.

This only affected Ruby 1.8 as Errno.constants returns an
array of Symbols under 1.9+

Thanks to Petr Novodvorskiy for reporting the issue.

ref: <>
Cc: Petr Novodvorskiy <>
Cc: Lara Martin <>
Cc: Nick Astete <>
 ext/kgio/tryopen.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ext/kgio/tryopen.c b/ext/kgio/tryopen.c
index 20f3f6d..d87cb17 100644
--- a/ext/kgio/tryopen.c
+++ b/ext/kgio/tryopen.c
@@ -194,4 +194,5 @@ void init_kgio_tryopen(void)
+	RB_GC_GUARD(tmp);

      parent reply	other threads:[~2015-01-09  2:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-30  7:00 programs using kgio crash under memory pressure during init Petr Novodvorskiy
2014-12-30  7:22 ` Eric Wong
2014-12-30  7:40 ` Hleb Valoshka
2015-01-06  3:11 ` Eric Wong
2015-01-09  2:10 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).