Re: "could not reattach to shared memory" on buildfarm member dory
Craig Ringer <craig@2ndquadrant.com>
On 24 April 2018 at 15:18, Magnus Hagander <magnus@hagander.net> wrote: > Back when I was combating windows AV on a daily basis, this normally did not > have the same effect. Just disabling the AV didn't actually remove the parts > that caused issues, it just hid them. Actual uninstall is what was required. Yep. Specifically, they tended to inject kernel hooks and/or load hook DLLs that did funky and often flakey things. Often with poor awareness of things like multiple processes opening one file for write at the same time. I think I heard that MS has cleaned up the situation with AV considerably by offering more kernel infrastructure for it, and restricting what you can do in terms of kernel extensions etc. But I don't know how much. In any case, do you think dropping a minidump at the point of failure might be informative? It should contain the full memory mapping information. For this purpose we could just create a crashdumps/ directory then abort() when we detect the error, and have the buildfarm stop processing until someone can grab the tempdir with the dumps, binaries, .pdb files, etc. src/backend/port/win32/crashdump.c doesn't expose a helper function to do all the dbghelp.dll messing around and create a crashdump, it only allows that to be done via a crash handler. But it might make sense to break out the actual "write a crash dump" part to a separately callable function. I've looked at doing this before, but always got stuck with the apparent lack of support in gdb or lldb to be used as a library for self-dumping. You can always shell out to gcore I guess... but ew. Or we can fork() and abort() the forked child like https://github.com/RuntimeTools/gencore does, but again, ew. I was thinking that maybe the buildfarm could just create crashdumps/ automatically, but then we'd need to have support infrastructure for recording the Pg binaries and .pdb files along with the dumps, rotating them so we don't run out of space, etc etc. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
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