Re: "could not reattach to shared memory" on buildfarm member dory
Thomas Munro <thomas.munro@enterprisedb.com>
On Tue, May 1, 2018 at 2:59 PM, Noah Misch <noah@leadboat.com> wrote: > Likely some privileged daemon is creating a thread in every new process. (On > Windows, it's not unusual for one process to create a thread in another > process.) We don't have good control over that. Huh. I was already amazed (as a non-Windows user) by the DSM code that duplicates file handles into the postmaster process without its cooperation, but starting threads is even more amazing. Apparently debuggers do that. Could this be running in some kind of debugger-managed environment or build, perhaps as a result of some core dump capturing mode or something? https://msdn.microsoft.com/en-us/library/windows/desktop/dd405484(v=vs.85).aspx Apparently another way to mess with another process's memory map is via "Asynchronous Procedure Calls": http://blogs.microsoft.co.il/pavely/2017/03/14/injecting-a-dll-without-a-remote-thread/ It looks like that mechanism could allow something either in our own process (perhaps some timer-related thing that we might have set up ourselves or might be set up by the system?) or another process to queue actions for our own thread to run at certain points. https://msdn.microsoft.com/en-us/library/windows/desktop/ms681951(v=vs.85).aspx -- Thomas Munro http://www.enterprisedb.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