cmd/tui/handler: avoid panic at runtime due to trying to copy into an inner nil slice#799
Conversation
|
Thanks for tackling this. I have recorded a few of those errors also in #653. |
Sure I opened this to fix it :)
Looking at the context of the change, I can't see how this would get initialized in another code path. The |
I am talking about the struct's There are the the two |
Thanks for clarifying, I see what you mean. Both event handlers could mess up the length of the raw rows when changing them under the hood without locking. |
|
@roosterfish unfortunately we don't have access to the table mutex in the event handlers. But I think there is an easy way out. We only ever interest the number of the table rows, so we can avoid the copy all together and just return the count in our helper function. |
|
Good catch that we don't even require the data from Now I think we don't even need to obtain the Instead we should have a mutex on the |
…ze of the rows and don't need a copy of the table rows. This avoids a kernel panic, suspected due to parallel processing of handleRemoveEvent or handleInsertEvent on the table Signed-off-by: David Edler <david.edler@canonical.com>
Right, adjusted the PR to the new mutex inside of the selectable table. |

Done
see https://github.com/canonical/microcloud/actions/runs/15183238063/job/42697492228 for a failing test run due to panick at runtime