On Saturday, 11 October 2014 at 09:41, Phil Pennock wrote:
> Looking for pointers to where to investigate more closely as I chase
> this down.
Might be interesting to run it under valgrind? I guess my first
suspicion would be that the IMAP keepalive code is stomping on memory
elsewhere.
> Started getting repeatable mutt crashes, if I leave mutt running for a
> while and come back to it; session is IMAP using Kerberos auth. Running
> on FreeBSD, mutt built using Ports (poudriere). The crash is in
> keymap.c. I can't recall when I started seeing this, but I only noticed
> it in the last few days.
>
> I rebuilt with debug enabled, to get a usable core dump, as before the
> stack was garbage. There are patches, but when I grep in
> /usr/ports/mail/mutt/files for files containing keymap, the only two
> listed are not selected in my builds (neither sidebar-patch nor
> signature menu).
>
> The mutt version output is somewhat broken, I remember seeing this
> before but don't recall the cause. Compiler is:
> FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
>
> Mercurial tip shows no changes to keymap.c this year; a diff between the
> keymap.c in the source used through the FreeBSD build and current
> mercurial tip shows no diff: code is unmodified. Build uses ncurses.
>
> The `struct keymap_t *` is non-NULL but every entry in it is zeroed out,
> so in `map->keys[pos]` the `map->keys` part is NULL, thus a segfault.
>
> What sorts of keymaps are allocated such that, after an idle time, the
> memory might get blanked? Something allocated in an arena/pool/whatever
> tied to the current connection?
>
> Thanks,
> -Phil
>
> ----------------------------8< cut here >8------------------------------
> #0 0x0000000000456c7b in km_dokey (menu=7) at keymap.c:511
> 511 while (LastKey > map->keys[pos])
> [New Thread 804406400 (LWP 101052/mutt)]
> (gdb) bt
> #0 0x0000000000456c7b in km_dokey (menu=7) at keymap.c:511
> #1 0x000000000046f1c9 in mutt_pager (banner=0x0, fname=0x7fffffffb640
> "/home/pdp/tmp/mutt-tower-Mwx5nC4u", flags=66,
> extra=0x7fffffffb1d0) at pager.c:1854
> #2 0x000000000041bc87 in mutt_display_message (cur=0x8070130c0) at
> commands.c:214
> #3 0x000000000042dbd5 in mutt_index_menu () at curs_main.c:1207
> #4 0x000000000045aa2a in main (argc=1, argv=0x7fffffffd400) at main.c:1056
> (gdb) p LastKey
> $1 = 113
> (gdb) p map
> $2 = (struct keymap_t *) 0x80441a850
> (gdb) p *map
> $3 = {
> macro = 0x0,
> descr = 0x0,
> next = 0x0,
> op = 0,
> eq = 0,
> len = 0,
> keys = 0x0
> }
> (gdb) p pos
> $4 = 0
> (gdb) frame 0
> #0 0x0000000000456c7b in km_dokey (menu=7) at keymap.c:511
> 511 while (LastKey > map->keys[pos])
> (gdb) list
> 506 if (func)
> 507 continue;
> 508 }
> 509
> 510 /* Nope. Business as usual */
> 511 while (LastKey > map->keys[pos])
> 512 {
> 513 if (pos > map->eq || !map->next)
> 514 return (retry_generic (menu, map->keys, pos, LastKey));
> 515 map = map->next;
> ----------------------------8< cut here >8------------------------------
>
> ----------------------------8< cut here >8------------------------------
> % mutt -v
> Mutt 1.5.23 (2014-03-12)
> Copyright (C) 1996-2009 Michael R. Elkins and others.
> Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
> Mutt is free software, and you are welcome to redistribute it
> under certain conditions; type `mutt -vv' for details.
>
> System: FreeBSD 10.0-RELEASE-p7 (amd64)
> ncurses: ncurses 5.7.20081102 (compiled with 5.7)
> libidn: 1.29 (compiled with 1.29)
> hcache backend: Berkeley DB 5.3.28: (September 9, 2013)
>
> Compiler:
> sion 3.3 (g ve ags/RELEASE_33/final 183502) 20130610
> eebsd10.0 x86_64-unknown-f
> ead model: posix
> /local/include' ion: '-I /us
>
> /local' '--disable-flock' '--enable-locales-fix' '--wie-h-idn'
> '--disable-gpgme' '--wi h-gss' '--enable-sm p' '--enable-debug'
> /local/lib' 'LIBS=' 'CPPFLAGS=' 'CPP=cpp'gdbm' '--wi h-bdb' '--wi
> hou -qdbm' '--p
>
> icmpilat-aliasingS: -pipe -g -fno-s
>
> Compile options:
> -DOMAIN
> +DEBUG
> -HOMESPOOL +USE_SETGID +USE_DOTLOCK +DL_STANDALONE -USE_FCNTL -USE_FLOCK
>
> +USE_POP +USE_IMAP +USE_SMTP
> +USE_SSL_OPENSSL -USE_SSL_GNUTLS +USE_SASL +USE_GSS +HAVE_GETADDRINFO
> +HAVE_REGCOMP -USE_GNU_REGEX +COMPRESSED
> +HAVE_COLOR +HAVE_START_COLOR +HAVE_TYPEAHEAD +HAVE_BKGDSET
> +HAVE_CURS_SET +HAVE_META +HAVE_RESIZETERM
> +CRYPT_BACKEND_CLASSIC_PGP +CRYPT_BACKEND_CLASSIC_SMIME
> -CRYPT_BACKEND_GPGME
> -EXACT_ADDRESS -SUN_ATTACHMENT
> -ENABLE_NLS +LOCALES_HACK +HAVE_WC_FUNCS +HAVE_LANGINFO_CODESET
> +HAVE_LANGINFO_YESEXPR
> +HAVE_ICONV -ICONV_NONTRANS +HAVE_LIBIDN +HAVE_GETSID +USE_HCACHE
> -ISPELL
> SENDMAIL="/usr/sbin/sendmail"
> MAILPATH="/var/mail"
> PKGDATADIR="/usr/local/share/mutt"
> SYSCONFDIR="/usr/local/etc"
> EXECSHELL="/bin/sh"
> -MIXMASTER
> To contact the developers, please mail to <[email protected]>.
> To report a bug, please visit http://bugs.mutt.org/.
>
> patch-1.5.20.bk.trash_folder-purge_message.1
> patch-1.5.4.cd.ifdef.1
> patch-1.5.6.cb.reverse_reply.2
> patch-1.5.7.ust.maildir-mtime.2
> patch-1.5.0.ats.date_conditional.1
> dgc.deepif.1
> vvv.quote
> vvv.initials
> rr.compressed
> ----------------------------8< cut here >8------------------------------
>
> ----------------------------8< cut here >8------------------------------
> ┌────────────────────────────── mutt-1.5.23_5
> ─────────────────────────────────┐
> │
> ┌──────────────────────────────────────────────────────────────────────────┐ │
> │ │ [x] COMPRESSED_FOLDERS Compressed folders
> │ │
> │ │ [x] DEBUG Debugging capabilities
> │ │
> │ │ [x] DOCS Build and/or install documentation
> │ │
> │ │ [x] EXAMPLES Build and/or install examples
> │ │
> │ │ [ ] FLOCK flock() usage
> │ │
> │ │ [ ] GPGME Gpgme interface
> │ │
> │ │ [ ] GREETING_PATCH Greeting support
> │ │
> │ │ [x] GSSAPI Use the gss API
> │ │
> │ │ [x] HTML HTML documentation
> │ │
> │ │ [x] ICONV Encoding conversion support via iconv
> │ │
> │ │ [x] IDN International Domain Names support
> │ │
> │ │ [x] IFDEF_PATCH ifdef feature
> │ │
> │ │ [x] IMAP_HEADER_CACHE IMAP header cache
> │ │
> │ │ [x] LOCALES_FIX Locales fix
> │ │
> │ │ [x] MAILBOX_MANPAGES Install mbox.5/mmdf.5 manpages
> │ │
> │ │ [x] MAILDIR_HEADER_CACHE Maildir header cache
> │ │
> │ │ [x] MAILDIR_MTIME_PATCH Maildir mtime patch
> │ │
> │ │ [ ] NLS Native language support
> │ │
> │ │ [ ] NNTP NNTP (News) support
> │ │
> │ │ [x] PARENT_CHILD_MATCH_PATCH Parent/child match
> │ │
> │ │ [x] QUOTE_PATCH Extended quoting
> │ │
> │ │ [x] REVERSE_REPLY_PATCH Reverse_reply
> │ │
> │ │ [x] SASL SASL authentication
> │ │
> │ │ [ ] SIDEBAR_PATCH Sidebar support
> │ │
> │ │ [ ] SIGNATURE_MENU Signature menu
> │ │
> │ │ [x] SMART_DATE Dynamic date formatting with "%@"
> │ │
> │ │ [x] SMIME_OUTLOOK_COMPAT SMIME outlook compatibility
> │ │
> │ │ [x] SMTP SMTP relay support
> │ │
> │ │ [ ] TOKYOCABINET Use tokyocabinet instead of Berkley DB
> │ │
> │ │ [x] TRASH_PATCH Trash folder support
> │ │
> │ │ [x] XML Use XML tools for rebuilding documentation
> │ │
> │ │────────────────────────────────── SCREEN
> ────────────────────────────────│ │
> │ │ (*) NCURSES Ncurses support
> │ │
> │ │ ( ) SLANG SLANG support
> │ │
> │ │────────────────────────────────── SPELL
> ─────────────────────────────────│ │
> │ │ ( ) ASPELL Spell checking support via GNU Aspell
> │ │
> │ │ ( ) ISPELL Spell checking support via Ispell
> │ │
> ----------------------------8< cut here >8------------------------------
>