initdb fails under bleeding-edge valgrind

Поиск
Список
Период
Сортировка
От Tom Lane
Тема initdb fails under bleeding-edge valgrind
Дата
Msg-id 161790.1608310142@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
With valgrind 3.16.1, we fail to get through initdb:

==00:00:00:41.608 11346== Source and destination overlap in memcpy(0xc190a8, 0xc190a8, 512)
==00:00:00:41.609 11346==    at 0x486C674: __GI_memcpy (vg_replace_strmem.c:1035)
==00:00:00:41.609 11346==    by 0x9017DB: write_relmap_file (relmapper.c:932)
==00:00:00:41.609 11346==    by 0x90243B: RelationMapFinishBootstrap (relmapper.c:571)
==00:00:00:41.609 11346==    by 0x551083: BootstrapModeMain (bootstrap.c:530)
==00:00:00:41.609 11346==    by 0x551083: AuxiliaryProcessMain (bootstrap.c:436)
==00:00:00:41.609 11346==    by 0x483E8F: main (main.c:201)
==00:00:00:41.609 11346==
==00:00:00:41.615 11346== Source and destination overlap in memcpy(0xc192a8, 0xc192a8, 512)
==00:00:00:41.615 11346==    at 0x486C674: __GI_memcpy (vg_replace_strmem.c:1035)
==00:00:00:41.615 11346==    by 0x9017DB: write_relmap_file (relmapper.c:932)
==00:00:00:41.615 11346==    by 0x551083: BootstrapModeMain (bootstrap.c:530)
==00:00:00:41.615 11346==    by 0x551083: AuxiliaryProcessMain (bootstrap.c:436)
==00:00:00:41.615 11346==    by 0x483E8F: main (main.c:201)
==00:00:00:41.615 11346==

I'm a bit surprised that we've not seen other complaints from picky
memcpy implementations, because this code path definitely is passing
the same source and destination pointers.

Evidently we need something like this in write_relmap_file:

    /* Success, update permanent copy */
-    memcpy(realmap, newmap, sizeof(RelMapFile));
+    if (realmap != newmap)
+        memcpy(realmap, newmap, sizeof(RelMapFile));

Or possibly it'd be cleaner to have RelationMapFinishBootstrap
supply a local RelMapFile variable to construct the mappings in.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Drouvot, Bertrand"
Дата:
Сообщение: Re: Deadlock between backend and recovery may not be detected
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Proposed patch for key managment