I have notices that funsubs can be used to unload loadable builtins
while they are being run e.g.
bash-5.3$ enable -f {examples/loadables/,}mktemp
bash-5.3$ declare -n foo='q[${| enable -d mktemp;}0]'
bash-5.3$ mktemp -v foo
/tmp/shtmp.jKcUE0
Segmentation fault (core dumped)
This problem also affects loadable builtin that have varname arguments
instead of variable identifiers, and builtins that have `mapfile-C'-like
callbacks, or otherwise use evalstring().
I think it would be nice if bash would be able to know which be able to
know which loadable builtins are currently being executed, and make
enable -d fail for those loadables instead of letting it unload code
that will be executed later when evalstring()/find_variable()/etc
returns.
o/
emanuele6