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

SIGSEGV when attempting to reading i=84 against simulator. #733

Open
Scarjit opened this issue Jun 17, 2024 · 0 comments
Open

SIGSEGV when attempting to reading i=84 against simulator. #733

Scarjit opened this issue Jun 17, 2024 · 0 comments

Comments

@Scarjit
Copy link

Scarjit commented Jun 17, 2024

While attempting to use our benthos-opcua plugin, we noticed that it can throw a segmentation fault, due to a nil pointer deref, inside the variant.go.
We managed to produce this by subscribing to i=84 against amine-amaach's simulator.

I will attempt to dig into this myself when i have time, and create a PR when i found the fix.

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

goroutine 7 [running]:
github.com/gopcua/opcua/ua.(*Variant).ArrayLength(...)
	/go/pkg/mod/github.com/gopcua/[email protected]/ua/variant.go:104
github.com/gopcua/opcua/ua.(*Variant).NodeID(...)
	/go/pkg/mod/github.com/gopcua/[email protected]/ua/variant.go:691
github.com/united-manufacturing-hub/benthos-umh/v2/opcua_plugin.browse({0x3b862d8?, 0xc00146a190}, 0xc0015462e0, {0x0, 0x0}, 0x3, 0xc000c493f0, {0xc00190ee80, 0x4})
	/go/src/github.com/united-manufacturing-hub/benthos-umh/opcua_plugin/opcua.go:130 +0x8c9
github.com/united-manufacturing-hub/benthos-umh/v2/opcua_plugin.browse.func2(0xf7c70?)
	/go/src/github.com/united-manufacturing-hub/benthos-umh/opcua_plugin/opcua.go:186 +0x25a
github.com/united-manufacturing-hub/benthos-umh/v2/opcua_plugin.browse({0x3b862d8?, 0xc00146a190}, 0xc0016add30, {0x0, 0x0}, 0x2, 0xc000c493f0, {0xc00190ee80, 0x4})
	/go/src/github.com/united-manufacturing-hub/benthos-umh/opcua_plugin/opcua.go:221 +0xe02
github.com/united-manufacturing-hub/benthos-umh/v2/opcua_plugin.browse.func2(0xf7c70?)
	/go/src/github.com/united-manufacturing-hub/benthos-umh/opcua_plugin/opcua.go:186 +0x25a
github.com/united-manufacturing-hub/benthos-umh/v2/opcua_plugin.browse({0x3b862d8?, 0xc00146a190}, 0xc001910a70, {0x0, 0x0}, 0x1, 0xc000c493f0, {0xc00190ee80, 0x4})
	/go/src/github.com/united-manufacturing-hub/benthos-umh/opcua_plugin/opcua.go:221 +0xe02
github.com/united-manufacturing-hub/benthos-umh/v2/opcua_plugin.browse.func2(0xf7c70?)
	/go/src/github.com/united-manufacturing-hub/benthos-umh/opcua_plugin/opcua.go:186 +0x25a
github.com/united-manufacturing-hub/benthos-umh/v2/opcua_plugin.browse({0x3b862d8?, 0xc00146a190}, 0xc001910500, {0x0, 0x0}, 0x0, 0xc000c493f0, {0xc00190ee80, 0x4})
	/go/src/github.com/united-manufacturing-hub/benthos-umh/opcua_plugin/opcua.go:221 +0xe02
github.com/united-manufacturing-hub/benthos-umh/v2/opcua_plugin.(*OPCUAInput).BrowseAndSubscribeIfNeeded(0xc000ebe6c0, {0x3b862d8, 0xc00146a190})
	/go/src/github.com/united-manufacturing-hub/benthos-umh/opcua_plugin/opcua.go:866 +0x1f4
github.com/united-manufacturing-hub/benthos-umh/v2/opcua_plugin.(*OPCUAInput).Connect(0xc000ebe6c0, {0x3b862d8, 0xc00146a190})
	/go/src/github.com/united-manufacturing-hub/benthos-umh/opcua_plugin/opcua.go:844 +0x12cc
github.com/benthosdev/benthos/v4/public/service.(*autoRetryInputBatched).Connect(0x10?, {0x3b862d8?, 0xc00146a190?})
	/go/pkg/mod/github.com/benthosdev/benthos/[email protected]/public/service/input_auto_retry_batched.go:52 +0x26
github.com/benthosdev/benthos/v4/public/service.(*airGapBatchReader).Connect(0x30?, {0x3b862d8?, 0xc00146a190?})
	/go/pkg/mod/github.com/benthosdev/benthos/[email protected]/public/service/input.go:150 +0x25
github.com/benthosdev/benthos/v4/internal/component/input.(*AsyncReader).loop.func3()
	/go/pkg/mod/github.com/benthosdev/benthos/[email protected]/internal/component/input/async_reader.go:99 +0x66
github.com/benthosdev/benthos/v4/internal/component/input.(*AsyncReader).loop(0xc0009bf1a0)
	/go/pkg/mod/github.com/benthosdev/benthos/[email protected]/internal/component/input/async_reader.go:116 +0x37a
created by github.com/benthosdev/benthos/v4/internal/component/input.NewAsyncReader in goroutine 1
	/go/pkg/mod/github.com/benthosdev/benthos/[email protected]/internal/component/input/async_reader.go:57 +0x245

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

1 participant