Print this page
4159 dtrace ignores all ustack helper frames from dead processes
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

@@ -1379,12 +1379,12 @@
                         } else {
                                 (void) snprintf(c, sizeof (c),
                                     "%s`%s", dt_basename(objname), name);
                         }
                 } else if (str != NULL && str[0] != '\0' && str[0] != '@' &&
-                    (P != NULL && ((map = Paddr_to_map(P, pc[i])) == NULL ||
-                    (map->pr_mflags & MA_WRITE)))) {
+                    (P == NULL || (map = Paddr_to_map(P, pc[i])) == NULL ||
+                    map->pr_mflags & MA_WRITE)) {
                         /*
                          * If the current string pointer in the string table
                          * does not point to an empty string _and_ the program
                          * counter falls in a writable region, we'll use the
                          * string from the string table instead of the raw

@@ -1392,11 +1392,14 @@
                          * some (broken) ustack helpers will return a string
                          * even for a program counter that they can't
                          * identify.  If we have a string for a program
                          * counter that falls in a segment that isn't
                          * writable, we assume that we have fallen into this
-                         * case and we refuse to use the string.
+                         * case and we refuse to use the string.  Finally,
+                         * note that if we could not grab the process (e.g.,
+                         * because it exited), the information from the helper
+                         * is better than nothing.
                          */
                         (void) snprintf(c, sizeof (c), "%s", str);
                 } else {
                         if (P != NULL && Pobjname(P, pc[i], objname,
                             sizeof (objname)) != NULL) {