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
Segfault when opening forwarded multipart email (as attachment) before sending #4177
Comments
I can reproduce this. I suspect this use case was probably missed in the multipart code I originally worked on to fix up. I notice that the attachment tree is wrongly displayed which further suggests that it was never implemented or tested and certainly indicates that the attachment structure is broken leading to an inevitable segfault. In theory it's probably not too hard to fix, but I haven't looked at the code for a long time. David |
I started looking into this. Here's a backtrace:
|
The fix probably needs to happen in Previously The code probably more or less exists because the send from a postponed message code is capable of creating the attachment tree from a multipart attachment. But there are more cases that potentially need to be handled here. You can forward anything, but only create It's conceivable you might want to forward a All this is to say that it's not quite as simple to fix as I hoped. Some design and behaviour decisions need to be made. @roccoblues if you want to do it you are welcome :). I can tinker, but no timeline promises. |
@dcpurton Thanks for the info. I have the bad feeling this might be a bit over my head but I'll at least try to understand the problem.
I stepped through the code and mutt_copy_body is used to copy the body. It seems like this is doing what you describe above - black box copy. So we have to update or replace that with a version that actually copies the tree structure (loop through
Can you point me to that code? Thanks! |
@roccoblues , the code I wrote to handle recalling postponed and resending messages is in 9350145 |
Expected Behaviour
My goal was to forward only parts of a multipart email and select individual attachments. To do that I use the v key to go into attachment selection mode and select the individual parts I want to forward. In the simplest case I just keep the cursor on the root element of a multipart email. Then I press f to forward, add a recipient, edit the message and maybe open the forwarded attachments again before sending. Finally the mail should be sent.
Actual Behaviour
In the above description everything works apart from opening the forwarded message parts/attachments before sending by pressing Enter. Trying to do so results in a segmentation fault. This doesn't seem to happen when one tries to open "leaf nodes" in a multipart message (e.g. the actual HTML and text versions), as seen in the attachment view/list.
A coredump file is created and I can send it if it would be helpful (it's from a test email account). Initially I hoped to quickly peek into the source code, but couldn't get the function names and line numbers into
neomutt
to show up within a backtrace incgdb
. I compiled the latest main branch version with debug symbols (make EXTRA_CFLAGS="-g -O0"
) and startedneomutt
with debug logging (-d 5
), but couldn't get anything meaningful from the coredump (nor the debug log). The core dump still only contains question marks instead of function names.Steps to Reproduce
How often does this happen?
Always with multipart emails. I simply created a HTML email in a web mail interface and send it to my address. Then I did the steps above on this email.
I can send a full example email id the trimmed down one I attached this issue isn't useful in itself: test.txt
When did it start to happen?
Not sure exactly when this started to happen. I experience occasional crashes with
neomutt
since quite a a while, unfortunately. There might be multiple issues, but it was just today that I seemed to notice a pattern and investigated this. I tested this with the latest release and the GitHub main branch HEAD.NeoMutt Version
Even though the compilation options show no debug symbols, I added them according the
neomutt
debugging docs.Extra Info
neomutt
copies at the same time, but this bug also happens with a single instance.tmux
/screen
was used.The text was updated successfully, but these errors were encountered: