Mail Archives: djgpp-workers/2001/05/19/06:05:58
> I made the example stand-alone (by providing a script that
> performs the same
> function as --fallback-echo) and I couldn't reproduce the
> problem. I changed
> to a previous bash 2.04 and also got the same answer. bash 2.05
> also gives
> the same answer. I added a statement to output the i variable and
That's what I would expect; anything up until the current bash
version did the same for me.
> it stops at
> 16 every time (2.04 current, 2.04 previous, 2.05 alpha). I also
Well, for me it kept going until 21 at least...
> manually ran
> 'ltconfig ltmain.sh' and it gave the same answer.
>
> You might try disabling the memory leak fix in execute_cmd.c (search for
> 'free (args)') and see if that makes a difference.
It did - it made the debug build crash as well :-)
I did find the problem though - I made 1 (one) change to the source. Where
it used to say (in shell.c)
if (gethostname (hostname, 255) < 0)
current_host_name = "??host??";
else
current_host_name = savestring (hostname);
I put
if (getenv ("HOSTNAME") != NULL)
current_host_name = savestring (getenv ("HOSTNAME"));
else if (gethostname (hostname, 255) < 0)
current_host_name = "??host??";
else
current_host_name = savestring (hostname);
because I don't like the way it gets upcased by gethostname (and I have the
hostname in my prompt). This has worked without problems so far (I first
added it to 1.14.7 I think). Disabling made the crashes go away though.
Since the the fallback ("??host??") isn't dynamically allocated, this looked
like a potential memory leak (since current_host_name is never freed) - and
sure enough: removing the savestring() from the getenv() made the crash go
away as well. I still don't know why it crashed exactly, but it works fine
again now, so I think I'll just leave well enough alone.
- Raw text -