Re: [Partial patch] IFS and read builtin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Herbert,

Herbert Xu wrote:

> commit f42e443bb511ed3224f09b4fcf0772438ebdbbfa
> Author: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Date:   Wed Sep 8 20:07:26 2010 +0800
> 
>     [EXPAND] Fix ifsfirst/ifslastp leak
>     
>     As it stands expandarg may return with a non-NULL ifslastp which
>     then confuses any subsequent ifsbreakup user that doesn't clear
>     it directly.
>     
>     What's worse, if we get interrupted before we hit ifsfree in
>     expandarg we will leak memory.
>     
>     This patch fixes this by always calling ifsfree in expandarg
>     thus ensuring that ifslastp is always NULL on the normal path.
>     It also adds an ifsfree call to the RESET path to ensure that
>     memory isn't leaked.

I was experiencing weird symptoms with a local test script (for another
program):

	$ sh -x t5523-push-upstream.sh -i -v
	[...]
	+ test_terminal git push -u upstream master
	+ die
	+ code=2
	+ test -n
	+ echo FATAL: Unexpected exit with code 2
	FATAL: Unexpected exit with code 2
	+ exit 1
	$ cat trash\ directory.t5523-push-upstream/err
	+ test_declared_prereq TTY
	+ return 1
	+ test_declared_prereq TTYREDIR
	+ return :Tï    Dï      \ï      Kï      lï      Mï      1 ï     Dï      \ï      Kï      lï      Mï      1 1
	return: 1: Illegal number: :Tï  Dï      \ï      Kï      lï      Mï      1

The strange text there is supposed to be 127, I think, and it is not
supposed to be redirected to err.

Bisects to f42e443bb.  Reverting it avoids the problem.  Any ideas
before I investigate further?

Jonathan
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux