Skip to content

近期遇到的2个报错:panic: runtime error: index out of range [0] with length 0 、panic: runtime error: index out of range [0] with length 0 [recovered] #129

@Herbert-555

Description

@Herbert-555

近期遇到的报错:
` panic: runtime error: index out of range [0] with length 0
panic:
goroutine 72 [running]:
encoding/json.(*encodeState).marshal.func1()
$GOROOT/src/encoding/json/encode.go:326 +0x6e
panic({0xa90c00, 0xc003dcf530})
$GOROOT/src/runtime/panic.gototal progressive: 0/ 1 [--------------------------------------------------------------------------------------------------------------------------] 1m8s
:884 +0x213total progressive: 0/ 1 [-------------------------------------------------------------------------------------------------------------------------] 1m13s
total progressive: 0/ 1 [--------------------------------------------------------------------------------------- ?, total progressive: 0/ 1 [---------------------------------------------------------------------------------------------------- 0x6total progressive: 0/ 1 [--------------------------------------------------------------------------------------------------------------------------] 1m8s
total progressive: 0/ 1 [----

total progressive: 0/ 1 [-------------------------------------------------------------------------------------------------------------------------] 1m13s
$GOROOT/src/encoding/json/encode.go:943 +total progressive: 0/ 1 [------------------------------------------------------------------------------------------------------------------------] 13m26s
total progressive: 0/ 1 [-------------------------------------------------------------------------------------------------------------------------] 1m13s
total progressive: 0/ 1 [--------------------------------------------------------------------------------------------------------------------------] 1m8s
0x21c
encoding/json.(*encodeState).reflectValue(0xc00095dda0?, {0xa8ad80?, 0xc00cc36c60?, 0x3ba620?}, {0xa0?, 0x85?})
$GOROOT/src/encoding/json/encode.go:358 +0x78
})
$GOROOT/src/encoding/json/encode.go:161total progressive: 0/ 1 [------------------------------------------------------------------------------------------------------------------------] 32m20s
+0xe5
github.com/chainreactors/parsers.(*SprayResult).ToJson(...)
pkg/mod/github.com/chainreactors/parsers@v0.0.0-20250605044448-6bc270f12c0e/spray.go:317`

`panic: runtime error: index out of range [0] with length 0 [recovered]-----------------------------------------------------------------------------] 3m22s

    :326 +0x6e

panic({total progressive: 0/ 1 [-------------------------------------------------------------------------------------------------------------------------] 31m5s $GOROOT/src/encoding/json/encode.go
0xa90c00, 0xc001d36d20})
$GOROOT/src/runtime/panic.go:884 +0x213
}total progressive: 0/ 1 [------------------ total progressive: 0/ 1 [------------------------------------------------------------------------------------------------------------------------] 12m12s
{0xa5?, total progressive: 0/ 1 [-------------------------------------------------------------------------------------------------------------------------] 31m6s
+0x21ctotal progressive: 0/ 1 [-------------------------------------------------------------------------------------------------------------------------] 3m23s
total progressive: 0/ 1 [------------------------------------------------------------------------------------------------------------------------] 12m12s

encoding/json.(*encodeState).reflectValue(0xc00d265da0?, {0xa8ad80?, 0xc0088d2480?, 0x3ba620?}, {0xa0?, 0x85?})
$GOROOT/src/encoding/json/encode.go:358 +0x78
encoding/json.(*encodeState).marshal(0x3865bd?, {0xa8ad80?, 0xc0088d2480?}, {0xb0?, 0xec?})
$GOROOT/src/encoding/json/encode.go:330 +0xfa
encoding/json.Marshal({0xa8ad80, 0xc0088d2480})
$GOROOT/src/encoding/json/encode.go:161 +0xe5
github.com/chainreactors/parsers.(*SprayResult).ToJson(...)
pkg/mod/github.com/chainreactors/parsers@v0.0.0-20250605044448-6bc270f12c0e/spray.go:317
github.com/chainreactors/spray/core.(*Runner).Output(0xc008276f20, 0xc0088de000)
/home/runner/work/spray/spray/core/runner.go:430 +0x267
github.com/chainreactors/spray/core.(*Runner).OutputHandler.func2()
/home/runner/work/spray/spray/core/runner.go:479 +0x29`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions