Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new msg does not show and SIGABRT/SIGSEGV when repeating open mailbox, HEAD is c1edc0402 #1340

Closed
jencce opened this issue Sep 17, 2018 · 1 comment
Labels
bug:crash Causes NeoMutt to crash

Comments

@jencce
Copy link

jencce commented Sep 17, 2018

Expected Behaviour

New message does not show in mailbox.

If open mailbox that is not INBOX twice in sidebar, SIGABRT raises.

If do nothing after neomutt startup, open INBOX twice, SIGSEGV raises.

Actual Behaviour

Program received signal SIGABRT, Aborted.
0x00007ffff68c2207 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
55        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0  0x00007ffff68c2207 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
#1  0x00007ffff68c38f8 in __GI_abort () at abort.c:90
#2  0x00007ffff6904d27 in __libc_message (do_abort=2, fmt=fmt@entry=0x7ffff6a16678 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:196
#3  0x00007ffff690ec96 in malloc_printerr (ar_ptr=0x7ffff6c52760 <main_arena>, ptr=0x4213880, str=0x7ffff6a13d7b "malloc(): memory corruption", action=<optimized out>)
    at malloc.c:5004
#4  _int_malloc (av=av@entry=0x7ffff6c52760 <main_arena>, bytes=bytes@entry=19) at malloc.c:3469
#5  0x00007ffff69111ac in __GI___libc_malloc (bytes=19) at malloc.c:2905
#6  0x00000000004bcfc2 in mutt_mem_malloc (size=size@entry=19) at mutt/memory.c:105
#7  0x00000000004bf146 in mutt_str_strdup (str=str@entry=0x7fffffff91e0 "Sorting mailbox...") at mutt/string.c:325
#8  0x00000000004bb973 in log_disp_queue (stamp=stamp@entry=0, file=file@entry=0x4e06f4 "sort.c", line=line@entry=376, 
    function=function@entry=0x4d7aa0 <__func__.7186> "mutt_sort_headers", level=level@entry=0) at mutt/logging.c:422
#9  0x0000000000449f82 in log_disp_curses (stamp=stamp@entry=0, file=file@entry=0x4e06f4 "sort.c", line=line@entry=376, 
    function=function@entry=0x4d7aa0 <__func__.7186> "mutt_sort_headers", level=level@entry=0) at mutt_logging.c:186
#10 0x0000000000473dab in mutt_sort_headers (ctx=0x809290, init=true) at sort.c:376
#11 0x000000000044ebd3 in mx_mbox_open (path=path@entry=0x7fffffff9ee0 "/mnt/newdisk/Mail/redhat/tome.bz", flags=<optimized out>) at mx.c:323
#12 0x00000000004263be in main_change_folder (buflen=1024, index_hint=0x7fffffff9d54, oldcount=<synthetic pointer>, buf=0x7fffffff9ee0 "/mnt/newdisk/Mail/redhat/tome.bz", 
    op=223, menu=0xbd7ef0) at curs_main.c:617
#13 mutt_index_menu () at curs_main.c:2250
#14 0x000000000040881d in main (argc=1, argv=<optimized out>, envp=<optimized out>) at main.c:1214
(gdb) 
Sorting mailbox...
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff690c639 in malloc_consolidate (av=av@entry=0x7ffff6c52760 <main_arena>) at malloc.c:4153
4153		    unlink(av, p, bck, fwd);
(gdb) bt
#0  0x00007ffff690c639 in malloc_consolidate (av=av@entry=0x7ffff6c52760 <main_arena>) at malloc.c:4153
#1  0x00007ffff690e295 in _int_malloc (av=av@entry=0x7ffff6c52760 <main_arena>, bytes=bytes@entry=26192) at malloc.c:3444
#2  0x00007ffff6911c34 in __libc_calloc (n=<optimized out>, elem_size=<optimized out>) at malloc.c:3241
#3  0x00000000004bcee0 in mutt_mem_calloc (nmemb=nmemb@entry=3274, size=size@entry=8) at mutt/memory.c:64
#4  0x00000000004b9888 in new_hash (nelem=3274) at mutt/hash.c:144
#5  0x00000000004b9a98 in mutt_hash_create (nelem=<optimized out>, flags=flags@entry=4) at mutt/hash.c:280
#6  0x000000000044bd9a in mutt_sort_threads (ctx=ctx@entry=0x808ba0, init=init@entry=true) at mutt_thread.c:822
#7  0x0000000000473d3c in mutt_sort_headers (ctx=0x808ba0, init=<optimized out>) at sort.c:408
#8  0x000000000044ebd3 in mx_mbox_open (path=path@entry=0x7fffffff9fd0 "/mnt/newdisk/Mail/redhat/INBOX", flags=<optimized out>) at mx.c:323
#9  0x00000000004263be in main_change_folder (buflen=1024, index_hint=0x7fffffff9e44, oldcount=<synthetic pointer>, buf=0x7fffffff9fd0 "/mnt/newdisk/Mail/redhat/INBOX", 
    op=223, menu=0xbd77b0) at curs_main.c:617
