[m-rev.] for review: suppress Mantis bug #516

Julien Fischer jfischer at opturion.com
Sat Aug 8 03:36:34 AEST 2020


On Fri, 7 Aug 2020, Zoltan Somogyi wrote:

> Fix a compiler abort when looking up invalid proc.
> 
> compiler/passes_aux.m:
>     The bug that this diff "fixes", Mantis bug #516, surfaced when
>     in an earlier change, I "fixed" an inconsistency in passes_aux.m,
>     which was that the names of many predicate said that they iterated
>     over *all* procedures, but actually they iterated over only the *valid*
>     procedures. The fix was to iterate over all the procedures.
>
>     As it happens, in the rare circumstances represented by Mantis #516,
>     this can lead a compiler pass in the middle end (loop_inv.m)
>     processing an invalid procedure, whose invalid contents unsurprisingly
>     caused the abort. I thought such procedures should never be kept
>     in the HLDS once the front end has done its job, but I was wrong.
>
>     This diff restores the "status quo ante" by once again iterating over
>     only the valid procedures, but fixes the inconsistency in another way:
>     by making the names of the affected predicates to reflect this fact.
> 
> compiler/modes.m:
>     The actual root cause of Mantis #516 lies *not* in passes_aux.m,
>     but here, since it is modes.m that leaves the invalid procedure
>     in the HLDS. Document both the scenario that caused Mantis #516,
>     and which now causes only some overhead and another performance problem.
>     And document a probable correctness problem that this diff *does not* fix,
>     for two reasons. First, the fix would require rewriting most or all
>     of the mode inference mechanism; second, since we haven't bumped into it
>     by now, we probably never will. (At least those of us who always declare
>     the modes of all predicates.)

That's fine.

Julien.


More information about the reviews mailing list