#17 re-alpine 2.02 on debian 64bit crashes on broken IMAP connec


Recently, I observe some problems with alpine running in bash in a gnome terminal window. Occasionally, I see wrongly interpreted control characters in the message list, and in the last week the whole terminal window folded several times while composing a mail which is really nasty because it always seem to happen after entering sufficient text to be a nuisance when wiped out and never leaves a trace of anything I wrote. The trouble seems to start when alpine sends some status message to the open pico editor window, and after redrawing the window with CTRL-L and typing away a bit more the terminal window simply folds while typing.
Since it takes the shell and everything with it, I guess this is not really a bug in alpine, but a bug in gnome-terminal that reacts a bit allergic to some control sequence used when displaying status messages. I am not really sure were to start to pinpoint the exact reason. For now, I'll wrap alpine in a screen session and hope it will preserve my mails. I put the bug report here in case someone has a bright idea how to get to the bottom of this...


  • Peter Koellner

    Peter Koellner - 2012-11-24

    I just remebered that it might as well be alpine itself crashing, because the terminal closes itself after the start command terminates...

  • Andreas Schamanek

    If it is indeed only alpine that crashes then the terminal should not close if you opened alpine from within the terminal. That both programs crash is unlikely, though possible.

    Anyway, I recommend that you have a close look at your locale settings. That is: locale -a, set | grep ^LC, the terminal encoding, the $TERM variable, the font used in the terminal, and eventually (if I did not forget anything;) all charset settings in Alpine.

    I can't help you code-wise. However, chances are that it's indeed a configuration issue.


  • Peter Koellner

    Peter Koellner - 2012-11-24

    Well, I doubt that it is a localization configuration problem. I have been running pine/alpine/re-alpine for a good ten years now - and nearly two years on this particular laptop running debian - without ever having any problems. I recompiled alpine a couple of days ago to test topal gpg integration, which needed two patches - and after the first crash I removed the support and the patches again, but the crashes still occurred. So I guess that something changed in a supporting library which made the newly compiled program vulnerable to some problem which previously not existed. I tried to reproduce the situation of the crash but that seems to be difficult. I guess it is a combination of status messages popping up in pico and typing something in the right timing.
    I have defined a terminal profile to start a new terminal running alpine because I have to set the remote configuration parameters anyway. I now have changed that to wrap the alpine invocation in a screen session, so whenever it happens again and the screen sessino survives I will know whether the terminal or alpine crashes.
    I also manually save pico's content very often now so the tmp file should survive with most of the mail intact... When I get any results, I'll come back for the next step in debugging.

  • Peter Koellner

    Peter Koellner - 2013-01-24

    I have finally come around to collect more data. The bug is more or less reproducable by replying to a mail using pico and waiting for the connection to break. Sooner or later, alpine crashes.

    Here is the terminal window output:
    + HOST: *****.*********.*** USER: ********** ENTER PASSWORD:

    Problem detected: "Lock when already locked, mbx={imap.asgalon.net:143/imap/tls/novalidate-cert/user="pek00-peter"}<no_mailbox>".
    Alpine Exiting.

    Attempting to save debug file to /home/*****/.pine-crash

    And here is the stack trace from gdb:
    #0 0x00007f83b8d161b5 in raise () from /lib/libc.so.6
    #1 0x00007f83b8d18fc0 in abort () from /lib/libc.so.6
    #2 0x00000000005b9879 in coredump () at coredump.c:28
    #3 0x0000000000422751 in panic (
    message=0x7fff88902270 "Lock when already locked, mbx={xxxx.xxxxxxx.xxx:143/imap/tls/novalidate-cert/user=\"nnnnnnnnnn\"}<no_mailbox>") at alpine.c:3369
    #4 0x00000000005ca821 in fatal (string=0x23fd <Address 0x23fd out of bounds>)
    at ftl_unix.c:36
    #5 0x00000000005d7092 in mail_lock (stream=<value optimized out>)
    at mail.c:3195
    #6 0x0000000000600f17 in imap_send (stream=0x14c1ba0,
    cmd=<value optimized out>, args=<value optimized out>) at imap4r1.c:2917
    #7 0x0000000000602a3e in imap_close (stream=0x14c1ba0,
    options=<value optimized out>) at imap4r1.c:1301
    #8 0x00000000005d5963 in mail_close_full (stream=0x14c1ba0, options=9213)
    at mail.c:1352
    #9 0x00000000005a1e62 in sp_end () at stream.c:2779
    #10 0x00000000005c4aad in read_bail () at termin.unx.c:611
    #11 0x00000000004f8842 in simple_ttgetc (recorder=0x5c2340 <key_recorder>,
    bail_handler=0x5c4a00 <read_bail>) at tty.c:156
    #12 0x00000000005c4788 in pine_simple_ttgetc (fi=<value optimized out>,
    fv=<value optimized out>) at termin.unx.c:653
    #13 0x00000000004f5549 in kbseq (getcfunc=0x5c4710 <pine_simple_ttgetc>,
    recorder=0x5c2340 <key_recorder>, bail_handler=0x5c4a00 <read_bail>,
    data=0x7ca9e8, ch=0x7fff88902dc8) at getkey.c:358
    #14 0x00000000005c4d85 in read_char (time_out=7) at termin.unx.c:341
    #15 0x00000000004554fe in pine_tcptimeout (elapsed=60,
    sincelast=<value optimized out>) at imap.c:1262
    #16 0x00000000005cb7eb in ssl_getdata (stream=0x14d7240) at osdep.c:765
    #17 0x00000000005cc816 in ssl_getline_work (stream=0x23fd, size=0x23fd,
    contd=0x6) at osdep.c:658
    #18 0x00000000005cc987 in ssl_getline (stream=0x23fd) at osdep.c:619
    #19 0x00000000005ffc3d in imap_reply (stream=0x14c1ba0,
    tag=0x7fff88903a50 "01000006") at imap4r1.c:3555
    #20 0x00000000005ffe43 in imap_sout (stream=0x14c1ba0,
    tag=0x7fff88903a50 "01000006", base=0x14d11f0 "01000006 NOOP\r\n",
    s=0x7fff88903a68) at imap4r1.c:3519
    #21 0x000000000060103b in imap_send (stream=0x14c1ba0,
    cmd=<value optimized out>, args=<value optimized out>) at imap4r1.c:3129
    #22 0x00000000006021d4 in imap_ping (stream=0x23fd) at imap4r1.c:2358
    #23 0x00000000005e18d5 in mail_ping (stream=0x23fd) at mail.c:2417
    #24 0x00000000005a0f7e in pine_mail_ping (stream=0x14c1ba0) at stream.c:1795
    #25 0x00000000005a24ce in sp_stream_get (
    mailbox=0x7fff88904d10 "{xxxx.xxxxxxx.xxx/novalidate-cert/NoRsh/user=\"nnnnnnnnnn\"}INBOX.mezzo", flags=136314880) at stream.c:2659
    #26 0x00000000005a40b5 in pine_mail_open (stream=0x0,
    mailbox=0x7fff88904d10 "{xxxx.xxxxxxx.xxx/novalidate-cert/NoRsh/user=\"nnnnnnnnnn\"}INBOX.mezzo", openflags=65, retflags=<value optimized out>)
    at stream.c:440
    #27 0x000000000051b6c1 in context_open (context=<value optimized out>,
    old=0x0, name=<value optimized out>, opt=201326656, retflags=0x0)
    at context.c:397
    #28 0x000000000058fa50 in save (state=<value optimized out>, stream=0x146c3c0,
    context=0x14a4bb0, folder=<value optimized out>, msgmap=0x15c2cc0,
    flgs=<value optimized out>) at save.c:816
    #29 0x000000000057077a in move_filtered_msgs (stream=0x146c3c0,
    dstfldr=0x14b8a50 "{xxxx.xxxxxxx.xxx/novalidate-cert/NoRsh/user=\"nnnnnnnnnn\"}INBOX.mezzo", flags_for_save=<value optimized out>,
    nick=<value optimized out>) at pattern.c:7966
    #30 0x000000000057f4a0 in process_filter_patterns (stream=0x146c3c0,
    msgmap=0x1489bb0, recent=<value optimized out>) at pattern.c:7564
    #31 0x000000000056c8bf in new_mail (force_arg=0,
    time_for_check_point=<value optimized out>, flags=<value optimized out>)
    at newmail.c:467
    #32 0x00000000004f0cf6 in alt_editor (f=<value optimized out>,
    n=<value optimized out>) at altedit.c:237
    #33 0x00000000004e63f2 in pico (pm=0x7fff8890b0e0) at pico.c:191
    #34 0x00000000004b6523 in pine_send (outgoing=0x14be470,
    body=<value optimized out>, editor_title=<value optimized out>,
    role=<value optimized out>, fcc_arg=<value optimized out>,
    reply=0x7fff8890b3e0, redraft_pos=0x0, lcc_arg=0x0, custom=0x14dd200,
    flags=0) at send.c:2975
    #35 0x00000000004981a1 in reply (pine_state=<value optimized out>,
    role_arg=<value optimized out>) at reply.c:696
    #36 0x000000000046ce6f in cmd_reply (state=0x1461010, msgmap=0x1489bb0, aopt=0)
    at mailcmd.c:2275
    #37 0x0000000000470e6d in process_cmd (state=0x1461010,
    stream=<value optimized out>, msgmap=0x1489bb0,
    command=<value optimized out>, in_index=<value optimized out>,
    force_mailchk=0x7fff8890d990) at mailcmd.c:644
    #38 0x000000000048acf3 in scrolltool (sparms=0x7fff8890da10) at mailview.c:3504
    #39 0x000000000048c40a in mail_view_screen (ps=0x1461010) at mailview.c:445
    #40 0x000000000042832d in main (argc=<value optimized out>,
    argv=0x7fff88910498) at alpine.c:1331

  • Peter Koellner

    Peter Koellner - 2013-01-24
    • summary: re-alpine 2.02 on debian 64bit crashes gnome terminal 2.30.2 --> re-alpine 2.02 on debian 64bit crashes on broken IMAP connec
  • Peter Koellner

    Peter Koellner - 2013-01-24

    Turns out it has nothing to do with the gnome terminal, but happens under some circumstances when the IMAP connection breaks.

  • Peter Koellner

    Peter Koellner - 2013-01-24

    It looks like the triggering event has something to do with filter rule target folders. some months ago, the mail server configuration changed so I had to change the IMAP host, arguments and path for the inbox folder. Unfortunately, these changes are not reflected in the filter rule configuration where folders dependent on the inbox path are targeted. So every time the filter applies, alpine connects to the same imap server with connection parameters that still work somehow, but appear to lead to an extremely fragile connection. If this happens while I am editing a new mail, there seem to happen some sort of race condition which leads to a panic, in the process discarding the editor content without saving it. I have now changed the filter target folders to reflect the new mail server parameters and continue observing if the bug is triggered again. Even if that event hopefully will be avoided now, The underlying problem remains unsolved, though.

  • Peter Koellner

    Peter Koellner - 2013-01-27

    Dear Eduardo, there seem to be a problem with the mail address you gave me, I get the mail returned with a 550 unknown user delivery error. I only got the crash once today while writing the first reply with debug still disabled and only other minor problems with debug level 9, so I'll continue trials.

  • Eduardo Chappa

    Eduardo Chappa - 2013-01-28

    Dear Peter, I tried testing sending e-mail to myself and it worked - although I had Alpine crash on me during the testing process - the crash in this case was caused by a non compliant smtp server. You can send me e-mail to chappa@washington.edu or chappa@u.washington.edu. I look forward to seeing your debug report.

    Thank you


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks