Re: BUG #16191: Errors of division by zero occur in several files.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: starbugs(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16191: Errors of division by zero occur in several files.
Date: 2020-01-06 05:26:36
Message-ID: 20200106052636.GN3598@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jan 06, 2020 at 04:00:17AM +0000, PG Bug reporting form wrote:
> We checked the codes in files “xlogreader.c”, “xlog.c”, “xlogutils.c”,
> “xlogarchive.c”, “walsender.c”, “parsexlog.c”, “pg_rewind.c”,
> “pg_resetwal.c”, “pg_waldump.c” and “receivelog.c”, and found 20 errors
> caused by the zero value used in division. There are five errors in file
> “xlogreader.c” occurring in lines 755, 769, 819, 839 and 864 and the codes
> of these five lines are the same: “XLogFileName(fname,
> state->readPageTLI, segno, state->wal_segment_size);”.
> The program should check the effectiveness (not zero) of the return value of
> function “XLogSegmentsPerXLogId” in file “xlog_internal.h” to avoid this
> type of errors.

Reading the code is one thing. Understanding it is another. Have you
actually read the code and did you notice the assumptions behind the
ranges allowed by wal_segment_size (as known as WalSegMinSize and
WalSegMaxSize defined in xlog_internal.h)?
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Fahar Abbas 2020-01-06 05:49:38 Re: postgresql mac operation issue 10.11
Previous Message Michael Paquier 2020-01-06 05:18:00 Re: BUG #16190: The usage of NULL pointer in refint.c