~sircmpwn/aerc2#168: 
Crash on receiving new mail after commit b83e7c9

Open aerc. Send a mail to yourself from another client. Wait for aerc tick to refresh and aerc crashes.

The crash error is:

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

goroutine 42 [running]:
bufio.(*Reader).fill(0xc0003f0f48)
	/usr/lib/go/src/bufio/bufio.go:100 +0xe0
bufio.(*Reader).Peek(0xc0003f0f48, 0x1, 0x0, 0x7fe9c83998e0, 0x40981b, 0xc0003f0d28, 0x2)
	/usr/lib/go/src/bufio/bufio.go:138 +0x4f
github.com/emersion/go-message/textproto.ReadHeader(0xc0003f0f48, 0x1000, 0x1000, 0xc000538000, 0x0, 0x0, 0x0)
	$GOPATH/pkg/mod/github.com/emersion/go-message@v0.10.3/textproto/header.go:384 +0x4c
git.sr.ht/~sircmpwn/aerc/worker/imap.(*IMAPWorker).handleFetchMessages.func1(0xc0003e8c00, 0xc0001740e0, 0x8dcb20, 0xc0005c1410, 0xc0002c6080, 0xc0003e8c60)
	/aerc/worker/imap/fetch.go:70 +0x293
created by git.sr.ht/~sircmpwn/aerc/worker/imap.(*IMAPWorker).handleFetchMessages
	/aerc/worker/imap/fetch.go:64 +0xbf

Relevant log portion is as follows:

2019/06/08 01:23:42 Fetching message headers
_4JYDQ UID FETCH 88732 (BODYSTRUCTURE ENVELOPE INTERNALDATE FLAGS UID BODY[HEADER])
* 25 FETCH (UID 88732 INTERNALDATE "07-Jun-2019 19:53:37 +0000" FLAGS (\Seen) ENVELOPE ("Sat, 8 Jun 2019 01:23:37 +0530" "Hello there" (("Yash Srivastav" NIL "yash111998" "gmail.com")) (("Yash Srivastav" NIL "yash111998" "gmail.com")) (("Yash Srivastav" NIL "yash111998" "gmail.com")) (("Yash Srivastav" NIL "yash111998" "gmail.com")) NIL NIL NIL "<CAF+684bZM6XCTKwR3WbBQ8SiH55v1hPiQXXPfWQ8A3-O4SGEjw@mail.gmail.com>") BODY[HEADER] {294}
MIME-Version: 1.0
Date: Sat, 8 Jun 2019 01:23:37 +0530
Message-ID: <CAF+684bZM6XCTKwR3WbBQ8SiH55v1hPiQXXPfWQ8A3-O4SGEjw@mail.gmail.com>
Subject: Hello there
From: Yash Srivastav <yash111998@gmail.com>
To: Yash Srivastav <yash111998@gmail.com>
Content-Type: text/plain; charset="UTF-8"

 BODYSTRUCTURE ("TEXT" "PLAIN" ("CHARSET" "UTF-8") NIL NIL "7BIT" 35 1 NIL NIL NIL))
2019/06/08 01:23:42 ->(ui) *types.MessageInfo:*types.FetchMessageHeaders
2019/06/08 01:23:42 (ui)<= *types.MessageInfo(78):*types.FetchMessageHeaders(77)
* 25 FETCH (UID 88732 FLAGS (\Seen))
_4JYDQ OK Success

I believe the error is due to the second * 25 FETCH we receive which has none of the other fields set other than UID and FLAGS. I'm unable to understand why it happens? Any ideas?

Status
RESOLVED FIXED
Submitter
~yashsriv
Assigned to
No-one
Submitted
1 year, 3 months ago
Updated
1 year, 3 months ago
Labels
bug