Re: BUG #17995: Segmentation fault caused by UPDATE statement

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: zuming(dot)jiang(at)inf(dot)ethz(dot)ch, pgsql-bugs(at)lists(dot)postgresql(dot)org, kyzevan23(at)mail(dot)ru
Subject: Re: BUG #17995: Segmentation fault caused by UPDATE statement
Date: 2023-06-26 05:00:01
Message-ID: 916440ee-5c84-abce-e2c8-562dc5775404@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

26.06.2023 07:27, Tom Lane wrote:
> I hadn't looked at the patch yet, but ... mcxt.c? How is that recursive?
> Even if there is some path that recurses through that, wouldn't the
> check be better placed in a less-hot part of the loop?

In that thread Egor Chindyaskin showed proofs for stack overflow in all the
functions, that the fixes were proposed for. For example:
#MemoryContextStatsInternal
(n=1000000; printf "BEGIN;"; for ((i=1;i<=$n;i++)); do printf "SAVEPOINT s$i;"; done; printf "SELECT
pg_log_backend_memory_contexts(pg_backend_pid())") | psql >/dev/null

Though maybe for some of those functions less-hot places could be found to
check the stack.

Best regards,
Alexander

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2023-06-26 06:49:05 Re: BUG #17997: Assert failed in validatePartitionedIndex() when attaching partition index to child of valid index
Previous Message Michael Paquier 2023-06-26 04:56:42 Re: BUG #17995: Segmentation fault caused by UPDATE statement