[PATCH 2/2] Cygwin: fork: Remember child not before success.

2019-04-30 Thread Michael Haubenwallner
Do not remember the child before it was successfully initialized, or we would need more sophisticated cleanup on child initialization failure, like cleaning up the process table and suppressing SIGCHILD delivery with multiple threads ("waitproc") involved. --- winsup/cygwin/fork.cc | 33 ++

[PATCH 1/2] Cygwin: fork: Always pause child after fixups.

2019-04-30 Thread Michael Haubenwallner
Pause the child process after performing fork fixups even if there were no dynamically loaded dlls with extra data/bss transfers to wait for. This allows the parent process to cancel the current fork call even if the child process was successfully initialized already. This is a preparation for whe

[PATCH 1/3] Cygwin: dll_list: drop FILE_BASIC_INFORMATION

2019-04-30 Thread Michael Haubenwallner
Querying FILE_BASIC_INFORMATION is needless since using win pid+threadid for forkables dirname rather than newest last write time. --- winsup/cygwin/dll_init.cc | 1 - winsup/cygwin/dll_init.h | 1 - winsup/cygwin/forkable.cc | 7 +++ 3 files changed, 3 insertions(+), 6 deletions(-) diff --g

[PATCH 2/3] Cygwin: dll_list: stat_real_file_once as dll method

2019-04-30 Thread Michael Haubenwallner
Make stat_real_file_once a method of struct dll, to be more flexible on where to use. Also, debug print memory section name queried for a dll. This is a preparation to query the file id when loading the dll. --- winsup/cygwin/dll_init.h | 1 + winsup/cygwin/forkable.cc | 22

[PATCH 3/3] Cygwin: dll_list: query dll file id at load time

2019-04-30 Thread Michael Haubenwallner
NtQueryVirtualMemory for MemorySectionName does not reliable return the changed dll file name when another process does move the file around, and we may end up creating forkable hardlinks to wrong dll files. So query the file id when loading the dll rather than before fork. --- winsup/cygwin/dll_i

Re: [PATCH 2/2] Cygwin: fork: Remember child not before success.

2019-04-30 Thread Corinna Vinschen
Hi Michael, On Apr 30 09:09, Michael Haubenwallner wrote: > Do not remember the child before it was successfully initialized, or we > would need more sophisticated cleanup on child initialization failure, > like cleaning up the process table and suppressing SIGCHILD delivery > with multiple thread

Re: [PATCH 1/3] Cygwin: dll_list: drop FILE_BASIC_INFORMATION

2019-04-30 Thread Corinna Vinschen
On Apr 30 16:14, Michael Haubenwallner wrote: > Querying FILE_BASIC_INFORMATION is needless since using win pid+threadid > for forkables dirname rather than newest last write time. > --- > winsup/cygwin/dll_init.cc | 1 - > winsup/cygwin/dll_init.h | 1 - > winsup/cygwin/forkable.cc | 7 +++ >

Re: [PATCH 1/3] Cygwin: dll_list: drop FILE_BASIC_INFORMATION

2019-04-30 Thread Corinna Vinschen
On Apr 30 18:13, Corinna Vinschen wrote: > On Apr 30 16:14, Michael Haubenwallner wrote: > > Querying FILE_BASIC_INFORMATION is needless since using win pid+threadid > > for forkables dirname rather than newest last write time. > > --- > > winsup/cygwin/dll_init.cc | 1 - > > winsup/cygwin/dll_ini