Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic caused by View.cleanup cleaning up View.buffer too eagerly #396

Open
erbridge opened this issue Sep 21, 2014 · 0 comments
Open

Panic caused by View.cleanup cleaning up View.buffer too eagerly #396

erbridge opened this issue Sep 21, 2014 · 0 comments

Comments

@erbridge
Copy link
Contributor

erbridge commented Sep 21, 2014

Captured by the comment here.

==================
WARNING: DATA RACE
Read by goroutine 11:
  github.com/limetext/lime/backend.(*WatchedUserFile).Name()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/watched.go:39 +0x74
  github.com/limetext/lime/backend.(*WatchedUserFile).Reload()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/watched.go:46 +0x15b
  github.com/limetext/lime/backend.func·004()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/editor.go:444 +0x17b
  github.com/limetext/lime/backend.(*Editor).observeFiles()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/editor.go:446 +0x1dc

Previous write by goroutine 64:
  github.com/limetext/lime/backend.(*View).cleanup()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/view.go:658 +0xc5
  github.com/limetext/lime/backend.(*View).parsethread()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/view.go:198 +0x2c3

Goroutine 11 (running) created at:
  github.com/limetext/lime/backend.GetEditor()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/editor.go:148 +0x6d8
  github.com/limetext/lime/backend.init·1()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/editor.go:24 +0x4b
  github.com/limetext/lime/backend.init()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/window.go:125 +0xa09
  github.com/limetext/lime/backend/commands.init()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/commands/window_test.go:52 +0xc5
  main.init()
      github.com/limetext/lime/backend/commands/_test/_testmain.go:134 +0x93

Goroutine 64 (finished) created at:
  github.com/limetext/lime/backend.newView()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/view.go:69 +0x1fe
  github.com/limetext/lime/backend.(*Window).NewFile()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/window.go:27 +0xa3
  github.com/limetext/lime/backend.(*Window).OpenFile()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/window.go:67 +0x45
  github.com/limetext/lime/backend/commands.TestSaveAs()
      /home/felix/devel/lime/src/github.com/limetext/lime/backend/commands/save_test.go:84 +0x34b
  testing.tRunner()
      /home/felix/.gvm/gos/go1.3.1/src/pkg/testing/testing.go:422 +0x10f
==================
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x40 pc=0x5816af]

goroutine 26 [running]:
runtime.panic(0x7953e0, 0xbb2653)
    /home/felix/.gvm/gos/go1.3.1/src/pkg/runtime/panic.c:279 +0xf5
github.com/limetext/lime/backend.(*WatchedUserFile).Name(0xc2080c00f0, 0x0, 0x0)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/watched.go:39 +0x9f
github.com/limetext/lime/backend.(*WatchedUserFile).Reload(0xc2080c00f0)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/watched.go:46 +0x15c
github.com/limetext/lime/backend.func·004()
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/editor.go:444 +0x17c
github.com/limetext/lime/backend.(*Editor).observeFiles(0xc208056000)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/editor.go:446 +0x1dd
created by github.com/limetext/lime/backend.GetEditor
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/editor.go:148 +0x6d8

goroutine 16 [chan receive]:
testing.RunTests(0x880dd0, 0xbb4060, 0x2c, 0x2c, 0x7f5a7347ee01)
    /home/felix/.gvm/gos/go1.3.1/src/pkg/testing/testing.go:505 +0xbb8
testing.Main(0x880dd0, 0xbb4060, 0x2c, 0x2c, 0xbda660, 0x0, 0x0, 0xbda660, 0x0, 0x0)
    /home/felix/.gvm/gos/go1.3.1/src/pkg/testing/testing.go:435 +0xa3
main.main()
    github.com/limetext/lime/backend/commands/_test/_testmain.go:133 +0xdd

goroutine 19 [finalizer wait]:
runtime.park(0x435b80, 0xbd65b0, 0xbb55a9)
    /home/felix/.gvm/gos/go1.3.1/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0xbd65b0, 0xbb55a9)
    /home/felix/.gvm/gos/go1.3.1/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /home/felix/.gvm/gos/go1.3.1/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /home/felix/.gvm/gos/go1.3.1/src/pkg/runtime/proc.c:1445

goroutine 21 [chan receive]:
github.com/quarnster/util/text.(*SerializedBuffer).worker(0xc2080240e8)
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:40 +0x89
created by github.com/quarnster/util/text.(*SerializedBuffer).init
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:26 +0xc0

goroutine 22 [runnable]:
github.com/howeyc/fsnotify.(*Watcher).readEvents(0xc20808a120)
    /home/felix/devel/lime/src/github.com/howeyc/fsnotify/fsnotify_linux.go:276 +0xb4a
created by github.com/howeyc/fsnotify.NewWatcher
    /home/felix/devel/lime/src/github.com/howeyc/fsnotify/fsnotify_linux.go:126 +0x372

goroutine 23 [chan send]:
github.com/howeyc/fsnotify.(*Watcher).purgeEvents(0xc20808a120)
    /home/felix/devel/lime/src/github.com/howeyc/fsnotify/fsnotify.go:44 +0x350
