Env: Synology DS918+
System: DSM7.0
Binary: https://github.com/hacdias/webdav/releases/download/v4.1.0/linux-386-webdav.tar.gz
command: nohup ./webdav &
Use webdav as backend cloud storage for Joplin(a open source diary), when sync many files it frequently crash.
Bellow is stack info:
2021/08/12 10:40:20 192.168.0.146:53906 tried to verify account , username is [XXXX]
fatal error: concurrent map writes
fatal error: concurrent map writes
goroutine 35 [running]:
runtime.throw(0x84c3094, 0x15)
runtime/panic.go:1116 +0x6a fp=0xa4b1c34 sp=0xa4b1c20 pc=0x807723a
runtime.mapassign_faststr(0x845ea80, 0xa49aa60, 0xa49c4a0, 0x1d, 0x87a6e60)
runtime/map_faststr.go:291 +0x358 fp=0xa4b1c70 sp=0xa4b1c34 pc=0x8057b18
github.com/hacdias/webdav/v3/lib.(*Config).ServeHTTP(0xa580ec0, 0x855a640, 0xa4e8140, 0xa4da380)
github.com/hacdias/webdav/v3/lib/webdav.go:103 +0x3c3 fp=0xa4b1d90 sp=0xa4b1c70 pc=0x82fe963
net/http.serverHandler.ServeHTTP(0xa5ae750, 0x855a640, 0xa4e8140, 0xa4da380)
net/http/server.go:2843 +0x7f fp=0xa4b1da4 sp=0xa4b1d90 pc=0x82a9ccf
net/http.(*conn).serve(0xa5de060, 0x855af20, 0xa49b740)
net/http/server.go:1925 +0x7b8 fp=0xa4b1fe0 sp=0xa4b1da4 pc=0x82a64d8
runtime.goexit()
runtime/asm_386.s:1333 +0x1 fp=0xa4b1fe4 sp=0xa4b1fe0 pc=0x80a50d1
created by net/http.(*Server).Serve
net/http/server.go:2969 +0x2b9
goroutine 1 [chan receive]:
main.main()
command-line-arguments/main.go:26 +0x104
goroutine 18 [select]:
github.com/hacdias/webdav/v3/lib.LastRequestLogIndex(0x855af20, 0xa49b220)
github.com/hacdias/webdav/v3/lib/log.go:17 +0x2a4
created by main.main
command-line-arguments/main.go:20 +0x5d
goroutine 19 [IO wait]:
internal/poll.runtime_pollWait(0xe7441f28, 0x72, 0x0)
runtime/netpoll.go:222 +0x4b
internal/poll.(*pollDesc).wait(0xa5c20b4, 0x72, 0x0, 0x0, 0x84bce69)
internal/poll/fd_poll_runtime.go:87 +0x37
internal/poll.(*pollDesc).waitRead(...)
internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xa5c20a0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
internal/poll/fd_unix.go:394 +0x1ae
net.(*netFD).accept(0xa5c20a0, 0x0, 0x87a6e60, 0xa5a8238)
net/fd_unix.go:172 +0x27
net.(*TCPListener).accept(0xa5b6230, 0xa5de100, 0x148a1400, 0x8080cfd)
net/tcpsock_posix.go:139 +0x27
net.(*TCPListener).Accept(0xa5b6230, 0xa46de1c, 0xc, 0xa4829a0, 0x82aa099)
net/tcpsock.go:261 +0x57
net/http.(*Server).Serve(0xa5ae750, 0x855a500, 0xa5b6230, 0x0, 0x0)
net/http/server.go:2937 +0x1eb
net/http.Serve(...)
net/http/server.go:2498
github.com/hacdias/webdav/v3/cmd.glob..func1(0x87a2520, 0x87bb674, 0x0, 0x0)
github.com/hacdias/webdav/v3/cmd/root.go:80 +0x33f
github.com/spf13/cobra.(*Command).execute(0x87a2520, 0xa496118, 0x0, 0x0, 0x87a2520, 0xa496118)
github.com/spf13/[email protected]/command.go:856 +0x1e0
github.com/spf13/cobra.(*Command).ExecuteC(0x87a2520, 0x0, 0x0, 0x0)
github.com/spf13/[email protected]/command.go:960 +0x297
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:897
github.com/hacdias/webdav/v3/cmd.Execute()
github.com/hacdias/webdav/v3/cmd/cmd.go:9 +0x23
created by main.main
command-line-arguments/main.go:21 +0x73
goroutine 33 [syscall]:
os/signal.signal_recv(0x0)
runtime/sigqueue.go:147 +0x12f
os/signal.loop()
os/signal/signal_unix.go:23 +0x1a
created by os/signal.Notify.func1.1
os/signal/signal.go:150 +0x33
goroutine 34 [IO wait]:
internal/poll.runtime_pollWait(0xe7441e90, 0x77, 0xffffffff)
runtime/netpoll.go:222 +0x4b
internal/poll.(*pollDesc).wait(0xa5c2104, 0x77, 0x0, 0xed06d, 0xffffffff)
internal/poll/fd_poll_runtime.go:87 +0x37
internal/poll.(*pollDesc).waitWrite(...)
internal/poll/fd_poll_runtime.go:96
internal/poll.SendFile(0xa5c20f0, 0x8, 0xed06d, 0x0, 0x0, 0x0, 0x0, 0x0)
internal/poll/sendfile_linux.go:42 +0x228
net.sendFile.func1(0x8, 0x72)
net/sendfile_linux.go:42 +0x46
internal/poll.(*FD).RawRead(0xa4b9280, 0xa49b700, 0x0, 0x0)
internal/poll/fd_unix.go:530 +0xbf
os.(*rawConn).Read(0xa497040, 0xa49b700, 0x837dd096, 0x0)
os/rawconn.go:31 +0x49
net.sendFile(0xa5c20f0, 0x8556380, 0xa496918, 0x0, 0x0, 0x0, 0x0, 0x100)
net/sendfile_linux.go:41 +0x13e
net.(*TCPConn).readFrom(0xa5845a8, 0x8556380, 0xa4a8380, 0x8000106, 0x0, 0xffffffff, 0x82a06b0)
net/tcpsock_posix.go:51 +0x72
net.(*TCPConn).ReadFrom(0xa5845a8, 0x8556380, 0xa4a8380, 0xc, 0xa4fc1cc, 0x87bb601, 0x0)
net/tcpsock.go:103 +0x3f
net/http.(*response).ReadFrom(0xa4e80a0, 0x8556380, 0xa4a8380, 0x0, 0x0, 0x0, 0x0)
net/http/server.go:615 +0x23d
io.copyBuffer(0x8556700, 0xa4e80a0, 0x8556380, 0xa4a8380, 0x0, 0x0, 0x0, 0x8050f99, 0x8469c80, 0x84ab020, ...)
io/io.go:395 +0x298
io.Copy(...)
io/io.go:368
io.CopyN(0x8556700, 0xa4e80a0, 0x85567e0, 0xa496918, 0xff0e5, 0x0, 0x0, 0x0, 0x0, 0x0)
io/io.go:344 +0x8e
net/http.serveContent(0x855a640, 0xa4e80a0, 0xa4da280, 0xa494145, 0x2a, 0x8c38f95, 0x0, 0xd8a5eea9, 0xe, 0x87a6e60, ...)
net/http/fs.go:300 +0x23f
net/http.ServeContent(0x855a640, 0xa4e80a0, 0xa4da280, 0xa494145, 0x2a, 0x8c38f95, 0x0, 0xd8a5eea9, 0xe, 0x87a6e60, ...)
net/http/fs.go:167 +0x98
golang.org/x/net/webdav.(*Handler).handleGetHeadPost(0xa582340, 0x855a640, 0xa4e80a0, 0xa4da280, 0xc8, 0x0, 0x0)
golang.org/x/[email protected]/webdav/webdav.go:219 +0x360
golang.org/x/net/webdav.(*Handler).ServeHTTP(0xa582340, 0x855a640, 0xa4e80a0, 0xa4da280)
golang.org/x/[email protected]/webdav/webdav.go:53 +0x94
github.com/hacdias/webdav/v3/lib.(*Config).ServeHTTP(0xa580ec0, 0x855a640, 0xa4e80a0, 0xa4da280)
github.com/hacdias/webdav/v3/lib/webdav.go:159 +0x61e
net/http.serverHandler.ServeHTTP(0xa5ae750, 0x855a640, 0xa4e80a0, 0xa4da280)
net/http/server.go:2843 +0x7f
net/http.(*conn).serve(0xa5de000, 0x855af20, 0xa49b280)
net/http/server.go:1925 +0x7b8
created by net/http.(*Server).Serve
net/http/server.go:2969 +0x2b9
goroutine 21 [IO wait]:
internal/poll.runtime_pollWait(0xe7441e90, 0x72, 0x85573c0)
runtime/netpoll.go:222 +0x4b
internal/poll.(*pollDesc).wait(0xa5c2104, 0x72, 0x8557300, 0x87621ac, 0x0)
internal/poll/fd_poll_runtime.go:87 +0x37
internal/poll.(*pollDesc).waitRead(...)
internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xa5c20f0, 0xa49b2ad, 0x1, 0x1, 0x0, 0x0, 0x0)
internal/poll/fd_unix.go:159 +0x170
net.(*netFD).Read(0xa5c20f0, 0xa49b2ad, 0x1, 0x1, 0x0, 0x0, 0x0)
net/fd_posix.go:55 +0x3f
net.(*conn).Read(0xa5845a8, 0xa49b2ad, 0x1, 0x1, 0x0, 0x0, 0x0)
net/net.go:182 +0x67
net/http.(*connReader).backgroundRead(0xa49b2a0)
net/http/server.go:690 +0x46
created by net/http.(*connReader).startBackgroundRead
net/http/server.go:686 +0xb0
goroutine 36 [running]:
goroutine running on other thread; stack unavailable
created by net/http.(*Server).Serve
net/http/server.go:2969 +0x2b9
goroutine 22 [runnable]:
net/http.(*connReader).backgroundRead(0xa49b760)
net/http/server.go:689
created by net/http.(*connReader).startBackgroundRead
net/http/server.go:686 +0xb0
goroutine 37 [runnable]:
net/http.(*connReader).backgroundRead(0xa5825a0)
net/http/server.go:689
created by net/http.(*connReader).startBackgroundRead
net/http/server.go:686 +0xb0
goroutine 36 [running]:
runtime.throw(0x84c3094, 0x15)
runtime/panic.go:1116 +0x6a fp=0xa5e6c34 sp=0xa5e6c20 pc=0x807723a
runtime.mapassign_faststr(0x845ea80, 0xa49aa60, 0xa5ac680, 0x1d, 0x87a6e60)
runtime/map_faststr.go:291 +0x358 fp=0xa5e6c70 sp=0xa5e6c34 pc=0x8057b18
github.com/hacdias/webdav/v3/lib.(*Config).ServeHTTP(0xa580ec0, 0x855a640, 0xa5ec000, 0xa5c6080)
github.com/hacdias/webdav/v3/lib/webdav.go:103 +0x3c3 fp=0xa5e6d90 sp=0xa5e6c70 pc=0x82fe963
net/http.serverHandler.ServeHTTP(0xa5ae750, 0x855a640, 0xa5ec000, 0xa5c6080)
net/http/server.go:2843 +0x7f fp=0xa5e6da4 sp=0xa5e6d90 pc=0x82a9ccf
net/http.(*conn).serve(0xa5de0c0, 0x855af20, 0xa582580)
net/http/server.go:1925 +0x7b8 fp=0xa5e6fe0 sp=0xa5e6da4 pc=0x82a64d8
runtime.goexit()
runtime/asm_386.s:1333 +0x1 fp=0xa5e6fe4 sp=0xa5e6fe0 pc=0x80a50d1
created by net/http.(*Server).Serve
net/http/server.go:2969 +0x2b9