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

Re: SIGFPE crash



On Sat, May 7, 2011 at 7:46 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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



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