Skip to content

Panic due to internal folder context used on exported methods  #6664

@syncthing-sentry

Description

@syncthing-sentry

Sentry Issue: SYNCTHING-211

  File "/tmp/sync/lib/model/folder.go", line 243, in doInSync
    case <-f.ctx.Done():
  File "/tmp/sync/lib/model/folder_recvonly.go", line 67, in Revert
    f.doInSync(func() error { f.revert(); return nil })
  File "/tmp/sync/lib/model/model.go", line 2264, in Revert
    runner.Revert()

panic: runtime error: invalid memory address or nil pointer dereference

Since we get the context as an argument to serve, using that context in any exported method is racy. We should probably have a second context/channel for folder lifetime created in the constructor and cancelled in Stop, in addition to the current one for "serve lifetime".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions