svn commit: r240156 - head/lib/libproc

Rui Paulo rpaulo at FreeBSD.org
Thu Sep 6 20:03:08 UTC 2012


On 6 Sep 2012, at 05:15, Stefan Farfeleder <stefanf at 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



More information about the svn-src-all mailing list