Piotr Stefaniak <postgres@piotr-stefaniak.me> writes:
> On the exact same note, something like this (again reduced from what 
> sqlsmith produced):
> leads to vardata.rel->tuples being zero here:
>     if (vardata.rel)
>         ndistinct *= vardata.rel->rows / vardata.rel->tuples;
Ugh.  That's a bit worse because it'll be 0/0, ie you get a NaN.
Thanks for the report.
        regards, tom lane