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: NonePriority: 5 - Normal
Severity: 4 - ImportantStatus: None
Privacy: PublicAssigned to: None
Originator Email: -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 File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by None (Submitted the item)

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

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    No Changes Have Been Made to This Item

    Back to the top

    Powered by Savane 3.1-cleanup1