pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: tvijlbrief@gmail.com, pgsql-bugs@lists.postgresql.org, Tomas Vondra <tomas.vondra@2ndquadrant.com>
Subject: Re: BUG #16694: Server hangs in 100% CPU loop when decompressing a specific TOAST Postgis linestring
Date: Mon, 02 Nov 2020 00:53:48 -0500
Message-ID: <595534.1604296428@sss.pgh.pa.us> (raw)
In-Reply-To: <727877DF-78F7-4C1E-B1A5-C0A97BF276CE@yandex-team.ru>
References: <16694-f107871e499ec114@postgresql.org>
	<543595.1604267856@sss.pgh.pa.us>
	<578150.1604274357@sss.pgh.pa.us>
	<A0C09497-3C7B-44E5-9224-CE86F7E87DBE@yandex-team.ru>
	<592336.1604294205@sss.pgh.pa.us>
	<727877DF-78F7-4C1E-B1A5-C0A97BF276CE@yandex-team.ru>

Andrey Borodin <x4mmm@yandex-team.ru> writes:
>> 2 нояб. 2020 г., в 10:16, Tom Lane <tgl@sss.pgh.pa.us> написал(а):
>> Yeah, I was wondering about that.  Not quite sure it's worth adding
>> cycles to defend against though.

> I think so too. That's why I was not protecting from corruption at all when proposing c60e520.
> Here we can have core dump too if *(srcend+1) produce SegFault:

Right.  The "sp > srcend" check that I added doesn't help if we
were unlucky enough to be right up against the end of memory.
I judged it was cheap enough to be worth including, but I'd
agree that's a judgment call.  Conversely, checking for "off"
being too far back would require tracking the distance back to
the start of the output buffer, which is a value the loop does
not keep ATM.  So that would require adding more cycles to track
(in addition to the actual comparison), which is why it seemed
not quite worth it.

			regards, tom lane





view thread (9+ messages)  latest in thread

Message-ID: <595534.1604296428@sss.pgh.pa.us>
Permalink:  ../595534.1604296428@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/595534.1604296428@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, x4mmm@yandex-team.ru, tomas.vondra@2ndquadrant.com
  Subject: Re: BUG #16694: Server hangs in 100% CPU loop when decompressing a specific TOAST Postgis linestring
  In-Reply-To: <595534.1604296428@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox