Subject: Re: bug#68690: Segmentation fault building with native-comp

From: Mattias Engdegård <[email-masked]>
Date: Fri, 26 Jan 2024 17:07:15 +0100

25 jan. 2024 kl. 23.39 skrev Stefan Monnier <[email-masked]>:

> AFAIK the current DOHASH code in `master` works fine (tho a bit ugly).

I think it's less good (and more complex) than not trying to cache anything at all where the compiler actually will help out a bit, and it's slower than the fast caching version.

> The build failure didn't come via maphash` but via the DOHASH in
> `comp.c` that calls `compile_function` (which apparently can cause the
> hash table to be resized).

Do you know which one? It's quite possible that that code wasn't written taking into account the problems of extending the table being iterated over. We should definitely ask Andrea.

Meanwhile, I suggest adding a DOHASH_SAFE (simple, safe) to be used in these cases, including Fmaphash, and use the (someone less simple, fast) DOHASH in my previous patch with an extra assertion to catch mistakes elsewhere in checking builds.