Pls help, concurrent map iteration and map write, can any one solve my question? #1161
Unanswered
tutengdihuang
asked this question in
Q&A
Replies: 2 comments
-
This is probably an issue with your application, and not Zap itself. Is there a link where we can view your application's code? |
Beta Was this translation helpful? Give feedback.
0 replies
-
+1 to what @mway said.
Looking at the trace, what's likely happening is that you're attempting to log a map with Zap in logic.go, line 736, at the same time it's being modified elsewhere. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
fatal error: concurrent map iteration and map write
goroutine 3296083 [running]:
runtime.throw({0xdb872e, 0x464339})
/usr/local/go/src/runtime/panic.go:1198 +0x71 fp=0xc009de0ca0 sp=0xc009de0c70 pc=0x437291
runtime.mapiternext(0x19)
/usr/local/go/src/runtime/map.go:858 +0x4eb fp=0xc009de0d10 sp=0xc009de0ca0 pc=0x41158b
reflect.mapiternext(0x15)
/usr/local/go/src/runtime/map.go:1346 +0x19 fp=0xc009de0d28 sp=0xc009de0d10 pc=0x464279
reflect.(*MapIter).Next(0xc009a27600)
/usr/local/go/src/reflect/value.go:1631 +0x99 fp=0xc009de0d48 sp=0xc009de0d28 pc=0x4b13b9
internal/fmtsort.Sort({0xc88ae0, 0xc00526b260, 0x0})
/usr/local/go/src/internal/fmtsort/sort.go:63 +0x159 fp=0xc009de0e08 sp=0xc009de0d48 pc=0x4c1b19
fmt.(*pp).printValue(0xc00c3e6b60, {0xc88ae0, 0xc00526b260, 0x44a3f9}, 0x76, 0x0)
/usr/local/go/src/fmt/print.go:769 +0x445 fp=0xc009de0ff0 sp=0xc009de0e08 pc=0x4f9045
fmt.(*pp).printArg(0xc00c3e6b60, {0xc88ae0, 0xc00526b260}, 0x76)
/usr/local/go/src/fmt/print.go:712 +0x74c fp=0xc009de1090 sp=0xc009de0ff0 pc=0x4f8b6c
fmt.(*pp).doPrintf(0xc00c3e6b60, {0xdc200b, 0x33}, {0xc009de1c18, 0x40eb94, 0x7ffa88c23108})
/usr/local/go/src/fmt/print.go:1026 +0x288 fp=0xc009de1188 sp=0xc009de1090 pc=0x4fb368
fmt.Sprintf({0xdc200b, 0x33}, {0xc009de1c18, 0x6, 0x6})
/usr/local/go/src/fmt/print.go:219 +0x59 fp=0xc009de11e0 sp=0xc009de1188 pc=0x4f5779
go.uber.org/zap.getMessage({0xdc200b, 0xc009de1248}, {0xc009de1c18, 0x10, 0xc4ab80})
/go/src/market-service/vendor/go.uber.org/zap/sugar.go:238 +0x74 fp=0xc009de1218 sp=0xc009de11e0 pc=0x8a14f4
go.uber.org/zap.(*SugaredLogger).log(0xc000010688, 0x2, {0xdc200b, 0x33}, {0xc009de1c18, 0x6, 0x6}, {0x0, 0x0, 0x0})
/go/src/market-service/vendor/go.uber.org/zap/sugar.go:225 +0x9d fp=0xc009de1258 sp=0xc009de1218 pc=0x8a13bd
go.uber.org/zap.(*SugaredLogger).Errorf(...)
/go/src/market-service/vendor/go.uber.org/zap/sugar.go:148
market-service/src/swapboxes.(*SwapBoxes).MainLogic(0xc00012e240)
/go/src/market-service/src/swapboxes/logic.go:736 +0x8a5 fp=0xc009de1fa8 sp=0xc009de1258 pc=0xba5905
market-service/src/swapboxes.(*SwapBoxes).MainLogic-fm()
/go/src/market-service/src/swapboxes/logic.go:734 +0x26 fp=0xc009de1fc0 sp=0xc009de1fa8 pc=0xbb09e6
market-service/com/utils.(*PoolFunc).AddFunc.func1()
/go/src/market-service/com/utils/pool_func.go:53 +0x3f fp=0xc009de1fe0 sp=0xc009de1fc0 pc=0x8d3ddf
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc009de1fe8 sp=0xc009de1fe0 pc=0x46a301
created by market-service/com/utils.(*PoolFunc).AddFunc
/go/src/market-service/com/utils/pool_func.go:47 +0x5b
Beta Was this translation helpful? Give feedback.
All reactions