Re: [HACKERS] Tuple sort is broken. It crashes on simple test.

2017-01-16 Thread Pavel Stehule
2017-01-16 19:43 GMT+01:00 Peter Geoghegan : > On Mon, Jan 16, 2017 at 10:38 AM, Pavel Stehule > wrote: > > Should not be enhanced regress tests too? > > We already have coverage of multi-pass external tuplesorts, as of a > few months back. That didn't

Re: [HACKERS] Tuple sort is broken. It crashes on simple test.

2017-01-16 Thread Tom Lane
Peter Geoghegan writes: > The problem was that one particular call to the macro > RELEASE_SLAB_SLOT() happened to lack a test-for-NULL-argument needed > by pass-by-value datum cases. The other two RELEASE_SLAB_SLOT() calls > already have such a check. > Attached patch fixes the

Re: [HACKERS] Tuple sort is broken. It crashes on simple test.

2017-01-16 Thread Peter Geoghegan
On Mon, Jan 16, 2017 at 10:38 AM, Pavel Stehule wrote: > Should not be enhanced regress tests too? We already have coverage of multi-pass external tuplesorts, as of a few months back. That didn't catch this bug only because it was a pass-by-value datum tuplesort. The

Re: [HACKERS] Tuple sort is broken. It crashes on simple test.

2017-01-16 Thread Pavel Stehule
2017-01-16 19:24 GMT+01:00 Peter Geoghegan : > On Mon, Jan 16, 2017 at 3:48 AM, Michael Paquier > wrote: > > Indeed. It crashes for me immediately by adding an ORDER BY: > > select count(distinct t) from seq_tab order by 1; > > The problem was that one

Re: [HACKERS] Tuple sort is broken. It crashes on simple test.

2017-01-16 Thread Peter Geoghegan
On Mon, Jan 16, 2017 at 3:48 AM, Michael Paquier wrote: > Indeed. It crashes for me immediately by adding an ORDER BY: > select count(distinct t) from seq_tab order by 1; The problem was that one particular call to the macro RELEASE_SLAB_SLOT() happened to lack a

Re: [HACKERS] Tuple sort is broken. It crashes on simple test.

2017-01-16 Thread Michael Paquier
(Adding Peter in CC who also worked on that) On Mon, Jan 16, 2017 at 7:14 PM, Mithun Cy wrote: > Test: > -- > create table seq_tab(t int); > insert into seq_tab select generate_series(1, 1000); > select count(distinct t) from seq_tab; > > #0

[HACKERS] Tuple sort is broken. It crashes on simple test.

2017-01-16 Thread Mithun Cy
Test: -- create table seq_tab(t int); insert into seq_tab select generate_series(1, 1000); select count(distinct t) from seq_tab; #0 0x0094a9ad in pfree (pointer=0x0) at mcxt.c:1007 #1 0x00953be3 in mergeonerun (state=0x1611450) at tuplesort.c:2803 #2 0x00953824