created by github.com/howeyc/fsnotify.NewWatcher
    /home/felix/devel/lime/src/github.com/howeyc/fsnotify/fsnotify_linux.go:127 +0x38a

goroutine 24 [chan receive]:
github.com/limetext/lime/backend/logger.(*Logger).handle(0xc208048060)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/logger/logger.go:32 +0x75
created by github.com/limetext/lime/backend/logger.NewLogger
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/logger/logger.go:27 +0xc4

goroutine 25 [chan receive]:
github.com/limetext/lime/backend.(*Editor).inputthread(0xc208056000)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/editor.go:364 +0x147
created by github.com/limetext/lime/backend.GetEditor
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/editor.go:147 +0x6ac

goroutine 311 [chan receive]:
github.com/quarnster/util/text.(*SerializedBuffer).worker(0xc2081ac878)
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:40 +0x89
created by github.com/quarnster/util/text.(*SerializedBuffer).init
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:26 +0xc0

goroutine 175 [chan receive]:
github.com/quarnster/util/text.(*SerializedBuffer).worker(0xc2081029d8)
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:40 +0x89
created by github.com/quarnster/util/text.(*SerializedBuffer).init
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:26 +0xc0

goroutine 172 [chan receive]:
github.com/quarnster/util/text.(*SerializedBuffer).worker(0xc208102928)
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:40 +0x89
created by github.com/quarnster/util/text.(*SerializedBuffer).init
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:26 +0xc0

goroutine 306 [chan receive]:
github.com/quarnster/util/text.(*SerializedBuffer).worker(0xc2081ac668)
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:40 +0x89
created by github.com/quarnster/util/text.(*SerializedBuffer).init
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:26 +0xc0

goroutine 225 [syscall]:
runtime.goexit()
    /home/felix/.gvm/gos/go1.3.1/src/pkg/runtime/proc.c:1445

goroutine 307 [chan receive]:
github.com/limetext/lime/backend.(*View).parsethread(0xc2082da400)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/view.go:190 +0x1a8
created by github.com/limetext/lime/backend.newView
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/view.go:69 +0x1fe

goroutine 310 [chan receive]:
github.com/limetext/lime/backend.(*View).parsethread(0xc2082da600)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/view.go:190 +0x1a8
created by github.com/limetext/lime/backend.newView
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/view.go:69 +0x1fe

goroutine 308 [chan receive]:
github.com/quarnster/util/text.(*SerializedBuffer).worker(0xc2081ac7c8)
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:40 +0x89
created by github.com/quarnster/util/text.(*SerializedBuffer).init
    /home/felix/devel/lime/src/github.com/quarnster/util/text/serialized_buffer.go:26 +0xc0

goroutine 305 [chan receive]:
github.com/limetext/lime/backend.(*View).parsethread(0xc2082da200)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/view.go:190 +0x1a8
created by github.com/limetext/lime/backend.newView
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/view.go:69 +0x1fe

goroutine 309 [runnable]:
regexp/syntax.(*Prog).Prefix(0xc2082e6930, 0xa0, 0x0, 0x0)
    /home/felix/.gvm/gos/go1.3.1/src/pkg/regexp/syntax/prog.go:149
regexp.compile(0x7c9370, 0x7, 0xd4, 0x7839b8, 0x0, 0x0)
    /home/felix/.gvm/gos/go1.3.1/src/pkg/regexp/regexp.go:175 +0x314
regexp.Compile(0x7c9370, 0x7, 0x19, 0x0, 0x0)
    /home/felix/.gvm/gos/go1.3.1/src/pkg/regexp/regexp.go:118 +0x5d
regexp.MustCompile(0x7c9370, 0x7, 0x0)
    /home/felix/.gvm/gos/go1.3.1/src/pkg/regexp/regexp.go:219 +0x50
github.com/limetext/lime/backend/util.PascalCaseToSnakeCase(0x7ced10, 0x7, 0x0, 0x0)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/util/case.go:13 +0x5a
github.com/limetext/lime/backend.(*commandHandler).init(0xc208056058, 0x7a3440, 0xc2080e1520, 0xc2082e68d0, 0x0, 0x0)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/commandhandler.go:60 +0x345
github.com/limetext/lime/backend.(*commandHandler).RunTextCommand(0xc208056058, 0xc2082da600, 0x7ed090, 0xe, 0xc2082e68d0, 0x0, 0x0)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/commandhandler.go:113 +0x3c3
github.com/limetext/lime/backend/commands.TestToggleSetting(0xc20821aea0)
    /home/felix/devel/lime/src/github.com/limetext/lime/backend/commands/settings_test.go:28 +0x42b
testing.tRunner(0xc20821aea0, 0xbb4360)
    /home/felix/.gvm/gos/go1.3.1/src/pkg/testing/testing.go:422 +0x110
created by testing.RunTests
    /home/felix/.gvm/gos/go1.3.1/src/pkg/testing/testing.go:504 +0xb46

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/4520363-panic-caused-by-view-cleanup-cleaning-up-view-buffer-too-eagerly?utm_campaign=plugin&utm_content=tracker%2F282001&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F282001&utm_medium=issues&utm_source=github).
@erbridge erbridge added the bug label Sep 21, 2014
@erbridge erbridge added the crash label Oct 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant