Fix parallel-fasl-load crashing.
commit00f5f3b05791b7254a126164c373c7e2933ba3db
authorDouglas Katzman <dougk@google.com>
Tue, 1 Nov 2016 04:37:42 +0000 (1 00:37 -0400)
committerDouglas Katzman <dougk@google.com>
Tue, 1 Nov 2016 14:25:01 +0000 (1 10:25 -0400)
treea39487a91ee3045a8c05cc40b14b2f9ee5405b96
parent2226a2792f4a1031b1eb97fb8ea91c61e8702c37
Fix parallel-fasl-load crashing.

In rare cases, the fun and raw_addr slots of an fdefn can refer to two
different simple-funs because set-fdefn-fun is not atomic.
When that happened, GC would not fixup the raw addr (nor even preserve
the referenced code component), despite it being possible for a thread
to compute its address implicitly, such as via "JMP [RAX+9]" on x86-64.

Rather than try to make the setter atomic - which might be impossible -
treat the raw_addr as a pointer that is not necessarily related to the
tagged function, and ensure that it survives GC if the fdefn does.
src/runtime/gc-common.c