zsh-workers
 help / color / mirror / code / Atom feed
From: Jon Mayo <jon.mayo@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>,
	zsh workers <zsh-workers@zsh.org>
Subject: Re: SIGFPE crash
Date: Sun, 8 May 2011 00:03:48 -0700	[thread overview]
Message-ID: <BANLkTi=e7-gkp2ArGaW5ow=7Z4myk0=ewQ@mail.gmail.com> (raw)
In-Reply-To: <110507194654.ZM16644@torch.brasslantern.com>

On Sat, May 7, 2011 at 7:46 PM, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On May 7,  2:56pm, Jon Mayo wrote:
> }
> } echo $[-9223372036854775808/-1]
> }
> } this causes zsh to exit immediately with an FPE. Does anyone have a
> } patch to fix this?
>
> Interesting.
>
> schaefer<505> echo $[-9223372036854775808/-1]
> -9223372036854775808
> schaefer<506> echo $[-9223372036854775809/-1]
> zsh: number truncated after 18 digits: 9223372036854775809/-1
> 922337203685477580
>
> No FPE in either case.
>
> On May 7,  5:05pm, Jon Mayo wrote:
> }
> } perhaps scripts that care can just use a trap? and all my worrying was
> } for nothing?
>
> I'm having a hard time testing this because I can't get a mathematically
> induced FPE, but recall that (quoting the doc):
>
>   * The return status from function traps is special, whereas a return
>     from a list trap causes the surrounding context to return with the
>     given status.
>
> So if you use
>
>    trap 'return 1' FPE
>
> you might avoid the infinite retry of the operation that Mikael reported.
>
> --
>

nope, it spins with 100% cpu even on that one.

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 2790 jon       20   0 40740 3292 1896 R  100  0.0   0:17.17 zsh

- Jon


  reply	other threads:[~2011-05-08  7:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-07 21:56 Jon Mayo
2011-05-07 22:17 ` Mikael Magnusson
2011-05-07 22:19   ` Jon Mayo
2011-05-07 22:27     ` Mikael Magnusson
2011-05-07 23:48       ` Phil Pennock
2011-05-08  0:05       ` Jon Mayo
2011-05-08  0:10         ` Mikael Magnusson
2011-05-08  2:46         ` Bart Schaefer
2011-05-08  7:03           ` Jon Mayo [this message]
2011-05-08 17:33       ` Peter Stephenson
2011-05-09 10:21       ` Vincent Lefevre
2011-05-09 10:35     ` Vincent Lefevre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTi=e7-gkp2ArGaW5ow=7Z4myk0=ewQ@mail.gmail.com' \
    --to=jon.mayo@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).