monome/norns

script listing is truncated when large numbers of scripts are installed

ngwese opened this issue · 4 comments

ngwese commented

i need to confirm this but looking at the code i believe the missing scripts are due to output of the find command exceeding the size of the capture buffer for norns.system_command(...)

more details here: https://llllllll.co/t/norns-installed-scripts-not-displaying-in-norns-script-list/59433/5?u=ngwese

seems right, good catch

apologies, this is a pretty stupid module that could be cleaned up

this whole separate capture buffer shouldn't really be needed, we allocate a new one for the event when command is complete, and copy to it:
https://github.com/monome/norns/blame/main/matron/src/system_cmd.c#L91-L97

instead we could just reallocate the capture buffer here
https://github.com/monome/norns/blame/main/matron/src/system_cmd.c#L69-L74
and attach the capture buffer itself to the event, instead of a separate buf?

and of course in that same line we aren't issueing any warning or anything when capacity is used up, we just skip the line silently...

maybe the right question to ask is: what do we do when a command produces more output than our system can handle? (when we exceed fixed capacity right now, or when realloc fails in hypothetical future?)

ngwese commented

i'm curious how much of this got changed in the "converged" branch. i recall spending some time in this area. will look when i get a moment.

let's consider this fixed by #1712