monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
614 stars 144 forks source link

script listing is truncated when large numbers of scripts are installed #1663

Closed ngwese closed 7 months ago

ngwese commented 1 year ago

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

catfact commented 1 year ago

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...

catfact commented 1 year ago

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 1 year ago

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.

tehn commented 7 months ago

let's consider this fixed by #1712