From cb4a1047ceb873723a3b44e3777448d0138e815e Mon Sep 17 00:00:00 2001 From: David Xu Date: Mon, 6 Sep 2010 03:00:54 +0000 Subject: Fix off-by-one error in function _thr_sigact_unload, also disable the function, it seems some gnome application tends to crash if we unregister sigaction automatically. --- lib/libthr/thread/thr_sig.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index b6755f91be08..5067e646dcad 100644 --- a/lib/libthr/thread/thr_sig.c +++ b/lib/libthr/thread/thr_sig.c @@ -418,6 +418,7 @@ _thr_signal_init(void) void _thr_sigact_unload(struct dl_phdr_info *phdr_info) { +#if 0 struct pthread *curthread = _get_curthread(); struct urwlock *rwlp; struct sigaction *actp; @@ -426,13 +427,13 @@ _thr_sigact_unload(struct dl_phdr_info *phdr_info) int sig; _thr_signal_block(curthread); - for (sig = 1; sig < _SIG_MAXSIG; sig++) { - actp = &_thr_sigact[sig].sigact; + for (sig = 1; sig <= _SIG_MAXSIG; sig++) { + actp = &_thr_sigact[sig-1].sigact; retry: handler = actp->sa_handler; if (handler != SIG_DFL && handler != SIG_IGN && __elf_phdr_match_addr(phdr_info, handler)) { - rwlp = &_thr_sigact[sig].lock; + rwlp = &_thr_sigact[sig-1].lock; _thr_rwl_wrlock(rwlp); if (handler != actp->sa_handler) { _thr_rwl_unlock(rwlp); @@ -449,6 +450,7 @@ retry: } } _thr_signal_unblock(curthread); +#endif } void -- cgit v1.2.3