I wrote:
Replace all quoted #(..) with (vector ..)
Marc:
From my experience with compile-file, Gambit is "copying" (or maybe rather constructing) data from constant definitions upon startup, with the nice benefit that it behaves like in the interpreter (e.g. insensitive to mutation).
My guess is that Gambit is still doing the same in static binaries, but the copied/constructed data is allocated as ___PERM objects; thus storing non-immediate objects into them will not segfault right away, but the latter are not seen anymore by the GC, and hence when accessing the data after the next collection then points into undefined places in memory.
Do you think it would be feasible to make mutating accessors throw an error in safe mode if their argument is a ___PERM object? (Or maybe it's cheaper to just use normal allocations?) I think I'm aware of the implications myself and won't write code which defines and mutates such data, but I may run into such issues again when working with other programmers (where one doesn't always realize the intents of the others).
Christian.