NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/59635: mailx(1) regularly dumps core when changing mail folders



The following reply was made to PR bin/59635; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/59635: mailx(1) regularly dumps core when changing mail
 folders
Date: Wed, 17 Jun 2026 23:28:34 +0000 (UTC)

 On Wed, 17 Jun 2026, Robert Elz via gnats wrote:
 
 > I have an idea what the problem might be, but I don't
 > use mailx (aka mail these days, and Mail in the past)
 > and certainly not with folders, so I am unable to
 > really test the change, if I make it.
 >
 
 This is pretty easy to reproduce if you have a bunch of folders.
 Just switch between them to trigger the crash:
 
 ```
 Script started on Wed Jun 17 23:04:28 2026
 
 $ cat ~/.mailrc
 set folder=mail
 set record=+sent
 
 $ ls ~/mail/NetBSD/
 announce        membership-exec tech-install    tech-toolchain
 bugs            port-amd64      tech-kern       tech-userlevel
 current-users   port-i386       tech-misc       tech-x11
 docs            source-changes  tech-security   users
 
 $ mail -f +NetBSD/users
 Mail version 9.1alpha 2009-02-25.  Type ? for help.
 "+NetBSD/users": 2124 messages
 >   1 MAILER-DAEMON%SDF.OR@localhost  Tue Jun 16 21:50   7/528   "DON'T DELETE THIS MESSAG
  	[...]
 & fi +NetBSD/current-users
 "+NetBSD/current-users": 1189 messages
 >   1 MAILER-DAEMON%SDF.OR@localhost  Tue Jun 16 06:57   7/528   "DON'T DELETE THIS MESSAG
  	[...]
 & fi +NetBSD/users
 assertion "message_array.t_head == message" failed: file "/usr/src/usr.bin/mail/thread.c", line 497, function "thread_fix_new_links"
 [1]   Abort trap (core dumped) mail -f +NetBSD/users
 
 $ ^D
 
 Script done on Wed Jun 17 23:05:23 2026
 ```
 
 > Is one of the people who can reproduce this problem
 > able to take a patch, rebuild src/usr.bin/mail and
 > test it?
 >
 
 I've been running with this hackish patch for a while now, but, I'll test
 yours too:
 
 ```
 --- src/usr.bin/mail.orig/fio.c	2023-08-23 03:49:00.000000000 +0000
 +++ src/usr.bin/mail/fio.c	2025-09-07 23:14:17.863958582 +0000
 @@ -143,7 +143,7 @@
   		    "Insufficient memory for %d messages", nmsgCount);
   	dot = nmessage + off;
 
 -	if (off != 0 || need_init != 0)
 +	// if (off != 0 || need_init != 0)
   		thread_fix_old_links(nmessage, off, omsgCount);
 
   #ifndef THREAD_SUPPORT
 ```
 
 > If so, which NetBSD release would you like the patch
 > based upon?
 >
 
 -HEAD works for me.
 
 -RVP
 



Home | Main Index | Thread Index | Old Index