Hang in go.(*Iterator).loadMore
secsys-go opened this issue · 1 comments
secsys-go commented
We used the Fuzz engine to modify some Test(Test_append_skip_and_return_bytes_with_reader) data, and then the following timeout appeared. We hope to get the help of the developer to confirm whether it is a real bug.
Simplified Test Code
var1 := `[ {"a : [{"stream": "c"}], "d": 102 }, "stream"]`
var2 := 0
iter := jsoniter.Parse(jsoniter.ConfigDefault, bytes.NewBufferString(var1), var2)
iter.ReadArray()log
panic: test timed out after 30s
goroutine 20 [running]:
testing.(*M).startAlarm.func1()
/home/zjx/.local/go/src/testing/testing.go:1790 +0x8e
created by time.goFunc
/home/zjx/.local/go/src/time/sleep.go:180 +0x31
goroutine 1 [chan receive]:
testing.(*T).Run(0xc00018fba0, {0x6366dc, 0x46b0f3}, 0x64afe0)
/home/zjx/.local/go/src/testing/testing.go:1309 +0x375
testing.runTests.func1(0xc00018fba0)
/home/zjx/.local/go/src/testing/testing.go:1600 +0x6e
testing.tRunner(0xc00018fba0, 0xc00020bd18)
/home/zjx/.local/go/src/testing/testing.go:1261 +0x102
testing.runTests(0xc000200100, {0x7e9ea0, 0xe, 0xe}, {0x47f44d, 0x638b5b, 0x7efa80})
/home/zjx/.local/go/src/testing/testing.go:1598 +0x43f
testing.(*M).Run(0xc000200100)
/home/zjx/.local/go/src/testing/testing.go:1506 +0x51d
main.main()
_testmain.go:73 +0x14b
goroutine 19 [runnable]:
bytes.(*Buffer).Read(0xc0001fc510, {0x81f070, 0x0, 0x0})
/home/zjx/.local/go/src/bytes/buffer.go:297 +0xff
github.com/json-iterator/go.(*Iterator).loadMore(0xc000246090)
/home/zjx/workspace/gowork/src/purelib/go/iter.go:266 +0x190
github.com/json-iterator/go.(*Iterator).nextToken(0xc000246090)
/home/zjx/workspace/gowork/src/purelib/go/iter.go:193 +0x2f
github.com/json-iterator/go.(*Iterator).ReadArray(0xc000246090)
/home/zjx/workspace/gowork/src/purelib/go/iter_array.go:5 +0x25
github.com/json-iterator/go/skip_tests.FuzzTest_append_skip_and_return_bytes_with_reader({0xc000220000, 0x40, 0x200})
/home/zjx/workspace/gowork/src/purelib/go/skip_tests/jsoniter_skip_test.go_Test_append_skip_and_return_bytes_with_reader_test.go:35 +0x28b
Version
JingxuanC commented
your json format is wrong.
try : [ {"a ": [{"stream": "c"}], "d": 102 }, "stream"]