Hi, I have attached a bugfix for the issue that causes crashes when closing Emacs. Ideally I would figure out why iterating over a weak hash-table does not skip elements that were already GC'd, but I could not do it. I feel fixing this bug is very important, so I used a C array to keep the list of native compilation units.