From 6c9ad75a4bd40e9d72a109d17cc9fe6cc754af08 Mon Sep 17 00:00:00 2001 From: Michael Haubenwallner Date: Fri, 3 May 2019 16:14:14 +0200 Subject: Cygwin: dll_list: stat_real_file_once with ntname NtQueryVirtualMemory for MemorySectionName may return some old path even if the process was just started, for when some directory in between was renamed - maybe because the NT file cache is hot for the old path still. This was seen during gcc bootstrap, returning a MemorySectionName of ".../gcc/xgcc.exe" even if started as ".../prev-gcc/xgcc.exe", where the directory rename from "gcc" to "prev-gcc" was done the moment before. As we stat the module's real file right after loading now, there is no point in using NtQueryVirtualMemory with MemorySectionName any more, and we can use what GetModuleFileName returned instead. --- winsup/cygwin/dll_init.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'winsup/cygwin/dll_init.cc') diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index 4ba1bd22d..6a4ed269e 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -381,7 +381,7 @@ dll_list::alloc (HINSTANCE h, per_process *p, dll_type type) *d->forkable_ntname = L'\0'; } if (forkables_supported ()) - d->stat_real_file_once (); /* uses nt_max_path_buf () */ + d->stat_real_file_once (); append (d); if (type == DLL_LOAD) loaded_dlls++; -- cgit v1.2.3