changeset 49360:30f39453f0a8

8193429: "assert(false) failed: GetModuleFileName failed (126)" in symbolengine.cpp Reviewed-by: clanger, gtriantafill
author stuefe
date Tue, 06 Mar 2018 08:16:45 +0100
parents c6f2f91a1b4e
children 5043644f817f
files src/hotspot/os/windows/symbolengine.cpp
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/os/windows/symbolengine.cpp	Wed Mar 07 09:32:46 2018 -0500
+++ b/src/hotspot/os/windows/symbolengine.cpp	Tue Mar 06 08:16:45 2018 +0100
@@ -375,10 +375,10 @@
     const int len_returned = (int)::GetModuleFileName(hMod, filebuffer, (DWORD)file_buffer_capacity);
     DEBUG_ONLY(g_buffers.dir_name.check();)
     if (len_returned == 0) {
-      // Error. This is suspicious - this may happen if a module has just been
-      // unloaded concurrently after our call to EnumProcessModules and
-      // GetModuleFileName, but probably just indicates a coding error.
-      assert(false, "GetModuleFileName failed (%u)", ::GetLastError());
+      // This may happen when a module gets unloaded after our call to EnumProcessModules.
+      // It should be rare but may sporadically happen. Just ignore and continue with the
+      // next module.
+      continue;
     } else if (len_returned == file_buffer_capacity) {
       // Truncation. Just skip this module and continue with the next module.
       continue;