bugThe libunwind project - Bugs: bug #44269, Libunwind mempool memleak issue


bug #44269: Libunwind mempool memleak issue

Submitted by:  Shruti Shetty <shrushet>
Submitted on:  Mon 16 Feb 2015 06:59:30 AM UTC  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 16 Feb 2015 06:59:30 AM UTC, original submission:

We have integrated libunwind for all our Cisco enterprise boxes which runs on MIPS. libunwind is called at various instances: during a crash, cpuhog to generate a neat traceback on the console to isolate the root cause of the issue. We also hook libunwind to our error generating infra called from all the processes in the application and hence needed to stress test its behaviour.
We wrote a test code that creates around 20 threads and from each thread we continuously generate a traceback using libunwind.

We benchmarked libunwind mempool size and cache size and found that there is a memleak in libunwind mempool.

It can fail in fetch_proc_info and return back to the caller without freeing up the memory. This will result in pool objects being held beyond their lifetime which eventually exhausts the mempool and keeps expanding it, resulting in increasing the memory unboundedly.

The failure more specifically is in dwarf_search_unwind_table ( dwarf/Gfind_proc_info-lsb.c ) when it returns UNW_ENOINFO. This results in fetch_proc_info to return back to the caller without freeing up the allocated memory:

/* search the table: */
if (cb_data.di.format != -1)
ret = dwarf_search_unwind_table (as, ip, &cb_data.di,
pi, need_unwind_info, arg);

Are you aware of this issue?

I have a fix for this. Can I make this contribution?

I could reproduce this issue in X86 as well.

Shruti Shetty
Cisco Systems

Shruti Shetty <shrushet>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by shrushet (Submitted the item)
  • -email is unavailable- added by shrushet (Libunwind memleak issue)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-16 shrushet Carbon-Copy- => Added -email is unavailable-

    Back to the top

    Powered by Savane 3.3