[ruby-core:65009] Re: [ruby-trunk - Bug #10206] garbage symbols crash symbol GC

From: Eric Wong <normalperson@...>
Date: 2014-09-12 22:59:54 UTC
List: ruby-core #65009
nobu@ruby-lang.org wrote:
> One problem about it is ripper.
> The result of `Ripper.parse` is transient, but symbols by its side-effect are permanent, right now.
> 
> So now I'm thinking the plan:
> 
> 1. make all IDs permanent, as ko1 claims
> 2. isolate Symbols in ripper from IDs

nobu: can you fix this in time for 2.2.0-preview1 release?

Otherwise, I propose the following temporary fix:

--- a/parse.y
+++ b/parse.y
@@ -285,7 +285,7 @@ struct parser_params {
 #ifdef RIPPER
 #define intern_cstr_without_pindown(n,l,en) rb_intern3(n,l,en)
 #else
-#define intern_cstr_without_pindown(n,l,en) rb_intern_cstr_without_pindown(n,l,en)
+#define intern_cstr_without_pindown(n,l,en) rb_intern3(n,l,en)
 #endif
 
 #define STR_NEW(p,n) rb_enc_str_new((p),(n),current_enc)

In This Thread