#10 mutt_index_menu () at curs_main.c:2250
#11 0x000000000040881d in main (argc=1, argv=<optimized out>, envp=<optimized out>) at main.c:1214
(gdb) 

Steps to Reproduce

issue 1.
Startup neomutt with sidebar, by default, INBOX is opened.
Open INBOX again.
SIGSEGV

issue 2.
Startup neomutt with sidebar, by default, INBOX is opened.
Move cursor in sidebar to a mailbox that contains new messages.
Open it,
New msg does not show.
Open it again,
SIGABRT.

How often does this happen?

  • Always

When did it start to happen?

c1edc04

Did not update the config.

NeoMutt Version

NeoMutt 20180716-415-c1edc0
Copyright (C) 1996-2016 Michael R. Elkins and others.
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Linux 3.10.0-948.el7.x86_64 (x86_64)
ncurses: ncurses 5.9.20130511 (compiled with 5.9.20130511)
libidn: 1.28 (compiled with 1.28)

Compiler:
cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Configure options: --ssl

Compilation CFLAGS: -g -O2 -std=c99 -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__  -DNCURSES_WIDECHAR -I/usr/include

Default options:
  +attach_headers_color +compose_to_sender +compress +cond_date +debug 
  +encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color 
  +initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop 
  +progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar 
  +skip_quoted +smtp +status_color +timeout +tls_sni +trash 

Compile options:
  +bkgdset +color +curs_set +fcntl -flock -fmemopen +futimens +getaddrinfo 
  -gnutls -gpgme -gss -hcache -homespool +idn +inotify -locales_hack -lua +meta 
  -mixmaster +nls -notmuch +openssl +pgp -sasl +smime +start_color 
  +sun_attachment +typeahead 
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"

To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
    https://github.com/neomutt/neomutt/issues
or send an email to: <neomutt-devel@neomutt.org>

Extra Info

  • Operating System and its version
    RHEL-7.5

  • Were you using multiple copies of NeoMutt at once?
    no

  • Were you using 'screen' or 'tmux'?
    no

  • Is your email local (maildir) or remote (IMAP)?
    local

  • git bisect log
    git bisect start

good: [c55e2de] merge: redistribute Context and Mailbox

git bisect good c55e2de

bad: [c1edc04] merge: tidy private data usage

git bisect bad c1edc04

bad: [1f632ca] reorg maildir functions

git bisect bad 1f632ca

bad: [e7bbfc1] maildir: alloc mem for headers

git bisect bad e7bbfc1

bad: [4e227bf] doxy: fix links

git bisect bad 4e227bf

good: [ab10d9d] Fix build

git bisect good ab10d9d

bad: [50034a1] trivial fixes

git bisect bad 50034a1

first bad commit: [50034a1] trivial fixes

@flatcap
Copy link
Member

flatcap commented Sep 17, 2018

Thanks for the bug report @jencce (especially for the bisect).
The 'trivial fixes' is a known problem, but your backtraces didn't show what I expected.
I'll have a closer look.

I'm currently making some large architectural improvements to the code.
I hope to have master stable again soon.

Thanks.

@flatcap flatcap added the bug:crash Causes NeoMutt to crash label Sep 17, 2018
@flatcap flatcap closed this as completed May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:crash Causes NeoMutt to crash
Projects
None yet
Development

No branches or pull requests

2 participants