gopherjs / gopherjs/gopherjs

Concurrent map write in serveCommandFileSystem.Open

Open
#895 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
13.2k
Forks
573
PR merge metrics
No merged PRs in 30d

Description

fatal error: concurrent map writes

goroutine 18 [running]:
runtime.throw(0x15a5217, 0x15)
        /usr/local/Cellar/go/1.11.1/libexec/src/runtime/panic.go:608 +0x72 fp=0xc003721838 sp=0xc003721808 pc=0x102c112
runtime.mapassign_faststr(0x1503240, 0xc000168ae0, 0xc0008997c8, 0x8, 0x4)
        /usr/local/Cellar/go/1.11.1/libexec/src/runtime/map_faststr.go:275 +0x3bf fp=0xc0037218a0 sp=0xc003721838 pc=0x1013d9f
main.serveCommandFileSystem.Open.func1(0xc000168e40, 0xc0001a8230, 0xc003721af0, 0x159d185, 0x1, 0x0, 0x0, 0xc00015c200, 0xc00015c4c0, 0x3, ...)
        /Users/mlnc/pkg/mod/github.com/gopherjs/gopherjs@v0.0.0-20181103185306-d547d1d9531e/tool.go:610 +0x3aa fp=0xc003721960 sp=0xc0037218a0 pc=0x149458a
main.serveCommandFileSystem.Open(0x0, 0x0, 0xc00015c200, 0xc00015c4c0, 0x3, 0x4, 0xc000168ae0, 0xc000196104, 0x5, 0x102b701, ...)
        /Users/mlnc/pkg/mod/github.com/gopherjs/gopherjs@v0.0.0-20181103185306-d547d1d9531e/tool.go:613 +0x9d4 fp=0xc003721b78 sp=0xc003721960 pc=0x148d5f4
main.(*serveCommandFileSystem).Open(0xc00015c500, 0xc000196104, 0x5, 0x1099588, 0xc000182380, 0x0, 0x0)
        <autogenerated>:1 +0x79 fp=0xc003721bf0 sp=0xc003721b78 pc=0x14952a9
net/http.serveFile(0x166e720, 0xc0002ca000, 0xc000192400, 0x16694a0, 0xc00015c500, 0xc000196104, 0x5, 0xc000168d01)
        /usr/local/Cellar/go/1.11.1/libexec/src/net/http/fs.go:551 +0xad fp=0xc003721ce8 sp=0xc003721bf0 pc=0x131d12d
net/http.(*fileHandler).ServeHTTP(0xc00016a310, 0x166e720, 0xc0002ca000, 0xc000192400)
        /usr/local/Cellar/go/1.11.1/libexec/src/net/http/fs.go:723 +0xa1 fp=0xc003721d48 sp=0xc003721ce8 pc=0x131de21
net/http.serverHandler.ServeHTTP(0xc000199110, 0x166e720, 0xc0002ca000, 0xc000192400)
        /usr/local/Cellar/go/1.11.1/libexec/src/net/http/server.go:2741 +0xab fp=0xc003721d78 sp=0xc003721d48 pc=0x135cf5b
net/http.(*conn).serve(0xc00019cb40, 0x166efa0, 0xc00015c600)
        /usr/local/Cellar/go/1.11.1/libexec/src/net/http/server.go:1847 +0x646 fp=0xc003721fc8 sp=0xc003721d78 pc=0x1359326
runtime.goexit()
        /usr/local/Cellar/go/1.11.1/libexec/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc003721fd0 sp=0xc003721fc8 pc=0x1058af1
created by net/http.(*Server).Serve
        /usr/local/Cellar/go/1.11.1/libexec/src/net/http/server.go:2851 +0x2f5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in tool.go around lines 610-613, where the stack trace identifies serveCommandFileSystem.Open and the concurrent map write. Reproduce concurrent file-serving requests and inspect the map access there; done means concurrent opens no longer trigger the reported fatal error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.