Skip to content

Panic when no arguments passed via HELLO command #32

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

Closed
3 tasks done
olvap80 opened this issue Feb 21, 2023 · 2 comments · Fixed by #33
Closed
3 tasks done

Panic when no arguments passed via HELLO command #32

olvap80 opened this issue Feb 21, 2023 · 2 comments · Fixed by #33
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@olvap80
Copy link

olvap80 commented Feb 21, 2023

Describe the problem

Command without parameters leads to cryptic runtime error when called without parameters and developer skills are required to find out what is really wrong:

HELLO
panic: runtime error: slice bounds out of range [6:5]

goroutine 1 [running]:
github.com/arduino/pluggable-discovery-protocol-handler/v2.(*Server).Run(0xc0000f8000, 0xee7158, 0xc0000d8000, 0xee7178, 0xc0000d8008, 0xf96120, 0x0)
        /go/pkg/mod/github.com/arduino/pluggable-discovery-protocol-handler/[email protected]/discovery.go:135 +0x73f
main.main()
        /home/build/main.go:39 +0xfd

To reproduce

Issue command without parameters

Expected behavior

User friendly error message is expected with direct reference to https://github.com/arduino/serial-discovery

serial-discovery version

serial-discovery Version: v1.3.2 Commit: c5cf4d8 Date: 2022-02-22T08:48:19Z

Operating system

Windows

Operating system version

Windows 10

Additional context

The issue was discovered when trying to use serial-discovery tool as a part of the Arduino IDE

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@olvap80 olvap80 added the type: imperfection Perceived defect in any part of project label Feb 21, 2023
@per1234 per1234 transferred this issue from arduino/serial-discovery Feb 21, 2023
@per1234 per1234 added the topic: code Related to content of the project itself label Feb 21, 2023
@per1234 per1234 changed the title User friendliness Panic when no arguments passed via HELLO command Feb 21, 2023
cmaglie added a commit that referenced this issue Feb 22, 2023
@cmaglie
Copy link
Member

cmaglie commented Feb 22, 2023

Thanks for the bug report @olvap80!

I'm quite surprised this bug went unnoticed for so long... (I mean, the first thing someone will try is to run the HELLO command without parameters I guess).

I've prepared a fix here #33, if you want to give it a try.

cmaglie added a commit that referenced this issue Feb 22, 2023
@cmaglie
Copy link
Member

cmaglie commented Feb 22, 2023

Fixed in v2.1.1

@per1234 per1234 added the conclusion: resolved Issue was resolved label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants