Tomas Vondra <t...@fuzzy.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