Skip to content

panic: nil pointer dereference because (*db.Lowlevel)getMetaAndCheck() returns nil #7005

Closed

Description

@tomasz1986

I have just noticed a panic log from ~1 week ago in my Syncthing home folder. I do not remember what might have caused the panic though, and Syncthing probably automatically recovered after that, so I had no idea until now. The operating system logs also do not show anything special taking place at that time.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x104a217]

goroutine 56 [running]:
github.com/syncthing/syncthing/lib/db.(*metadataTracker).devices(0x0, 0x0, 0x0, 0x0)
	github.com/syncthing/syncthing/lib/db/meta.go:407 +0x47
github.com/syncthing/syncthing/lib/db.(*FileSet).ListDevices(...)
	github.com/syncthing/syncthing/lib/db/set.go:433
github.com/syncthing/syncthing/lib/model.(*model).addAndStartFolderLockedWithIgnores(0x129000d0, 0x12c01ca0, 0xb, 0x12c01cb8, 0x8, 0x0, 0x12c01cd0, 0xb, 0x2, 0x12a46a80, ...)
	github.com/syncthing/syncthing/lib/model/model.go:311 +0x1ee
github.com/syncthing/syncthing/lib/model.(*model).addAndStartFolderLocked(0x129000d0, 0x12c01ca0, 0xb, 0x12c01cb8, 0x8, 0x0, 0x12c01cd0, 0xb, 0x2, 0x12a46a80, ...)
	github.com/syncthing/syncthing/lib/model/model.go:286 +0x12e
github.com/syncthing/syncthing/lib/model.(*model).newFolder(0x129000d0, 0x12c01ca0, 0xb, 0x12c01cb8, 0x8, 0x0, 0x12c01cd0, 0xb, 0x2, 0x12a46a80, ...)
	github.com/syncthing/syncthing/lib/model/model.go:515 +0x217
github.com/syncthing/syncthing/lib/model.(*model).onServe(0x129000d0)
	github.com/syncthing/syncthing/lib/model/model.go:252 +0x151
github.com/syncthing/syncthing/lib/model.(*model).Serve(0x129000d0)
	github.com/syncthing/syncthing/lib/model/model.go:235 +0x21
github.com/thejerf/suture.(*Supervisor).runService.func1(0x128d2460, 0x1, 0x334e6cc0, 0x129000d0)
	github.com/thejerf/[email protected]+incompatible/supervisor.go:600 +0x69
created by github.com/thejerf/suture.(*Supervisor).runService
	github.com/thejerf/[email protected]+incompatible/supervisor.go:588 +0x4b

Syncthing version was v1.10.0-rc.2.

Activity

  1. added
    bug
    needs-triage
    on Sep 25, 2020
  2. changed the title [-]invalid memory address or nil pointer dereference[/-] [+]panic: runtime error: invalid memory address or nil pointer dereference[/+] on Sep 25, 2020
  3. removed
    needs-triage
    on Sep 25, 2020
  4. calmh commented on Sep 25, 2020

    @calmh
    Member

    Yeah this can apparently happen because we can return a nil metadata object when there are database issues. Needs better error handling.

  5. changed the title [-]panic: runtime error: invalid memory address or nil pointer dereference[/-] [+]panic: nil pointer dereference because (*db.Lowlevel)getMetaAndCheck() returns nil[/+] on Sep 25, 2020
  6. imsodin commented on Dec 24, 2020

    @imsodin
    Member

    Fixed by #7150

  7. added this to the v1.13.0 milestone on Dec 24, 2020
  8. added
    frozen-due-to-age
    on Dec 26, 2021
  9. locked and limited conversation to collaborators on Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfrozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions