#298·go

panic sometimes....

Author: h-hyCreated Aug 9, 2018Updated Mar 10, 2025

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x57b364]

goroutine 22 [running]: github.com/json-iterator/go.(*Stream).WriteStringWithHTMLEscaped(0xc4202fec60, 0x0, 0x36) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_stream_string.go:235 +0x94 github.com/json-iterator/go.(*htmlEscapedStringEncoder).Encode(0x16d4000, 0xc4210e4ea8, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_config.go:182 +0x41 github.com/json-iterator/go.(*structFieldEncoder).Encode(0xc4203049c0, 0xc4210e4d20, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect_object.go:118 +0x5c github.com/json-iterator/go.(*structEncoder).Encode(0xc420304fc0, 0xc4210e4d20, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect_object.go:155 +0xd5 github.com/json-iterator/go.(*OptionalEncoder).Encode(0xc420794a20, 0xc420774480, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect.go:124 +0x4f github.com/json-iterator/go.(*structFieldEncoder).Encode(0xc420782b40, 0xc420774480, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect_object.go:118 +0x5c github.com/json-iterator/go.(*structEncoder).Encode(0xc420782c20, 0xc420774480, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect_object.go:155 +0xd5 github.com/json-iterator/go.(*structEncoder).EncodeInterface(0xc420782c20, 0xd6eaa0, 0xc420774480, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect_object.go:175 +0x146 github.com/json-iterator/go.(*Stream).WriteVal(0xc4202fec60, 0xd6eaa0, 0xc420774480) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect.go:252 +0xe4 github.com/json-iterator/go.(*emptyInterfaceCodec).Encode(0x16d4000, 0xc42021c538, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect_native.go:369 +0x41 github.com/json-iterator/go.(*structFieldEncoder).Encode(0xc42032d560, 0xc42021c500, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect_object.go:118 +0x5c github.com/json-iterator/go.(*structEncoder).Encode(0xc42032d6a0, 0xc42021c500, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect_object.go:155 +0xd5 github.com/json-iterator/go.(*OptionalEncoder).Encode(0xc420011520, 0xc4201f1838, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect.go:124 +0x4f github.com/json-iterator/go.WriteToStream(0xccfd00, 0xc42021c500, 0xc4202fec60, 0x1671220, 0xc420011520) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect.go:47 +0xd2 github.com/json-iterator/go.(*OptionalEncoder).EncodeInterface(0xc420011520, 0xccfd00, 0xc42021c500, 0xc4202fec60) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect.go:129 +0x55 github.com/json-iterator/go.(*Stream).WriteVal(0xc4202fec60, 0xccfd00, 0xc42021c500) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_reflect.go:252 +0xe4 github.com/json-iterator/go.(*frozenConfig).Marshal(0xc420096280, 0xccfd00, 0xc42021c500, 0x0, 0x0, 0x0, 0x0, 0x0) /home/gitlab-runner/sy_go/src/github.com/json-iterator/go/feature_config.go:262 +0xd6 public/syLog.init.1.func1(0xc42006c480) /home/gitlab-runner/sy_go/src/public/syLog/log.go:69 +0xba created by public/syLog.init.1 /home/gitlab-runner/sy_go/src/public/syLog/log.go:63 +0x6d