On Fri, Jul 1, 2016 at 12:10 PM, Robert Haas <robertmh...@gmail.com> wrote: >> I could give you steps to reproduce the bug, but they involve creating >> a large table using my gensort tool . It isn't trivial. Are you >> interested? > > The bug can't very well be so simple that you need not include a set > of steps to reproduce it and, at the same time, so complex that even > so much as reading the list of steps to reproduce it might be more > than I want to do.
Reading and following are two different things. I don't think reading alone will do much good with the following steps, but here they are: Checkout my gensort tool from github. Build the C tool with "make". Then, from the working directory: ./postgres_load.py -m 250 --skew --logged psql -c "CREATE INDEX segfaults on sort_test_skew(sortkey);" psql -c "CLUSTER sort_test_skew USING segfaults;" That test case isn't at all minimal, but that's how I happened upon the bug. I didn't tell you this before now because I assumed that you'd just accept that there was an omission made based on a quick reading of the code. This is not a complicated bug; the pointer HeapTuple.t_data needs to be updated when tuples are moved around in memory, but isn't. readtup_cluster() initializes that field like this: /* Reconstruct the HeapTupleData header */ tuple->t_data = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE); More or less the same process needs to occur following any movement of the tuple. Whereas, in all other cases there is no need to do something similar, as it happens. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers