#608·go

it will panic fault when Marshal map (go version 1.18)

Author: goeoeoCreated Mar 17, 2022Updated Mar 10, 2025

func TestMarshal(t *testing.T) { m := make(map[string]string) m["a"] = "sss&aaa" s, _ := jsoniter.Marshal(m) fmt.Println(string(s)) }

//output === RUN TestMarshal unexpected fault address 0x0 fatal error: fault [signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x46327f]

goroutine 6 [running]: runtime.throw({0x5828e5?, 0xc000078ce8?}) /usr/local/go/src/runtime/panic.go:992 +0x71 fp=0xc000078c18 sp=0xc000078be8 pc=0x434fd1 runtime.sigpanic() /usr/local/go/src/runtime/signal_unix.go:825 +0x305 fp=0xc000078c68 sp=0xc000078c18 pc=0x44afc5