zsh-users
 help / color / mirror / code / Atom feed
* localtraps causing core dump in 3.1.6+
@ 2000-04-28 20:15 Paul Ackersviller
  2000-04-29  4:42 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Ackersviller @ 2000-04-28 20:15 UTC (permalink / raw)
  To: Zsh users list

I recently started doing `setopt localtraps && unset -f TRAPZERR'
because of some changes that took place for 3.1.7-pre-1.  I guess it's
intentional now that all tests which fail in chpwd() cause TRAPZERR()
to be executed.  However that led me to try the above, which dumps core
on both 3.1.7-pre-1 and 3.1.6 when changing directory.

This is happening on Solaris 2.6 compiled with gcc 2.8.1, in case it
matters.  I could also provide a stack trace if it would help anyone,
but the binaries I have around at the moment are without symbol tables.

-- 
Paul Ackersviller


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

* Re: localtraps causing core dump in 3.1.6+
  2000-04-28 20:15 localtraps causing core dump in 3.1.6+ Paul Ackersviller
@ 2000-04-29  4:42 ` Bart Schaefer
  2000-05-01 17:13   ` TRAPZERR() in chpwd() Paul Ackersviller
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2000-04-29  4:42 UTC (permalink / raw)
  To: Paul Ackersviller, Zsh users list

On Apr 28,  4:15pm, Paul Ackersviller wrote:
} Subject: localtraps causing core dump in 3.1.6+
}
} I guess it's intentional now that all tests which fail in chpwd() cause
} TRAPZERR() to be executed.

Why do you guess that?  It's certainly a surprise to me.  Could you give
a more specific example of what you mean, though?  TRAPZERR() is called
any time any command exits with a nonzero status, in chpwd or anywhere
else, and as far as I can tell it always has (by coincidence, I rebuilt
zsh-2.4.306 yesterday, and TRAPZERR seems to behave the same there as in
3.0.6 and 3.1.7-pre-1).

} I recently started doing `setopt localtraps && unset -f TRAPZERR'
} because of some changes that took place for 3.1.7-pre-1.
} 
} However that led me to try the above, which dumps core
} on both 3.1.7-pre-1 and 3.1.6 when changing directory.

There is a bug in unsetting TRAPxxx (as opposed to resetting them to
something else) when localtraps is set.  You might try `trap - ZERR' or
`disable -f TRAPZERR' instead for now.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

* TRAPZERR() in chpwd()
  2000-04-29  4:42 ` Bart Schaefer
@ 2000-05-01 17:13   ` Paul Ackersviller
  2000-05-01 18:22     ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Ackersviller @ 2000-05-01 17:13 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh users list

On Sat, Apr 29, 2000 at 04:42:20AM +0000, Bart Schaefer wrote:
> On Apr 28,  4:15pm, Paul Ackersviller wrote:
> }
> } I guess it's intentional now that all tests which fail in chpwd() cause
> } TRAPZERR() to be executed.
> 
> Why do you guess that?  It's certainly a surprise to me.  Could you give
> a more specific example of what you mean, though?  TRAPZERR() is called
> any time any command exits with a nonzero status, in chpwd or anywhere
> else, and as far as I can tell it always has.

Yes, I know all that; what I meant by `tests' was internal shell tests as
opposed to external programs or other commands.  Here's a simplified example
of what I'm seeing.
	TRAPZERR () { echo exit code $?; }
	chpwd () { [ -h $PWD ] && echo symlink; true; }
When I change to a directory that's not a soft link, I'm getting the `exit
code' message from 3.1.7-pre-1, whereas I never have with earlier versions.
I'm just wondering which way is correct, or are all versions correct and I'm
just missing out on understanding something else that's related?

> There is a bug in unsetting TRAPxxx (as opposed to resetting them to
> something else) when localtraps is set.  You might try `trap - ZERR' or
> `disable -f TRAPZERR' instead for now.

Thanks, `trap - ZERR' is really what I meant to do all along, i.e. affect
only local behaviour inside the function, not global.

-- 
Paul Ackersviller


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

* Re: TRAPZERR() in chpwd()
  2000-05-01 17:13   ` TRAPZERR() in chpwd() Paul Ackersviller
@ 2000-05-01 18:22     ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2000-05-01 18:22 UTC (permalink / raw)
  To: Paul Ackersviller; +Cc: Zsh users list

On May 1,  1:13pm, Paul Ackersviller wrote:
} Subject: TRAPZERR() in chpwd()
}
} [...] what I meant by `tests' was internal shell tests as
} opposed to external programs or other commands.  Here's a simplified example
} of what I'm seeing.
} 	TRAPZERR () { echo exit code $?; }
} 	chpwd () { [ -h $PWD ] && echo symlink; true; }
} When I change to a directory that's not a soft link, I'm getting the `exit
} code' message from 3.1.7-pre-1, whereas I never have with earlier versions.

Hmmmmm ... trying some assorted older builds I have around ...

zagzig% echo $VERSION
zsh 2.4.306 beta
zagzig% TRAPZERR () { echo exit code $?; }
zagzig% chpwd () { [ -h $PWD ] && echo symlink; true; }
zagzig% cd /tmp
exit code 1
zagzig% cd /hosts
symlink
zagzig%

zagzig% echo $ZSH_VERSION
3.0.6-test-1
zagzig% TRAPZERR () { echo exit code $?; }
zagzig% chpwd () { [ -h $PWD ] && echo symlink; true; }
zagzig% cd /tmp
zagzig% cd /hosts
symlink
zagzig% 

This may be a fix that went in to 3.0.x and was never propagated to 3.1.x,
or it may be a bug that was introduced in 3.0.x and fixed in 3.1.x.  I'm
not sure which at this point.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

end of thread, other threads:[~2000-05-01 18:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-28 20:15 localtraps causing core dump in 3.1.6+ Paul Ackersviller
2000-04-29  4:42 ` Bart Schaefer
2000-05-01 17:13   ` TRAPZERR() in chpwd() Paul Ackersviller
2000-05-01 18:22     ` 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).