Skip to content

It will crash if multiple people use it #322

@qq22327635

Description

@qq22327635

My project uses the game gateway service built by wamp. It will report an error when multiple people use it.

fatal error: concurrent map iteration and map write
Error message

goroutine 250 [running]:
github.com/ugorji/go/codec.fastpathT.EncMapStringIntfV({}, 0xc00034c720, 0xc0000b8848)
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/codec/fast-path.generated.go:1023 +0x185
github.com/ugorji/go/codec.(*Encoder).fastpathEncMapStringIntfR(0xc00058da50?, 0xc0005b9a00?, {0x75d000?, 0xc00034c720?, 0xc000009f80?})
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/codec/fast-path.generated.go:996 +0x78
github.com/ugorji/go/codec.(*basicHandleRuntimeState).fnLoad.func3(0x18?, 0x8d3c68?, {0x768040?, 0xc00034c720?, 0x269f32ea428?})
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/codec/helper.go:1194 +0x5c
github.com/ugorji/go/codec.(*Encoder).encodeValue(0xc0000b8848, {0x768040?, 0xc00034c720?, 0xc0005b9c20?}, 0x0)
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/codec/encode.go:1340 +0x3cd
github.com/ugorji/go/codec.(*Encoder).encode(0xc0000b8848, {0x768040, 0xc00034c720})
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/codec/encode.go:1272 +0x8c8
github.com/ugorji/go/codec.fastpathT.EncSliceIntfV({}, {0xc000496640, 0x5, 0x73c920?}, 0xc0000b8848)
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/codec/fast-path.generated.go:643 +0x5a
github.com/ugorji/go/codec.fastpathEncodeTypeSwitch({0x73c920?, 0xc000008990?}, 0xc000008990?)
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/codec/fast-path.generated.go:171 +0x2a5
github.com/ugorji/go/codec.(*Encoder).encode(0xc0000b8848, {0x73c920, 0xc000008990})
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/codec/encode.go:1271 +0x8a9
github.com/ugorji/go/codec.(*Encoder).MustEncode(0xc0000b8848, {0x73c920?, 0xc000008990?})
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/codec/encode.go:1149 +0x50
github.com/ugorji/go/codec.(*Encoder).Encode(0xc000496640?, {0x73c920?, 0xc000008990?})
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/codec/encode.go:1135 +0x6c
github.com/gammazero/nexus/v3/transport/serialize.(*MessagePackSerializer).Serialize(0xc0005b9f18?, {0x8c7540, 0xc00044ab40})
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/nexus/transport/serialize/msgpackserializer.go:34 +0x79
github.com/gammazero/nexus/v3/transport.(*websocketPeer).sendHandlerKeepAlive(0xc0000e4e10, 0xdf8475800)
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/nexus/transport/websocketpeer.go:353 +0x428
created by github.com/gammazero/nexus/v3/transport.NewWebsocketPeer in goroutine 247
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/nexus/transport/websocketpeer.go:224 +0x34c

goroutine 1 [chan receive, 9 minutes]:
main.main()
/Users/huangyunjian/code/aa/dd/go服务端/wamp_host/main.go:215 +0xab4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions