[runtime] When looking up the process name, don't bail out if you can't load its...
authorRodrigo Kumpera <kumpera@gmail.com>
Thu, 16 Mar 2017 18:30:43 +0000 (11:30 -0700)
committerRodrigo Kumpera <kumpera@gmail.com>
Wed, 5 Apr 2017 21:18:25 +0000 (14:18 -0700)
Loading modules for other processes can fail under some linux sandboxing rules but that doesn't mean
we should not be able to compute the process name. So when module == NULL, we make module loading non-fatal.

mono/metadata/w32process-unix.c

index 8f1cc374c26b88e065dbe5318fde1089d7e0bdcf..475112d39c7b0af0e8983e1946158f72b9d4a573 100644 (file)
@@ -1215,7 +1215,8 @@ mono_w32process_module_get_name (gpointer process, gpointer module, gunichar2 *b
        pname = g_strdup (process_handle->pname);
 
        mods = mono_w32process_get_modules (pid);
-       if (!mods) {
+       if (!mods && module != NULL) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't get modules %p", __func__, process);
                g_free (pname);
                return 0;
        }