VectorCamp / vectorscan

A portable fork of the high-performance regular expression matching library
https://www.vectorcamp.gr/project/vectorscan/
Other
503 stars 54 forks source link

this might fix the crash we had in unit tests in some bsd/ppc environments. #301

Open isildur-g opened 3 months ago

isildur-g commented 3 months ago

(even with the rPATH fix gcc13/bsd/ppc remains broken because exceptions thrown are not being caught, investigation continues) however fixing that exposed a totally different segfault which is encountered apparently after a stl flat_set, decared on the stack directly after a small_colour_map is created (which contains among other things an stl vec of bytes) , is populated by an insert. After the insert the metadata (at least) of the vec in the colour map object, is corrupted, leading to it indicating a size of 64-bit -320 , or as it is unsigned , fffffffffffffec0 .. shortly after this we end up in a memset on that vec , using the size() of the vec to determine the size of the memset, and this of course segfaults. we have not yet discovered why this is clobbering it. the problem occurs on a rare occasion and the size of the flat_set is not out of the ordinary. Adding a guard buffer between the declaration of the colour_map and the flat_set 'fixes' the crash (and one can see the clobbering of the guard buffer if one looks) but more investigation is needed to determine the root cause of the corruption. So far it seems to be occurring from in the stl flat_set::insert() itself.