~sircmpwn/aerc2#500: 
data race after imap-update

hi,

I am using aerc at 548faca, and compiled with -race. I sometimes get:

Fhc7qA OK UID FETCH completed
2021/03/10 11:56:22 ->(ui) *types.MessageInfo:*types.FetchMessageHeaders
2021/03/10 11:56:22 ->(ui) *types.Done:*types.FetchMessageHeaders
2021/03/10 11:56:22 (ui)<= *types.MessageInfo(165):*types.FetchMessageHeaders(164)
2021/03/10 11:56:22 (ui)<= *types.Done(166):*types.FetchMessageHeaders(164)
* 260 EXISTS
* 261 EXISTS
2021/03/10 11:57:22 (= *client.MailboxUpdate
==================
WARNING: DATA RACE
Read at 0x00c00011c28c by goroutine 19:
  git.sr.ht/~sircmpwn/aerc/worker/imap.(*IMAPWorker).handleImapUpdate()
      git.sr.ht/~sircmpwn/aerc/worker/imap/worker.go:217 +0x42e
  git.sr.ht/~sircmpwn/aerc/worker/imap.(*IMAPWorker).Run()
      git.sr.ht/~sircmpwn/aerc/worker/imap/worker.go:262 +0x504

Previous write at 0x00c00011c28c by goroutine 44:
  github.com/emersion/go-imap/client.(*Client).handleUnilateral.func1()
      github.com/emersion/go-imap@v1.0.6-0.20201014170015-5a03a09eba6d/client/client.go:412 +0x8e7
  github.com/emersion/go-imap/responses.HandlerFunc.Handle()
      github.com/emersion/go-imap@v1.0.6-0.20201014170015-5a03a09eba6d/responses/responses.go:27 +0x47
  github.com/emersion/go-imap/client.(*Client).handle()
      github.com/emersion/go-imap@v1.0.6-0.20201014170015-5a03a09eba6d/client/client.go:119 +0x141
  github.com/emersion/go-imap/client.(*Client).readOnce()
      github.com/emersion/go-imap@v1.0.6-0.20201014170015-5a03a09eba6d/client/client.go:169 +0x313
  github.com/emersion/go-imap/client.(*Client).reader()
      github.com/emersion/go-imap@v1.0.6-0.20201014170015-5a03a09eba6d/client/client.go:136 +0xa7

Goroutine 19 (running) created at:
  git.sr.ht/~sircmpwn/aerc/widgets.NewAccountView()
      git.sr.ht/~sircmpwn/aerc/widgets/account.go:85 +0xd06
  git.sr.ht/~sircmpwn/aerc/widgets.NewAerc()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:88 +0xf38
  main.main()
      git.sr.ht/~sircmpwn/aerc/aerc.go:159 +0x854

Goroutine 44 (running) created at:
  github.com/emersion/go-imap/client.(*Client).handleGreetAndStartReading()
      github.com/emersion/go-imap@v1.0.6-0.20201014170015-5a03a09eba6d/client/client.go:525 +0x2ed
  github.com/emersion/go-imap/client.New()
      github.com/emersion/go-imap@v1.0.6-0.20201014170015-5a03a09eba6d/client/client.go:600 +0x596
  github.com/emersion/go-imap/client.DialWithDialer()
      github.com/emersion/go-imap@v1.0.6-0.20201014170015-5a03a09eba6d/client/client.go:644 +0x130
  github.com/emersion/go-imap/client.Dial()
      github.com/emersion/go-imap@v1.0.6-0.20201014170015-5a03a09eba6d/client/client.go:615 +0x13fa
  git.sr.ht/~sircmpwn/aerc/worker/imap.(*IMAPWorker).handleMessage()
      git.sr.ht/~sircmpwn/aerc/worker/imap/worker.go:117 +0x137d
  git.sr.ht/~sircmpwn/aerc/worker/imap.(*IMAPWorker).Run()
      git.sr.ht/~sircmpwn/aerc/worker/imap/worker.go:251 +0x245
==================
2021/03/10 11:57:22 ->(ui) *types.DirectoryInfo
2021/03/10 11:57:22 (= *client.MailboxUpdate
2021/03/10 11:57:22 ->(ui) *types.DirectoryInfo
2021/03/10 11:57:22 (ui)<= *types.DirectoryInfo(167)
2021/03/10 11:57:22 (ui)=> *types.FetchDirectoryContents
Status
REPORTED
Submitter
~sbinet
Assigned to
No-one
Submitted
a month ago
Updated
a month ago
Labels
No labels applied.