From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7371 invoked from network); 14 Jun 2000 14:23:33 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Jun 2000 14:23:33 -0000 Received: (qmail 10312 invoked by alias); 14 Jun 2000 14:23:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11896 Received: (qmail 10305 invoked from network); 14 Jun 2000 14:23:26 -0000 From: "Bart Schaefer" Message-Id: <1000614142304.ZM15832@candle.brasslantern.com> Date: Wed, 14 Jun 2000 14:23:03 +0000 In-Reply-To: <200006140614.IAA01313@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: Wordcode functions with empty bodies" (Jun 14, 8:14am) References: <200006140614.IAA01313@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Wischnowsky , zsh-workers@sunsite.auc.dk Subject: Re: Wordcode functions with empty bodies MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 14, 8:14am, Sven Wischnowsky wrote: } Subject: Re: Wordcode functions with empty bodies } } I had a little debugging session yesterday evening... I could } reproduce the segv with the `prompt' thing (although I had to invoke } `prompt bart' a second time with some other command before it to make } it go kaboom). } } I could not, however, see any problems with bld_eprog(). In which way } do you think it produces garbled eprogs? (I mean, what do those eprogs } look like?) They have a `len' of 4 and a `strs' that points to four bytes of garbage. The crashes appear to happen after dupeprog() copies `strs' -- the new copy often ends up pointing to a different four bytes of garbage. In the prompt stuff, as long as I never let the function body be empty -- that is, I replace e.g. functions[TRAPWINCH]="${functions[TRAPWINCH]//prompt_bart_winch}" with functions[TRAPWINCH]="${functions[TRAPWINCH]//prompt_bart_winch/:}" the crashes never happen. Only if the function body becomes empty do I have any problem. } Ok. If you could give me an easy example of how to make bld_eprog() } give garbled results, I'd be thankful. Just doing `functions[foo]=""' } at least gives me sensible results. Try `functions[foo]=" "' so there is a non-empty string there but it contains no useful tokens. I'll try to do some more debugging this morning and send some gdb output. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net