[U-Boot-Users] "ERROR : memory not allocated" during HUSH script execution.

Wolfgang Denk wd at denx.de
Sat May 12 16:21:12 CEST 2007

In message <406A31B117F2734987636D6CCC93EE3C017B9A45 at 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

DENX Software Engineering GmbH,    CEO: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Change is the essential process of all existence.
	-- Spock, "Let That Be Your Last Battlefield",
	   stardate 5730.2

More information about the U-Boot mailing list