Re: "could not reattach to shared memory" on buildfarm member dory
Noah Misch <noah@leadboat.com>
On Tue, Apr 24, 2018 at 11:37:33AM +1200, Thomas Munro wrote: > On Tue, Apr 24, 2018 at 11:18 AM, Stephen Frost <sfrost@snowman.net> wrote: > > Greetings, > > > > * Tom Lane (tgl@sss.pgh.pa.us) wrote: > >> So far, dory has failed three times with essentially identical symptoms: > >> > >> 2018-04-23 19:57:10.624 GMT [2240] FATAL: could not reattach to shared memory (key=0000000000000190, addr=00000000018E0000): error code 487 > >> 2018-04-23 15:57:10.657 EDT [8836] ERROR: lost connection to parallel worker > >> 2018-04-23 15:57:10.657 EDT [8836] STATEMENT: select count(*) from tenk1 group by twenty; > >> 2018-04-23 15:57:10.660 EDT [3820] LOG: background worker "parallel worker" (PID 2240) exited with exit code 1 > >> > >> Now how can this be? We've successfully reserved and released the address > >> range we want to use, so it *should* be free at the instant we try to map. > > > > Yeah, that's definitely interesting. > > I wondered if another thread with the right timing could map something > between the VirtualFree() and MapViewOfFileEx() calls, but we don't > create the Windows signal handling thread until a bit later. Could > there be any any other threads active in the process? > > Maybe try asking what's mapped there with VirtualQueryEx() on failure? +1. An implementation of that: https://www.postgresql.org/message-id/20170403065106.GA2624300%40tornado.leadboat.com
Commits
-
Avoid "could not reattach" by providing space for concurrent allocation.
- 203886d3ae22 9.4.22 landed
- f5989b379cef 10.8 landed
- 7a5677818556 9.5.17 landed
- 57ebbbb8f15a 9.6.13 landed
- e45a8ff87149 11.3 landed
- 617dc6d299c9 12.0 landed
-
Assert that pgwin32_signal_initialize() has been called early enough.
- ab9ed9be2378 12.0 landed
-
Remove investigative code for can't-reattach-to-shared-memory errors.
- bcbf2346d69f 11.0 landed
-
Does it help to wait before reattaching?
- 23078689a992 11.0 landed
-
Map and unmap the shared memory block before risking VirtualFree.
- 73042b8d136f 11.0 landed
-
Further effort at preventing memory map dump from affecting the results.
- ce07aff48f15 11.0 landed
-
Remove Windows module-list-dumping code.
- f7df8043f08a 11.0 landed
-
Dump full memory maps around failing Windows reattach code.
- 6ba0cc4bd3a6 11.0 landed
-
Get still more info about Windows can't-reattach-to-shared-memory errors.
- eb16011f4c08 11.0 landed
-
Get more info about Windows can't-reattach-to-shared-memory errors.
- 68e7e973d222 11.0 landed
-
Try to get some info about Windows can't-reattach-to-shared-memory errors.
- 63ca350ef9f5 11.0 landed