From 8f68126c6dc4f2178929233f0c7ccce877e973ca Mon Sep 17 00:00:00 2001 From: Bryan Cantrill Date: Thu, 28 Feb 2013 07:21:34 +0000 Subject: 3918 "pargs -l" dies on incomplete core dumps 3919 mdb/pmap should show unresolved map names on core dumps 3920 executable mapping in core dump misreported when file isn't found 3921 Pfindexec() finds wrong binary, wreaking havoc Reviewed by: Robert Mustacchi Reviewed by: Eric Schrock Approved by: Dan McDonald --- usr/src/lib/libproc/common/Pzone.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'usr/src/lib/libproc/common/Pzone.c') diff --git a/usr/src/lib/libproc/common/Pzone.c b/usr/src/lib/libproc/common/Pzone.c index c478b41624..68efea7a72 100644 --- a/usr/src/lib/libproc/common/Pzone.c +++ b/usr/src/lib/libproc/common/Pzone.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ #include #include @@ -792,9 +795,10 @@ Pfindmap(struct ps_prochandle *P, map_info_t *mptr, char *s, size_t n) (strcmp(mptr->map_pmap.pr_mapname, "a.out") == 0) || ((fptr != NULL) && (fptr->file_lname != NULL) && (strcmp(fptr->file_lname, "a.out") == 0))) { - (void) Pexecname(P, buf, sizeof (buf)); - (void) strlcpy(s, buf, n); - return (s); + if (Pexecname(P, buf, sizeof (buf)) != NULL) { + (void) strlcpy(s, buf, n); + return (s); + } } /* Try /proc first to get the real object name */ -- cgit v1.2.3