Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kuiper crash panic: runtime error: index out of range [1] with length 1 #438

Closed
dmocek opened this issue Aug 24, 2020 · 4 comments
Closed
Assignees

Comments

@dmocek
Copy link

dmocek commented Aug 24, 2020

I was trying to delete a rule and I received this from kuiper in the logs before it crashed. Possibly it was trying to process the delete rule.

panic: runtime error: index out of range [1] with length 1

goroutine 800 [running]:
internal/fmtsort.Sort(0xd55f40, 0xc00041bfc0, 0x195, 0xc000000001)
/usr/local/go/src/internal/fmtsort/sort.go:60 +0x311
fmt.(*pp).printValue(0xc00008c000, 0xd55f40, 0xc00041bfc0, 0x195, 0x76, 0x2)
/usr/local/go/src/fmt/print.go:773 +0xd18
fmt.(*pp).printValue(0xc00008c000, 0xd74460, 0xc00041bfb0, 0x199, 0xc000000076, 0x1)
/usr/local/go/src/fmt/print.go:810 +0x1b45
fmt.(*pp).printValue(0xc00008c000, 0xd6cde0, 0xc00041bfb0, 0x16, 0x76, 0x0)
/usr/local/go/src/fmt/print.go:880 +0x194a
fmt.(*pp).printArg(0xc00008c000, 0xd6cde0, 0xc00041bfb0, 0xc000000076)
/usr/local/go/src/fmt/print.go:716 +0x2b4
fmt.(*pp).doPrintf(0xc00008c000, 0xde8399, 0x1b, 0xc0003ed8e0, 0x2, 0x2)
/usr/local/go/src/fmt/print.go:1030 +0x15b
fmt.Sprintf(0xde8399, 0x1b, 0xc0003ed8e0, 0x2, 0x2, 0xc000139500, 0x7f96c0e016d0)
/usr/local/go/src/fmt/print.go:219 +0x66
github.com/sirupsen/logrus.(*Entry).Logf(0xc000255b90, 0xc000000005, 0xde8399, 0x1b, 0xc0003ed8e0, 0x2, 0x2)
/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:314 +0x7a
github.com/sirupsen/logrus.(*Entry).Debugf(0xc000255b90, 0xde8399, 0x1b, 0xc0003ed8e0, 0x2, 0x2)
/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:323 +0x65
github.com/emqx/kuiper/xstream/nodes.(*SourceNode).Open.func1.1(0xc00009ebe0, 0xc0002f4120, 0xed8080, 0xc0002ea4b0, 0xed8100, 0xc000255b90, 0xc0002324b0, 0xc0003ba178, 0x0)
/go/kuiper/xstream/nodes/source_node.go:134 +0x4e7
created by github.com/emqx/kuiper/xstream/nodes.(*SourceNode).Open.func1
/go/kuiper/xstream/nodes/source_node.go:80 +0x262

@dmocek
Copy link
Author

dmocek commented Aug 24, 2020

It crashed on me again, this time I wasn't doing anything:
time="2020-08-24T18:36:21Z" level=debug msg="receive message {"id":"8180f4ed-0322-4669-ab1b-5bb6667bd4f6","device":"Random-Integer-Device","origin":1598294181678191521,"readings":[{"id":"8bb6aa2f-de28-459f-9ea1-a1e35864f841","origin":1598294181669626894,"device":"Random-Integer-Device","name":"Int8","value":"8","valueType":"Int8"}]} from device Random-Integer-Device" file="edgex_source.go:143" rule="Test EdgeX Rule"
time="2020-08-24T18:36:21Z" level=debug msg="name Int8 with type INT8" file="edgex_source.go:197" rule="Test EdgeX Rule"
time="2020-08-24T18:36:21Z" level=debug msg="send data to device node" file="edgex_source.go:174" rule="Test EdgeX Rule"
time="2020-08-24T18:36:21Z" level=debug msg="broadcasting from edgex" file="common_func.go:20" rule="Test EdgeX Rule"
time="2020-08-24T18:36:21Z" level=debug msg="broadcast from edgex to preprocessor_edgex done" file="common_func.go:17" rule="Test EdgeX Rule"
time="2020-08-24T18:36:21Z" level=debug msg="preprocessor receive map[Int8:%!s(int=8)]" file="preprocessor.go:51" rule="Test EdgeX Rule"
time="2020-08-24T18:36:21Z" level=debug msg="broadcast from preprocessor_edgex to project done" file="common_func.go:17" rule="Test EdgeX Rule"
panic: runtime error: index out of range [2] with length 2

goroutine 690 [running]:
internal/fmtsort.Sort(0xd55f40, 0xc0005a9180, 0x195, 0xc000000001)
/usr/local/go/src/internal/fmtsort/sort.go:60 +0x311
fmt.(*pp).printValue(0xc0005e6270, 0xd55f40, 0xc0005a9180, 0x195, 0x76, 0x2)
/usr/local/go/src/fmt/print.go:773 +0xd18
fmt.(*pp).printValue(0xc0005e6270, 0xd74460, 0xc0005a9170, 0x199, 0xc000000076, 0x1)
/usr/local/go/src/fmt/print.go:810 +0x1b45
fmt.(*pp).printValue(0xc0005e6270, 0xd6cde0, 0xc0005a9170, 0x16, 0x76, 0x0)
/usr/local/go/src/fmt/print.go:880 +0x194a
fmt.(*pp).printArg(0xc0005e6270, 0xd6cde0, 0xc0005a9170, 0xc000000076)
/usr/local/go/src/fmt/print.go:716 +0x2b4
fmt.(*pp).doPrintf(0xc0005e6270, 0xde8399, 0x1b, 0xc0003028e0, 0x2, 0x2)
/usr/local/go/src/fmt/print.go:1030 +0x15b
fmt.Sprintf(0xde8399, 0x1b, 0xc0003028e0, 0x2, 0x2, 0xc000052700, 0x7f4f7473e008)
/usr/local/go/src/fmt/print.go:219 +0x66
github.com/sirupsen/logrus.(*Entry).Logf(0xc00042a5b0, 0xc000000005, 0xde8399, 0x1b, 0xc0003028e0, 0x2, 0x2)
/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:314 +0x7a
github.com/sirupsen/logrus.(*Entry).Debugf(0xc00042a5b0, 0xde8399, 0x1b, 0xc0003028e0, 0x2, 0x2)
/go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:323 +0x65
github.com/emqx/kuiper/xstream/nodes.(*SourceNode).Open.func1.1(0xc000446320, 0xc000466240, 0xed8080, 0xc000420fa0, 0xed8100, 0xc00042a5b0, 0xc00051c240, 0xc0001713d8, 0x0)
/go/kuiper/xstream/nodes/source_node.go:134 +0x4e7
created by github.com/emqx/kuiper/xstream/nodes.(*SourceNode).Open.func1
/go/kuiper/xstream/nodes/source_node.go:80 +0x262

I had this rule in place when the crash occurred, processing data from the EdgeX Device Virtual service:
{
"id": "Test EdgeX Rule",
"sql": "SELECT meta() as edgex_meta, Uint8 * 10 AS doubleint FROM edgex",
"actions": [
{
"edgex": {
"protocol": "tcp",
"host": "
",
"port": 5563,
"topic": "application",
"metadata": "edgex_meta",
"contentType": "application/json",
"deviceName": "kuiper",
"type" : "zero"
}
}
]
}

@ngjaying
Copy link
Collaborator

This is a problem which only happens in debug mode. Debug logger is trying to print out the tuple content which may be modified. Golang will issue a panic when printing a mutated map without synchronize it.

@dmocek
Copy link
Author

dmocek commented Sep 1, 2020

Is there any way to fix this?

@ngjaying
Copy link
Collaborator

ngjaying commented Sep 2, 2020

Is there any way to fix this?

It should be fixed now with the above PR which will be rolled in the next release v0.9.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants