Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Panic while scanning for wifi connections #248

Open
rjoleary opened this issue Jul 2, 2021 · 2 comments
Open

Panic while scanning for wifi connections #248

rjoleary opened this issue Jul 2, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@rjoleary
Copy link
Contributor

rjoleary commented Jul 2, 2021

Describe the bug
In the "Scanning for wifi networks..." screen, webboot crashed and returned to the shell. I attached a screenshot (sorry I couldn't come up with a good way to get the text off the screen at the time):

screen1

screen2

To Reproduce
I do not get this panic every time -- in fact, I've only seen it once. The wifi connection usually works.

Expected behavior
It should have scanned for wifi networks. Additionally, webboot shouldn't panic like this and instead display an error more gracefully.

Additional context
The "index out of range [33] with length 33" might indicate an out-of-bounds error. The "end of history Unbound: Ctrl-[" stuff at the end is elvish junk that can be ignored.

@rjoleary rjoleary added the bug Something isn't working label Jul 2, 2021
@orangecms
Copy link
Member

https://github.com/u-root/webboot/blob/main/pkg/wifi/iwl.go#L103
I'd propose to do that in multiple steps and sanitize / check for unsupported values.

@orangecms
Copy link
Member

orangecms commented Jul 2, 2021

Note that the list index comes from another variable than the one being accessed. We cannot guarantee that they are in sync (or the same order).
The API we are constructing currently is splitting by RE on fields globally and then trying to unify them again, IIUC. Compare that to a table with potentially empty cells. That means that any entry with some field not matching its RE breaks the alignment. Instead, I'd suggest treating each access point entry one by one and see if it has all the fields.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants