Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2012 13:03:00 -0700
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        Stefan Farfeleder <stefanf@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r240156 - head/lib/libproc
Message-ID:  <4C602B3A-9A6E-450C-B135-DE9A459D9053@FreeBSD.org>
In-Reply-To: <20120906121513.GG1361@mole.fafoe.narf.at>
References:  <201209060319.q863JnDe050504@svn.freebsd.org> <20120906121513.GG1361@mole.fafoe.narf.at>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6 Sep 2012, at 05:15, Stefan Farfeleder <stefanf@freebsd.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C602B3A-9A6E-450C-B135-DE9A459D9053>