zsh-workers
 help / color / mirror / code / Atom feed
* Buglette & Fix for checkrmall in 4.0.2
@ 2001-10-15 11:32 Stefan Dalibor
  2001-10-15 16:53 ` Bart Schaefer
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Stefan Dalibor @ 2001-10-15 11:32 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]

Hi,
just in case nobody else has been stumbled into this: 4.0.2 segfaults
in checkrmall() (under OpenLinux 3.1, i.e. Linux 2.4.* with glibc 2.2.1
and 2.2.4) when executing the following function:

function www {
	typeset netscapefiles="{lock,plugin-list*,history*,*cache/*,archive/*,*.db,abook.nab,registry,summary*,custom.dic}" \
		nsmaildir=$HOME/nsmail
	(	
		if [ -z "$DISPLAY" -a "$KPSYSTYPE" = 'i86linux' ]; then
			# Fire up X and start Mozilla from Linux text console:
			startx netscape "$@"
		else
			netscape "$@"
		fi
		# This crashes zsh-4.0.2 if unpatched:
		eval command rm -fr $HOME/.netscape/$netscapefiles /tmp/ndebug
		[ -d $nsmaildir ] && rmdir $nsmaildir
	) &
}

This is due to checkrmall() calling fprintf() with a NULL file ptr in
shout.

Please find attached the dumbest possible patch... it prevents the crash,
but I didn't investigate on wether it is the appropriate place for a
fix (should Zsh recognize that it's useless to call checkrmall() when
running in the background in the first place?  Is the NULL file ptr a
bug in itself?).

Cheers,
Stefan

P.S.: If you have any further questions, please set me on CC (I'm only on
      the Zsh announce list)
--
Dr.Ing. Stefan Dalibor <scd@caldera.de>

[-- Attachment #2: zsh-4.0.2-nostderrfix.patch --]
[-- Type: application/x-patch, Size: 384 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Buglette & Fix for checkrmall in 4.0.2
  2001-10-15 11:32 Buglette & Fix for checkrmall in 4.0.2 Stefan Dalibor
@ 2001-10-15 16:53 ` Bart Schaefer
  2001-10-15 17:07   ` Peter Stephenson
  2001-10-15 17:03 ` Bart Schaefer
  2001-10-20 17:48 ` Bart Schaefer
  2 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2001-10-15 16:53 UTC (permalink / raw)
  To: zsh-workers

On Oct 15,  1:32pm, Stefan Dalibor wrote:
}
} just in case nobody else has been stumbled into this: 4.0.2 segfaults
} in checkrmall() (under OpenLinux 3.1, i.e. Linux 2.4.* with glibc 2.2.1
} and 2.2.4) when executing the following function:
} 
    [a call to rm in a backgrounded subshell]

This raises the question of whether a backgrounded subshell should still
have the INTERACTIVE option set.

-- 
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   


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Buglette & Fix for checkrmall in 4.0.2
  2001-10-15 11:32 Buglette & Fix for checkrmall in 4.0.2 Stefan Dalibor
  2001-10-15 16:53 ` Bart Schaefer
@ 2001-10-15 17:03 ` Bart Schaefer
  2001-10-20 17:48 ` Bart Schaefer
  2 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2001-10-15 17:03 UTC (permalink / raw)
  To: zsh-workers

On Oct 15,  1:32pm, Stefan Dalibor wrote:
}
} This is due to checkrmall() calling fprintf() with a NULL file ptr in
} shout.
} 
} (Is the NULL file ptr a bug in itself?).

That's what I'm wondering now, because I can't immediately see any reason
why this would be different in 3.0.8, yet it does work in 3.0.8.

-- 
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   


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Buglette & Fix for checkrmall in 4.0.2
  2001-10-15 16:53 ` Bart Schaefer
@ 2001-10-15 17:07   ` Peter Stephenson
  2001-10-15 18:13     ` Borsenkow Andrej
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 2001-10-15 17:07 UTC (permalink / raw)
  To: Zsh hackers list

Bart Schaefer wrote:
> This raises the question of whether a backgrounded subshell should still
> have the INTERACTIVE option set.

Yes, we already unset MONITOR and USEZLE.  I remember wondering about this
some time ago and not coming to a definite conclusion.  On the whole I
think it's a good idea (we certainly don't any terminal setup stuff to run
in the subshell) but that doesn't mean it won't break something.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Buglette & Fix for checkrmall in 4.0.2
  2001-10-15 17:07   ` Peter Stephenson
@ 2001-10-15 18:13     ` Borsenkow Andrej
  2001-10-15 19:30       ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Borsenkow Andrej @ 2001-10-15 18:13 UTC (permalink / raw)
  To: Zsh hackers list

On Пнд, 2001-10-15 at 21:07, Peter Stephenson wrote:
> Bart Schaefer wrote:
> > This raises the question of whether a backgrounded subshell should still
> > have the INTERACTIVE option set.
> 
> Yes, we already unset MONITOR and USEZLE.  I remember wondering about this
> some time ago and not coming to a definite conclusion.  On the whole I
> think it's a good idea (we certainly don't any terminal setup stuff to run
> in the subshell) but that doesn't mean it won't break something.
> 

I have very vague recollection that I complained about this once and
somebody (Bart? Peter?) gave me valid reasons why it should not be
unset. But may be it was another option,

-andrej


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Buglette & Fix for checkrmall in 4.0.2
  2001-10-15 18:13     ` Borsenkow Andrej
@ 2001-10-15 19:30       ` Bart Schaefer
  0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2001-10-15 19:30 UTC (permalink / raw)
  To: Zsh hackers list

On Oct 15, 10:13pm, Borsenkow Andrej wrote:
> Subject: Re: Buglette & Fix for checkrmall in 4.0.2
> On ðÎÄ, 2001-10-15 at 21:07, Peter Stephenson wrote:
> > Bart Schaefer wrote:
> > > This raises the question of whether a backgrounded subshell should still
> > > have the INTERACTIVE option set.
> 
> I have very vague recollection that I complained about this once and
> somebody (Bart? Peter?) gave me valid reasons why it should not be
> unset. But may be it was another option,

There are reasons to leave interactive set in a subshell.  I'm not sure
there are reasons to leave it set in a *backgrounded* subshell.  Perhaps
it's too difficult to tell whether a subshell is being backgrounded?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Buglette & Fix for checkrmall in 4.0.2
  2001-10-15 11:32 Buglette & Fix for checkrmall in 4.0.2 Stefan Dalibor
  2001-10-15 16:53 ` Bart Schaefer
  2001-10-15 17:03 ` Bart Schaefer
@ 2001-10-20 17:48 ` Bart Schaefer
  2 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2001-10-20 17:48 UTC (permalink / raw)
  To: dalibor, zsh-workers

On Oct 15,  1:32pm, Stefan Dalibor wrote:
}
} just in case nobody else has been stumbled into this: 4.0.2 segfaults
} 
} This is due to checkrmall() calling fprintf() with a NULL file ptr in
} shout.

After a little further checking, this appears to be due to my patch in
zsh-users/3358, and therefore Stefan's fix is sufficient.

-- 
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   


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-10-20 17:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-15 11:32 Buglette & Fix for checkrmall in 4.0.2 Stefan Dalibor
2001-10-15 16:53 ` Bart Schaefer
2001-10-15 17:07   ` Peter Stephenson
2001-10-15 18:13     ` Borsenkow Andrej
2001-10-15 19:30       ` Bart Schaefer
2001-10-15 17:03 ` Bart Schaefer
2001-10-20 17:48 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).