From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Tomas Vondra <tv(at)fuzzy(dot)cz> |
Cc: | Andres Freund <andres(at)anarazel(dot)de>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-committers <pgsql-committers(at)postgresql(dot)org> |
Subject: | Re: pgsql: Generational memory allocator |
Date: | 2017-11-25 05:18:25 |
Message-ID: | 6189.1511587105@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Tomas Vondra <tv(at)fuzzy(dot)cz> writes:
> BTW I also see these failures in hstore:
> ==15168== Source and destination overlap in memcpy(0x5d0fed0, 0x5d0fed0, 40)
> ==15168== at 0x4C2E00C: memcpy@@GLIBC_2.14 (vg_replace_strmem.c:1018)
> ==15168== by 0x15419A06: hstoreUniquePairs (hstore_io.c:343)
> ==15168== by 0x15419EE4: hstore_in (hstore_io.c:416)
Huh ...
> Seems hstoreUniquePairs may call memcpy with the same pointers in some
> cases (which looks a bit dubious). But the code is ancient, so it's
> strange it didn't fail before.
Quite. It's easy to see how to avoid the nominally-undefined behavior:
- memcpy(res, ptr, sizeof(Pairs));
+ if (res != ptr)
+ memcpy(res, ptr, sizeof(Pairs));
but this should surely have been noticed by valgrind tests before.
The case doesn't necessarily occur --- if the first two items in
sorted order are dups, it won't --- but if you're seeing it occur
in regression testing then skink should have seen it as well.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2017-11-25 15:55:11 | pgsql: Avoid projecting tuples unnecessarily in Gather and Gather Merge |
Previous Message | Tomas Vondra | 2017-11-25 04:54:18 | Re: pgsql: Generational memory allocator |