Skip to content

libgc: Fix crasher with some GCC configurations

Bastien Nocera requested to merge wip/fix-gc-blocks-init-crasher into master

const variables are not supposed to be writable, and trying to initialise the various "const" blocks caused SEGVs. Remove the const modifier as it's incorrect.

The valgrind output for this crash is clear, "Bad permissions":

==11056== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==11056==  Bad permissions for mapped region at address 0x28C91360
==11056==    at 0x28C8D0AB: init_blocks (gc.c:926)
==11056==    by 0x28C8E46B: gc_character_iter_init_for_related (gc.c:938)
==11056==    by 0x28C8E46B: gc_search_context_search (gc.c:1124)
Edited by Bastien Nocera

Merge request reports