[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] Re: [patch 2/2] Allow caller to block signals.
From: |
Arun Sharma |
Subject: |
[Libunwind-devel] Re: [patch 2/2] Allow caller to block signals. |
Date: |
Fri, 25 Sep 2009 10:29:54 -0700 |
After:
./configure --enable-block-signals=no
I get a hang in tests/test-async-sig. Could you please look at this failure?
-Arun
Program received signal SIGINT, Interrupt.
[Switching to Thread 0x7ff528b536f0 (LWP 20163)]
0x00007ff527f8fa94 in __lll_lock_wait () from /lib/libpthread.so.0
(gdb) bt
#0 0x00007ff527f8fa94 in __lll_lock_wait () from /lib/libpthread.so.0
#1 0x00007ff527f8b190 in _L_lock_102 () from /lib/libpthread.so.0
#2 0x00007ff527f8aa7e in pthread_mutex_lock () from /lib/libpthread.so.0
#3 0x00007ff528512280 in _UIx86_64__mempool_alloc (pool=0x7ff528728dc0)
at mi/mempool.c:151
#4 0x00007ff528513e5d in _ULx86_64_dwarf_extract_proc_info_from_fde (
as=0x7ff52871e200, a=<value optimized out>, addrp=<value optimized out>,
pi=0x7fff30b635f8, need_unwind_info=1, base=<value optimized out>,
arg=0x7fff30b63520) at dwarf/Gfde.c:332
#5 0x00007ff5285158a9 in _ULx86_64_dwarf_search_unwind_table (
as=<value optimized out>, ip=<value optimized out>, di=0x7fff30b62d88,
pi=0x7fff30b635f8, need_unwind_info=1, arg=0x7fff30b63520)
at dwarf/Gfind_proc_info-lsb.c:911
#6 0x00007ff528515a4b in _ULx86_64_dwarf_find_proc_info (as=0x7ff52871e200,
ip=4197470, pi=0x7fff30b635f8, need_unwind_info=1, arg=0x7fff30b63520)
at dwarf/Gfind_proc_info-lsb.c:747
#7 0x00007ff528514104 in fetch_proc_info (c=0x7fff30b63520, ip=4197470,
need_unwind_info=1) at dwarf/Gparser.c:397
#8 0x00007ff528514fa0 in _ULx86_64_dwarf_find_save_locs (c=0x7ff528728dc0)
at dwarf/Gparser.c:767
#9 0x00007ff528515709 in _ULx86_64_dwarf_step (c=0x7ff528728dc0)
at dwarf/Gstep.c:35
#10 0x00007ff528517a05 in _ULx86_64_step (cursor=0x7ff528728dc0)
---Type <return> to continue, or q <return> to quit---
at x86_64/Gstep.c:42
#11 0x0000000000400d80 in do_backtrace (may_print=1, get_proc_name=1)
at test-async-sig.c:91
#12 0x0000000000400f01 in sighandler (signal=<value optimized out>)
at test-async-sig.c:113
#13 <signal handler called>
#14 0x00007ff5282925d6 in pthread_mutex_unlock () from /lib/libc.so.6
#15 0x00007ff528514fff in _ULx86_64_dwarf_find_save_locs (c=0x7fff30b64aa0)
at dwarf/Gparser.c:427
#16 0x00007ff528515709 in _ULx86_64_dwarf_step (c=0x7ff528728dc0)
at dwarf/Gstep.c:35
#17 0x00007ff528517a05 in _ULx86_64_step (cursor=0x7ff528728dc0)
at x86_64/Gstep.c:42
#18 0x0000000000400d80 in do_backtrace (may_print=0, get_proc_name=0)
at test-async-sig.c:91
#19 0x00000000004010bf in main (argc=<value optimized out>,
argv=<value optimized out>) at test-async-sig.c:159
On Mon, Sep 21, 2009 at 1:04 PM, Paul Pluzhnikov <address@hidden> wrote:
> Greetings,
>
> Here is the second part, actually implementing the configure option.
>
> Thanks,
> --
> Paul Pluzhnikov
>
>
> commit cf823ed0d4d2447aa91af0e3cb5fbb6a6cba5068
> Author: Paul Pluzhnikov <address@hidden>
> Date: Mon Sep 21 11:37:38 2009 -0700
>
> New configure option to allow caller to block signals.
>
> diff --git a/configure.in b/configure.in
> index 1271a56..6e55563 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -139,6 +139,14 @@ if test x$enable_debug_frame = xyes; then
> AC_DEFINE([CONFIG_DEBUG_FRAME], [], [Enable Debug Frame])
> fi
>
> +AC_ARG_ENABLE(block_signals,
> +[ --enable-block-signals Block signals before performing mutex operations],
> +[enable_block_signals=$enableval], [enable_block_signals=yes])
> +if test x$enable_block_signals = xyes; then
> + AC_DEFINE([CONFIG_BLOCK_SIGNALS], [], [Block signals before mutex
> operations])
> +fi
> +
> +
> LIBUNWIND___THREAD
>
> save_LDFLAGS="$LDFLAGS"
> diff --git a/include/libunwind_i.h b/include/libunwind_i.h
> index 333ee37..a818601 100644
> --- a/include/libunwind_i.h
> +++ b/include/libunwind_i.h
> @@ -178,18 +178,25 @@ typedef sigset_t intrmask_t;
>
> extern intrmask_t unwi_full_mask;
>
> +#if defined(CONFIG_BLOCK_SIGNALS)
> +# define SIGPROCMASK(how, old_mask, new_mask) \
> + sigprocmask((how), (old_mask), (new_mask))
> +#else
> +# define SIGPROCMASK(how, old_mask, new_mask) /**/
> +#endif
> +
> #define define_lock(name) \
> pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER
> #define lock_init(l) mutex_init (l)
> #define lock_acquire(l,m) \
> do { \
> - sigprocmask (SIG_SETMASK, &unwi_full_mask, &(m)); \
> + SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m)); \
> mutex_lock (l); \
> } while (0)
> #define lock_release(l,m) \
> do { \
> mutex_unlock (l); \
> - sigprocmask (SIG_SETMASK, &(m), NULL); \
> + SIGPROCMASK (SIG_SETMASK, &(m), NULL); \
> } while (0)
>
> #define SOS_MEMORY_SIZE 16384 /* see src/mi/mempool.c */
>
- [Libunwind-devel] [patch 2/2] Allow caller to block signals., Paul Pluzhnikov, 2009/09/21
- [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals.,
Arun Sharma <=
- [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals., Paul Pluzhnikov, 2009/09/25
- [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals., Arun Sharma, 2009/09/25
- [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals., Paul Pluzhnikov, 2009/09/25
- Re: [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals., Mark Rabkin, 2009/09/25
- Re: [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals., Paul Pluzhnikov, 2009/09/25
- Re: [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals., Mark Rabkin, 2009/09/25
- Re: [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals., Arun Sharma, 2009/09/25
- Re: [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals., Paul Pluzhnikov, 2009/09/25
- Re: [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals., Arun Sharma, 2009/09/25
- Re: [Libunwind-devel] Re: [patch 2/2] Allow caller to block signals., Arun Sharma, 2009/09/25