Bug#687582: alpine: deadlock in signal handler

2012-09-25 Thread Asheesh Laroia
Thank you for this excellent bug report. I've run into this issue before, 
and your diagnosis is very helpful!



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#687582: alpine: deadlock in signal handler

2012-09-13 Thread Geoffrey Thomas

Package: alpine
Version: 2.02-3

Noting this here, although it's an upstream bug and I'll submit it 
upstream soon. After disconnecting my machine from the network and leaving 
alpine open, it hung with the prompt "Waited 919 seconds for server reply. 
Break connection to server?" and the message "[MAIL FOLDER "INBOX" CLOSED 
DUE TO ACCESS ERROR]". gdb gives the following backtrace:


(gdb) bt
#0  __lll_lock_wait_private () at 
../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:97
#1  0x7f196507c30f in _L_lock_12013 () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x7f196507a3d8 in __libc_free (mem=0x7f196538d1c0) at malloc.c:3736
#3  0x7f196509c67d in tzset_internal (always=, 
explicit=) at tzset.c:435
#4  0x7f196509c9eb in __tz_convert (timer=0x7fffa8af59b8, use_localtime=1, 
tp=0x7f1965390f00) at tzset.c:624
#5  0x7f196509aad9 in ctime (t=) at ctime.c:32
#6  0x005ca3cc in debug_time (include_date=, 
include_subseconds=) at debugtime.c:63
#7  0x0054fda3 in add_review_message (message=, 
level=5) at help.c:362
#8  0x005d0612 in output_debug_msg (dlevel=5, fmt=0x66921c 
"end_signals(%d)\n") at debuging.c:323
#9  0x004ca2fb in end_signals (blockem=1) at signal.c:145
#10 0x004ca491 in auger_in_signal (sig=11) at signal.c:184
#11 
#12 0x7f196507565d in malloc_consolidate (av=0x7f196538d1c0) at 
malloc.c:5169
#13 0x7f1965076f72 in _int_malloc (av=0x7f196538d1c0, bytes=1296) at 
malloc.c:4373
#14 0x7f1965079e1e in __libc_malloc (bytes=1296) at malloc.c:3660
#15 0x005d9528 in fs_get (size=) at fs_unix.c:38
#16 0x00482bcf in update_index (state=0x1483040, screen=0x7fffa8af6340) 
at mailindx.c:1220
#17 0x004834d1 in index_lister (state=0x1483040, cntxt=0x14c7480, 
folder=0x1483129 "INBOX", stream=0x14ff860, msgmap=0x1521420) at  mailindx.c:452
#18 0x0042c095 in main (argc=1, argv=0x7fffa8af8e78) at   alpine.c:1331

According to signal(7), ctime is not safe to be called from a signal 
handler (nor, more generally, are malloc or free). Probably debug messages 
from signal handler context should not attempt to display the time, or 
should use some built-in time implementation that doesn't malloc or care 
about timezones, or something.


--
Geoffrey Thomas
http://ldpreload.com
geo...@ldpreload.com


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org