3

My installation of Mutt seems to work fine in every aspect, except that it hangs if I leave it open for too long. As long as I continue interacting with the interface, it seems to stay alive. But if I start writing an email or just let it stand idle for too long, it freezes. Ctrl+c doesn't kill it, so I just have to suspend it with Ctrl+z and kill it with kill <pid>.

Instead of asking about what may be wrong with my installation, I'd like to know how this kind of problem would be debugged. (Although, any hints would be super helpful!) Since the Mutt screen is frozen, I don't have any idea what's going on. What's the best way to debug something like this?

2 Answers 2

1

mutt may be started in debug mode. This will produce a debug file .muttdebug0 that may help debugging.

From the mutt man page:

-d level
      If mutt was complied with +DEBUG log debugging output to ~/.muttdebug0.  
      Level can range from 1-5 and effects verbosity. 
      A value of 2 is recommended.

Another approach is to open two terminal sessions, side by side. Run top or htop in one. In the other one, run mutt. When the issue shows up, take a look at what top displays. (If top also freezes, the issue may be bigger than mutt.)

You could also edit your post to include more information about your system and what it is doing.

  1. If mutt hangs at the same time every day, is another job doing something with I/O at that time?
  2. If mutt always hangs after N number of minutes after log in, do you have some other task that starts on login and then consumes many resources? (Running mutt in debug mode multiple times will help identify patterns in the log files.)
  3. Do you have access to /var/log/messages or other logs, or sar?

It may be mutt, or mutt freezing may be a symptom of something else.

1

I attached to a frozen mutt process with gdb. Here's what I've found:

(gdb) bt

#0  0x00007f8327de76b0 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f832899014b in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#2  0x00007f832898e16b in BIO_read () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#3  0x00007f8328cadb54 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
#4  0x00007f8328caed55 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
#5  0x00007f8328cac174 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
#6  0x0000000000484365 in ssl_socket_read (conn=<optimized out>, buf=<optimized out>, len=<optimized out>) at mutt_ssl.c:304
#7  0x0000000000485bb7 in mutt_sasl_conn_read (conn=0xa1d660, 
    buf=0xa1d7f0 "+ idling\r\nDLE terminated (Success)\r\n38441 INTERNALDATE \"15-Oct-2017 12:27:13 +0000\" FLAGS () BODY[HEADER.FIELDS (DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY"..., len=1024) at mutt_sasl.c:555
#8  0x00000000004836b9 in mutt_socket_readchar (conn=conn@entry=0xa1d660, c=c@entry=0x7ffc9ee890cf "") at mutt_socket.c:172
#9  0x00000000004837d2 in mutt_socket_readln_d (buf=0xa266a0 "+ idling", buflen=512, conn=0xa1d660, dbg=dbg@entry=2) at mutt_socket.c:202
#10 0x0000000000490328 in imap_cmd_step (idata=idata@entry=0x9fe990) at command.c:112
#11 0x0000000000491188 in imap_exec (idata=0x9fe990, cmdstr=cmdstr@entry=0x0, flags=flags@entry=1) at command.c:244
#12 0x00000000004912fc in cmd_queue (cmdstr=0x4b3de5 "IDLE", idata=0x9fe990) at command.c:377
#13 cmd_start (idata=0x9fe990, cmdstr=0x4b3de5 "IDLE", flags=0) at command.c:402
#14 0x0000000000491370 in imap_cmd_start (cmdstr=0x4b3de5 "IDLE", idata=idata@entry=0x9fe990) at command.c:76
#15 imap_cmd_idle (idata=idata@entry=0x9fe990) at command.c:313
#16 0x0000000000493328 in imap_check_mailbox (ctx=ctx@entry=0xa37ba0, index_hint=index_hint@entry=0x7ffc9ee89214, force=force@entry=0) at imap.c:1401
#17 0x0000000000442d2a in mx_check_mailbox (ctx=0xa37ba0, index_hint=index_hint@entry=0x7ffc9ee89214, lock=<optimized out>, lock@entry=0) at mx.c:1336
#18 0x000000000041e1b8 in mutt_index_menu () at curs_main.c:555
#19 0x000000000040833c in main (argc=1, argv=<optimized out>) at main.c:1061

It was waiting infinitely on a blocking read. In order to fix this one should either do read with a timeout or make the call cancelable so that it interrupts upon receiving a signal such as SIGINT.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .