
In message 406A31B117F2734987636D6CCC93EE3C017B9A45@ehost011-3.exch011.intermedia.net you wrote:
I have set of HUSH scripts running on u-boot 1.2.0. I'm using them for testing. Scripts are rather complicated with some level of nesting where one script can call other scripts (via "autoscr"). "setenv" command is also used actively.
In certain point execution always fails because of memory allocation failure (see screenshot in the bottom).
Well, even the tiniest check with the source code would have con- firmed what you could expect from the "ERROR : memory not allocated" error message: malloc() resp. realloc() return error codes.
This sounds not really unlikely when you try running nested shell scripts, which may need to allocate some data.
Of course, I don't expect somebody to resolve my particular scripting problem; my question is of more general nature. I would like to ask
Well, but the solution is trivial: increase the size of the malloc arena in your board config file. Many boards define this as 128 kB, which is enough for standard use in most cases, but in your case more is needed.
people, actively using HUSH shell, to share their information regarding whether there are some known issues with HUSH or setenv.
There are two completely separate topice.
"setenv" is a native U-Boot feature. I don't know of any issues in terms of memory allocation, especially as "setenv" itself does not allocate any new memory.
May be, somebody has a patch to fix/replace/improve HUSH (which lacks many functions anyway) and that can be very helpful as well.
The hush shell is borrowed from the BusyBox project; you might want to raise your concerns there.
Best regards,
Wolfgang Denk