libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] dl_iterate_phdr deadlocks on x86_64


From: Stephen D. Bowline
Subject: [Libunwind-devel] dl_iterate_phdr deadlocks on x86_64
Date: Wed, 5 May 2010 18:26:49 -0700 (PDT)
User-agent: SquirrelMail/1.4.1

Platform: x86_64, RedHat 5, kernel 2.6.29

  I have a situation in which a callstack sampler is unwinding the stack
while a thread is in the midst of processing an exception.  This leads
to deadlocks because __cxa_throw_ is ultimately calling
dl_iterate_phdr() and so is the libunwind function
dwarf_find_proc_info().

  I built a git-from-head (today) libunwind with HAVE_DL_ITERATE_PHDR
#undef'd to hopefully get around this; however, the
dwarf_find_proc_info() function doesn't seem to respect that.

  Is there another approach to computing what dl_iterate_phdr() is doing, 
something I can graft into the dwarf_find_proc_info() function?

  I naively assumed that dl_iterate_phdr() was just for caching and I
could just do something like:

#if 0
  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &saved_mask);
  ret = dl_iterate_phdr (callback, &cb_data);
  SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL);

  if (ret <= 0)
    {
      Debug (14, "IP=0x%lx not found\n", (long) ip);
      return -UNW_ENOINFO;
    }

  if (cb_data.single_fde)
    /* already got the result in *pi */
    return 0;

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


  But that just leads to segfaults.


-stephen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]