[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: bug-report: ash: fix a memory leak
From: yhu2 <yadi.hu () windriver ! com>
Date: 2015-02-26 7:02:37
Message-ID: 54EEC50D.9090203 () windriver ! com
[Download RAW message or body]
ping!
On 12/24/2014 10:32 AM, yhu2 wrote:
> The script which triggers the leak:
>
> while true
> do
> while true
> do
> break;
> done</dev/null
> done
>
> someone had fixed this bug, the commit is:
> http://git.busybox.net/busybox/commit/shell/ash.c?id=4ba6c5d3ba3d2c7922aff6b5c2e73b8325f1cf17
>
>
> but this commit results in crash running some shell scripts, so it was
> reverted.
>
>
> I am trying to resolve this defect,any commnent would be appreciated!
>
> --- shell/ash.c 2011-03-13 09:45:40.000000000 +0800
> +++ shell/ash.c 2014-12-23 17:34:04.000000000 +0800
> @@ -8290,6 +8290,7 @@
> void (*evalfn)(union node *, int);
> int status;
> int int_level;
> + struct stackmark smark;
>
> SAVE_INT(int_level);
>
> @@ -8329,6 +8330,7 @@
> status = !exitstatus;
> goto setstatus;
> case NREDIR:
> + setstackmark(&smark);
> expredir(n->nredir.redirect);
> status = redirectsafe(n->nredir.redirect, REDIR_PUSH);
> if (!status) {
> @@ -8336,6 +8338,7 @@
> status = exitstatus;
> }
> popredir(/*drop:*/ 0, /*restore:*/ 0 /* not sure */);
> + popstackmark(&smark);
> goto setstatus;
> case NCMD:
> evalfn = evalcommand;
>
>
>
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic