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

linux build crashes when connecting to test.mosquitto.org #1

Open
gaillarddamien opened this issue Feb 5, 2024 · 4 comments
Open

Comments

@gaillarddamien
Copy link

gaillarddamien commented Feb 5, 2024

./SparkpluGUI-Linux v1.0.0

MQTT host: test.mosquitto.org
port: 1883
subscribe to: spBv1.0/#

click 'connect', and the app crashes with the following error message:

Overriding existing handler for signal 10. Set JSC_SIGNAL_FOR_GC if you want WebKit to use a different signal
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x7743ee]

goroutine 11 [running]:
sparkplugui/backend/sparkplug.(*Payload).DecodePayload(0xc00008ff10, {0xc0001fe000, 0xda, 0xda})
        /home/guillaumeklimek/Projects/sparkplugui/backend/sparkplug/weekaung.go:122 +0x20e
sparkplugui/backend/core.(*App).decode(0x0?, {0xc0001fe000, 0xda, 0x0?})
        /home/guillaumeklimek/Projects/sparkplugui/backend/core/app.go:49 +0x49
sparkplugui/backend/core.(*App).CmdConnect.func1.1()
        /home/guillaumeklimek/Projects/sparkplugui/backend/core/commands.go:73 +0x46
created by sparkplugui/backend/core.(*App).CmdConnect.func1 in goroutine 47
        /home/guillaumeklimek/Projects/sparkplugui/backend/core/commands.go:72 +0x90
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x7743ee]

goroutine 8 [running]:
sparkplugui/backend/sparkplug.(*Payload).DecodePayload(0xc00008df10, {0xc000132190, 0x4a, 0x4a})
        /home/guillaumeklimek/Projects/sparkplugui/backend/sparkplug/weekaung.go:122 +0x20e
sparkplugui/backend/core.(*App).decode(0x0?, {0xc000132190, 0x4a, 0x0?})
        /home/guillaumeklimek/Projects/sparkplugui/backend/core/app.go:49 +0x49
sparkplugui/backend/core.(*App).CmdConnect.func1.1()
        /home/guillaumeklimek/Projects/sparkplugui/backend/core/commands.go:73 +0x46
created by sparkplugui/backend/core.(*App).CmdConnect.func1 in goroutine 47
        /home/guillaumeklimek/Projects/sparkplugui/backend/core/commands.go:72 +0x90

@guiklimek
Copy link
Collaborator

Oopsie doopsie 😅

Context

There is no tahu support for a Golang implementation of the sparkplug-payload nor the sparkplug-client.

I have found this as a code base: https://github.com/weekaung/sparkplugb-client.

Core

DecodePayload is directly involved in this error and the code use it like that: https://github.com/Ambre-io/sparkplugui/blob/main/backend/sparkplug/weekaung.go#L104.

I copied the code base and add method from the fresh compiled proto file: https://github.com/Ambre-io/sparkplugui/blob/main/backend/sparkplug/sproto/sparkplug_b.pb.go.

Understanding

It cannot or doesn't know how to decode an incoming message.

I don't yet have the type(s) of messages that are causing the problem here, because some work well, fortunately.

I'm still not sure to understand well what is happening here..

@marchino2000
Copy link

Windows version crashes as well.

@guiklimek
Copy link
Collaborator

guiklimek commented Aug 8, 2024

Hello @marchino2000, thank you for reporting this and sorry for the bad user experience with SparkpluGUI. Do you have more information to give like the context of usage?

I think there are two main problems:

  • back: the incomplete Go Sparkplug Client (fail on decoding)
  • front: the not optimized tree building that displays topics + Redux Toolkit as Event Handler trick to benchmark

For now, SparkpluGUI can't handle top-level topics that involve a large flow of messages.

Unfortunately, I currently can't do more for this. The cool thing is that with wes-johnson, the main maintainer of the tahu library, we discussed adding it to the Tahu Project. I will find a moment to make it true, SparkpluGUI gonna have better chance like that.

Also, if you want to contribute, feel free to create a PR!

Peace 🫰

@marchino2000
Copy link

Hi @guiklimek , thank you for your reply. I find this gui a valuable utility to monitor sparkplug messages, so keep up with the good work! In my case it seems that crash is related to authentication fields: if you leave user and password empty, then you'll get the problem.

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