Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: checking zsh



Daniel Brahneborg wrote:
> I've done some checking on zsh-3.0.1 with Insure++.
> Unfortunately here are lots of bugs in Insure, so the output 
> isn't entirely reliable.  It has found two small things though:
> 
> - In createparamtable() in params.c, it looks as if the memory 
>   allocated to "Param pm;" is lost.

I do not see any problem there.

> - In addfd() in exec.c, the check "if (!fdtable[subsh_close])"
>   seems to be executed even when subsh_close = -1.

Yes, it is a real bug but in real life it is completely unnoticeable.
Global variables are stored in one section and fdtable[-1] is a valid
address on most systems.  So this is a bug which can never be detected
without a memory debugger.  Patch is included below anyway.

> The line allocated in inputline() might also be free'd and
> reallocated, but that might just as well be an Insure bug.

I do not see the problem there either.

> Apart from these things, Zsh seems to be quite bug free.
> (At least on this level.)

That's good.  An other useful test would be to try a complex Bourne-shell
script.  Do not forget to rename or link zsh to sh before the test.

For example the configure script which comes with zsh can be used for the
test.

Thanks,

Zoltan


*** Src/exec.c	1996/08/31 20:19:08	2.87
--- Src/exec.c	1996/09/11 00:05:57
***************
*** 1044,1050 ****
  	} else			/* add another fd to an already split stream */
  	    mfds[fd1]->fds[mfds[fd1]->ct++] = movefd(fd2);
      }
!     if (!fdtable[subsh_close])
  	subsh_close = -1;
  }
  
--- 1044,1050 ----
  	} else			/* add another fd to an already split stream */
  	    mfds[fd1]->fds[mfds[fd1]->ct++] = movefd(fd2);
      }
!     if (subsh_close >= 0 && !fdtable[subsh_close])
  	subsh_close = -1;
  }
  



Messages sorted by: Reverse Date, Date, Thread, Author