query, report https://gist.github.com/alesapin/c91d9ffd65471c4d8b595219a26a601a.
Full report
https://clickhouse-test-reports.s3.yandex.net/19412/cc2788af881c96701076b366259bc99525d926b1/fuzzer_asan/report.html#fail1
{
        if (years == 1)
            return toFirstDayNumOfYear(d);
        return years_lut[(lut[d].year - DATE_LUT_MIN_YEAR) / years * years];
    }
    inline DayNum toStartOfQuarterInterval(DayNum d, UInt64 quarters) const
    {
        if (quarters == 1)
            return toFirstDayNumOfQuarter(d);
        return toStartOfMonthInterval(d, quarters * 3);
    }
    inline DayNum toStartOfMonthInterval(DayNum d, UInt64 months) const
    {
        if (months == 1)
            return toFirstDayNumOfMonth(d);
        const auto & date = lut[d];
        UInt32 month_total_index = (date.year - DATE_LUT_MIN_YEAR) * 12 + date.month - 1;
        return years_months_lut[month_total_index / months * months];
    }
    inline DayNum toStartOfWeekInterval(DayNum d, UInt64 weeks) const
    {
        if (weeks == 1)
            return toFirstDayNumOfWeek(d);
        UInt64 days = weeks * 7;
        
        return DayNum(4 + (d - 4) / days * days);
    }
    inline time_t toStartOfDayInterval(DayNum d, UInt64 days) const