On Fri, 11 Apr 2014 03:26:38 +0400, "Dmitry V. Levin" <[email protected]> wrote:
> On Thu, Apr 10, 2014 at 01:52:11AM +0900, Masatake YAMATO wrote:
>> Signed-off-by: Masatake YAMATO <[email protected]>
>> ---
>>  unwind.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/unwind.c b/unwind.c
>> index a7e985e..0f9f79d 100644
>> --- a/unwind.c
>> +++ b/unwind.c
>> @@ -130,6 +130,7 @@ build_mmap_cache(struct tcb *tcp)
>>      char filename[sizeof ("/proc/0123456789/maps")];
>>      char buffer[PATH_MAX + 80];
>>      char binary_path[PATH_MAX];
>> +    size_t blen;
>>      struct mmap_cache_t *cur_entry, *prev_entry;
>>      /* start with a small dynamically-allocated array and then expand it */
>>      size_t cur_array_size = 10;
>> @@ -162,6 +163,11 @@ build_mmap_cache(struct tcb *tcp)
>>              if (binary_path[0] == '\0')
>>                      continue;
>>  
>> +            /* ignore deleted file. */
>> +            blen = strlen(binary_path);
>> +            if (blen >= 10 && strcmp(binary_path + blen - 10, " (deleted)") 
>> == 0)
>> +                    continue;
>> +
> 
> First of all, please do not hardcode magic numbers.
> If you mean strlen("(deleted)"), just write it.

Rewrited using strlen.
[PATCH v4 11/37] unwind: report expected backtracing error
 
> Second, why deleted files should be excluded from stack trace?

It triggers printing the error message.  I guess it comes from the
limitation/specification of libunwind.

I wanted to hide it to avoid receiving bug reports. However, 
I recognize just hiding is bad idea. So in the new patch,
strace reports it as an "expected" error.

[PATCH v4 11/37] unwind: report expected backtracing error

Masatake YAMATO
 
> 
> -- 
> ldv

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to