Re: BUG #19438: segfault with temp_file_limit inside cursor
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: kuzmin.db4@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2026-03-30T00:34:48Z
Lists: pgsql-bugs
David Rowley <dgrowleyml@gmail.com> writes: > On Mon, 30 Mar 2026 at 12:51, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Seems like a reasonable answer. What do you think of making the >> double-free cases ERRORs across the board? If we don't error out, >> there will likely be cascading problems in all the mcxt types not >> just this one. > I think it's a good idea. It might slightly increase the chances that > we get a report about an issue. I suppose the logic in deciding which > elevel to make it could be applied about equally to the sentinel byte > check as well. Maybe that should also be an error for the same reason. I thought about that, but it's been a WARNING for a long time and I'm hesitant to change that. We've seen many cases where scribbling one or two bytes past the end of the requested size doesn't actually cause fatal problems, because that was padding or unused space anyway. Double frees are in a different category: if we let one happen, it's pretty much guaranteed to cause hard-to-decipher problems down the road. (The fact that that didn't happen in the particular case reported here doesn't mean it's usually okay.) regards, tom lane
Commits
-
Be more careful to preserve consistency of a tuplestore.
- 739477345036 19 (unreleased) landed
- adb7873bb933 18.4 landed
- 811f3263a48d 15.18 landed
- 7cd23aad2a7a 14.23 landed
- 59c139d53be3 16.14 landed
- 1f5b6a5e5d74 17.10 landed
-
Detect pfree or repalloc of a previously-freed memory chunk.
- a26ac902f662 16.14 landed
- 3f3eefc28892 18.4 landed
- 0c8b4e9cfc45 17.10 landed
- 095555daf124 19 (unreleased) landed
-
Improve performance of and reduce overheads of memory management
- c6e0fe1f2a08 16.0 cited