Anytype appears to crash when multiple users attempt to run the application

WHAT IS THE BUG
When another user on a machine runs Anytype, it corrupts all installs causing the ‘anytype helper crashed’ until reinstall and reboot.

HOW TO REPRODUCE IT

  1. Launch anytype as a user.
  2. Switch users (not logoff, switch user) to another account on the machine
  3. Launch anytype
  4. ᅟWatch as the anytype helper crash error comes up.

THE EXPECTED BEHAVIOR
Anytype runs, and doesn’t corrupt its install when another user launches it since it’s, ostensibly, installed in the user’s profile directory and not the generic \Programs or \Program Files.

ADDITIONAL CONTEXT
The crash dump appears to indicate that the panic comes from the dgraph-io package.

SYSTEM INFORMATION

  • Device:
    HP Elitebook
    i5-7200U; 8GB RAM

  • OS:
    Win10 Pro, 22h2, build 19045.3803

  • Anytype Version:
    v.0.36.0 AND 0.37.3

  • Technical Information:
    Desktop: Top Menu > Help > Tech Info
    Not available due to the fact the application immediately crashes on load.

Command line debug

C:\Users\DAUSER\AppData\Local\Programs\anytype>Anytype.exe

C:\Users\DAUSER\AppData\Local\Programs\anytype>
Can't parse log level "*: unrecognized level: "DEBUG\""

[ConfigManager].init: {
  channel: 'latest',
  theme: 'system',
  languages: [],
  zoom: 0,
  debug: {}
}
mw grpc: build on  from  at #()

gRPC server started at: 127.0.0.1:57714

gRPC Web proxy started at: 127.0.0.1:57715

07:38:55.152 > CreateWindow:  ["C:\\Users\\DAUSER\\AppData\\Local\\Programs\\anytype\\Anytype.exe"]
CreateWindow:  ["C:\\Users\\DAUSER\\AppData\\Local\\Programs\\anytype\\Anytype.exe"]
[ConfigManager].set: {
  channel: 'latest',
  theme: 'system',
  languages: [],
  zoom: 0,
  debug: {}
}
[ConfigManager].set: {
  channel: 'latest',
  theme: 'system',
  languages: [],
  zoom: 0,
  debug: {}
}
[UpdateManager].init, channel:  latest
07:38:58.774 > panic: runtime error: index out of range [3] with length 0 [recovered]
        panic:
== Recovering from initIndex crash ==
File Info: [ID: 1, Size: 1084653, Zeros: 310509]
isEnrypted: false checksumLen: 0 checksum:  indexLen: 0 index: []
== Recovered ==


goroutine 84 [running]:
github.com/dgraph-io/badger/v4/table.(*Table).initBiggestAndSmallest.func1.1()
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:353 +0xa8
github.com/dgraph-io/badger/v4/table.(*Table).initBiggestAndSmallest.func1()
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:399 +0xc2
panic({
panic: runtime error: index out of range [3] with length 0 [recovered]
        panic:
== Recovering from initIndex crash ==
File Info: [ID: 1, Size: 1084653, Zeros: 310509]
isEnrypted: false checksumLen: 0 checksum:  indexLen: 0 index: []
== Recovered ==


goroutine 84 [running]:
github.com/dgraph-io/badger/v4/table.(*Table).initBiggestAndSmallest.func1.1()
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:353 +0xa8
github.com/dgraph-io/badger/v4/table.(*Table).initBiggestAndSmallest.func1()
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:399 +0xc2
panic({
07:38:58.789 > 0x7ff7966b01a0, 0xc000122108})
        /Users/runner/hostedtoolcache/go/1.20.12/x64/src/runtime/panic.go:884 +0x213
github.com/google/flatbuffers/go.GetInt32(...)
        /Users/runner/go/pkg/mod/github.com/google/[email protected]/go/encode.go:85
github.com/google/flatbuffers/go.GetUOffsetT(...)
        /Users/runner/go/pkg/mod/github.com/google/[email protected]/go/encode.go:121
github.com/dgraph-io/badger/v4/fb.GetRootAsTableIndex(...)
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/fb/TableIndex.go:14
github.com/dgraph-io/badger/v4/table.(*Table).readTableIndex(0xc0006fc240)
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:707 +0x15e
github.com/dgraph-io/badger/v4/table.(*Table).initIndex(0xc0006fc240)
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:464 +0x19d
github.com/dgraph-io/badger/v4/table.(*Table).initBiggestAndSmallest(0xc0006fc240)
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:403 +0x7f
github.com/dgraph-io/badger/v4/table.OpenTable(0xc000b68260, {0x0, 0x1, 0x200000, 0x0, 0x0, 0x3f847ae147ae147b, 0x1000, 0x0, 0x0, ...})
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:309 +0x278
github.com/dgraph-io/badger/v4.newLevelsController.func1({0xc00080c000, 0x71}, {0x74?, 0x7272452e65736e6f?, 0x432e726f?})
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/levels.go:150 +0x1f9
created by github.com/dgraph-io/badger/v4.newLevelsController
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/levels.go:129 +0x585

0x7ff7966b01a0, 0xc000122108})
        /Users/runner/hostedtoolcache/go/1.20.12/x64/src/runtime/panic.go:884 +0x213
github.com/google/flatbuffers/go.GetInt32(...)
        /Users/runner/go/pkg/mod/github.com/google/[email protected]/go/encode.go:85
github.com/google/flatbuffers/go.GetUOffsetT(...)
        /Users/runner/go/pkg/mod/github.com/google/[email protected]/go/encode.go:121
github.com/dgraph-io/badger/v4/fb.GetRootAsTableIndex(...)
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/fb/TableIndex.go:14
github.com/dgraph-io/badger/v4/table.(*Table).readTableIndex(0xc0006fc240)
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:707 +0x15e
github.com/dgraph-io/badger/v4/table.(*Table).initIndex(0xc0006fc240)
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:464 +0x19d
github.com/dgraph-io/badger/v4/table.(*Table).initBiggestAndSmallest(0xc0006fc240)
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:403 +0x7f
github.com/dgraph-io/badger/v4/table.OpenTable(0xc000b68260, {0x0, 0x1, 0x200000, 0x0, 0x0, 0x3f847ae147ae147b, 0x1000, 0x0, 0x0, ...})
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/table/table.go:309 +0x278
github.com/dgraph-io/badger/v4.newLevelsController.func1({0xc00080c000, 0x71}, {0x74?, 0x7272452e65736e6f?, 0x432e726f?})
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/levels.go:150 +0x1f9
created by github.com/dgraph-io/badger/v4.newLevelsController
        /Users/runner/go/pkg/mod/github.com/dgraph-io/badger/[email protected]/levels.go:129 +0x585

crash_2024-01-07T06_38_58.log (2.2 KB)

A post was merged into an existing topic: “Anytype Helper Crashed” after updating

@Angelo Hey, this might be a separate issue, or at least it might be worth investigating separately?