helpThe libunwind project - Support: sr #108985, libunwind used in signal handler...


sr #108985: libunwind used in signal handler for multi-threading program

Submitted by:  None
Submitted on:  Thu 25 Feb 2016 10:40:22 PM UTC  
Category:  None Priority:  5 - Normal
Severity:  4 - Important Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

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


Thu 25 Feb 2016 10:40:22 PM UTC, original submission:


I'm having a problem with libunwind used in signal handler for multi-threading program.

In my program, a handler is called after a certain amount of CPU cycles(use PAPI_overflow). And the program is multi-threading. So In the handler, I did this:

unw_cursor_t cursor;
unw_word_t ip, sp;
unw_context_t uc;

int count=0;

unw_getcontext (&uc);
if (unw_init_local (&cursor, &uc) < 0)
fprintf (stderr,"unw_init_local failed!\n");

while (unw_step(&cursor)>0) {
unw_get_reg (&cursor, UNW_REG_IP, &ip);
unw_get_reg (&cursor, UNW_REG_SP, &sp);
printf("%d 0x%lx\n", count, (unsigned long) ip);

This works fine for single-thread programs, and also works for small muli-thread program, but when I tested lulesh multi-theading program, the hanlder would go into a infinite loop, it looks like the handler was kept invoked infinitely...Am I using libunwind right ? what should be specifically done for multi-threads ?




(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 None (Submitted the item)

    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.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.3