﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1173	"Symbols held in GC-roots are sometimes collected in ""symbol-gc"" mode"	felix winkelmann		"(Initially reported by sjamaan)

If a symbol is stored in a GC-root, then it may be collected when symbol-GC is enabled (with the `-:w` runtime option). Here a simple test case:

{{{
(foreign-declare
 ""static void *root;
  static void foo(C_word x)
  {
    root = CHICKEN_new_gc_root();
    CHICKEN_gc_root_set(root, x);
  }
  static C_word bar() { return CHICKEN_gc_root_ref(root); }"")

(define foo (foreign-lambda void ""foo"" scheme-object))
(define bar (foreign-lambda scheme-object ""bar""))

(gc #t)
(foo (string->symbol ""FOO""))
(gc #t)
(print (eq? (string->symbol ""FOO"") (bar)))
}}}

Without `-:w`, this will print `#t`, with `-:w` it will print `#f` (sometimes, not always. of course)
"	defect	closed	major	5.0	core libraries	4.9.x	fixed			hard
