~sircmpwn/aerc2#397: 
SEGFAULT in aerc/widgets.(*MessageList).Draw

Hi!

I encountered this crash with aerc 0.3.0.r183.g61e9940. I don’t know how to reproduce it, I’ll add more information if I get this bug again.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x562f10e3326b]

goroutine 1 [running]:
git.sr.ht/~sircmpwn/aerc/widgets.(*MessageList).Draw(0xc000033440, 0xc0009084e0)
	git.sr.ht/~sircmpwn/aerc/widgets/msglist.go:112 +0x2cb
git.sr.ht/~sircmpwn/aerc/lib/ui.(*Grid).Draw(0xc000136580, 0xc0009081b0)
	git.sr.ht/~sircmpwn/aerc/lib/ui/grid.go:142 +0x257
git.sr.ht/~sircmpwn/aerc/widgets.(*AccountView).Draw(0xc000209a40, 0xc0009081b0)
	git.sr.ht/~sircmpwn/aerc/widgets/account.go:142 +0x3b
git.sr.ht/~sircmpwn/aerc/lib/ui.(*TabContent).Draw(0xc000209960, 0xc0009081b0)
	git.sr.ht/~sircmpwn/aerc/lib/ui/tab.go:393 +0x61
git.sr.ht/~sircmpwn/aerc/lib/ui.(*Grid).Draw(0xc000136420, 0xc00010abd0)
	git.sr.ht/~sircmpwn/aerc/lib/ui/grid.go:142 +0x257
git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Draw(0xc0001364d0, 0xc00010abd0)
	git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:172 +0x3f
git.sr.ht/~sircmpwn/aerc/lib/ui.(*UI).Tick(0xc00007e0f0, 0xc0001ee000)
	git.sr.ht/~sircmpwn/aerc/lib/ui/ui.go:113 +0xf8
main.main()
	git.sr.ht/~sircmpwn/aerc/aerc.go:192 +0x674
Status
REPORTED
Submitter
~rucikir
Assigned to
No-one
Submitted
4 months ago
Updated
a month ago
Labels
bug

~gdiazlo 4 months ago

I've been bitten by it too. I was changing accounts when it happened. It does not always happens though.

Sijmen Schoon a month ago · edit

(Hopefully I'm doing this correctly, this is my first time doing git related things via email)

I just got this issue too, on 0.4.0. After taking a quick gander at the source code, it seems to be because msg.Envelope is nil on the indicated line (on the current master HEAD (fe1cabb), that's line 108).

I feel this happens when (one of) the messages has not finished loading, but I'm having a hard time reproducing the issue. Perhaps expanding the nil check on line 98 will be enough?

widgets/msglist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/widgets/msglist.go b/widgets/msglist.go index e38dd9e..c340770 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -95,7 +95,7 @@ func (ml *MessageList) Draw(ctx *ui.Context) { break }

  •           if msg == nil {
    
  •           if msg == nil || msg.Envelope == nil {
                      needsHeaders = append(needsHeaders, uid)
                      ml.spinner.Draw(ctx.Subcontext(0, row, textWidth, 1))
                      row += 1
    
Register here or Log in to comment, or comment via email.