On Thu, Feb 18, 2010 at 9:13 AM, Humberto Abdelnur <
[email protected]> wrote:
>
> After digging into the libunwind code I found that the problem was in the
> file src/os-linux.h at line 269
>
> if (!cp)
> continue;
> cp = scan_string (cp, NULL, 0);
> if (!cp || dash != '-' || colon != ':')
> continue;
> since scan_string with buf_size 0 always returns 0. So for me it does not
> make sense, does it?
> So, i removed and it works well afterwards.
>
The code is trying to parse a string of the format:
/* scan: "LOW-HIGH PERM OFFSET MAJOR:MINOR INUM PATH" */
Is it possible that your version of Linux has a special /proc/pid/maps that
the code doesn't understand?
$ cat /proc/13930/maps
00400000-004be000 r-xp 00000000 08:01 565300
/bin/bash
I think that line of code is trying to skip over the path (/bin/bash) in
this example and position cp to the first character after the path.
Re: memory leak
I was able to reproduce your problem. But I thought it was caused by mapping
the target elf image too many times, rather than the mmaps called by
mempool_init().
src/ptrace/_UPT_find_proc_info.c:get_unwind_info() has a call to munmap, but
it doesn't seem to be working well (i.e. there is a leak somewhere).
The reason why libunwind has its own memory allocator is that it could be
used to implement a heap profiler. So libunwind can't call malloc directly.
-Arun
_______________________________________________
Libunwind-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/libunwind-devel