From owner-svn-src-all@FreeBSD.ORG Thu Sep 6 20:03:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E17491065670; Thu, 6 Sep 2012 20:03:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (stark.strangled.net [174.136.100.2]) by mx1.freebsd.org (Postfix) with ESMTP id C697C8FC1A; Thu, 6 Sep 2012 20:03:07 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:6c92:3a9f:f4ca:fb77] (unknown [IPv6:2601:9:4d00:85:6c92:3a9f:f4ca:fb77]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id F0D7139827; Thu, 6 Sep 2012 13:03:00 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) From: Rui Paulo In-Reply-To: <20120906121513.GG1361@mole.fafoe.narf.at> Date: Thu, 6 Sep 2012 13:03:00 -0700 Content-Transfer-Encoding: 7bit Message-Id: <4C602B3A-9A6E-450C-B135-DE9A459D9053@FreeBSD.org> References: <201209060319.q863JnDe050504@svn.freebsd.org> <20120906121513.GG1361@mole.fafoe.narf.at> To: Stefan Farfeleder X-Mailer: Apple Mail (2.1486) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240156 - head/lib/libproc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 20:03:08 -0000 On 6 Sep 2012, at 05:15, Stefan Farfeleder wrote: > On Thu, Sep 06, 2012 at 03:19:49AM +0000, Rui Paulo wrote: >> @@ -266,7 +268,11 @@ proc_addr2sym(struct proc_handle *p, uin >> if (addr >= rsym && addr <= (rsym + sym.st_size)) { >> s = elf_strptr(e, dynsymstridx, sym.st_name); >> if (s) { >> - strlcpy(name, s, namesz); >> + if (strlen(s) > 2 && >> + s[0] == '_' && s[1] == 'Z') >> + __cxa_demangle(s, name, &namesz, NULL); >> + else >> + strlcpy(name, s, namesz); >> memcpy(symcopy, &sym, sizeof(sym)); >> /* >> * DTrace expects the st_value to contain > > According to the documentation, __cxa_demangle will realloc the buffer > if it is too small and return the new buffer. This case is not handled > correctly. You're right. In fact this happens all the time with libcxxrt. Thanks, -- Rui Paulo