Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Roman Rakus
Is it possible to add more traps to arithmetic evaluation? Repeated by: $((2 ** 63 / -1)) Actual result: SIGFPE (not catched) Initial report is https://bugzilla.redhat.com/show_bug.cgi?id=579622 RR

Re: Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Greg Wooledge
On Tue, Apr 06, 2010 at 01:29:28PM +0200, Roman Rakus wrote: > Is it possible to add more traps to arithmetic evaluation? > Repeated by: > $((2 ** 63 / -1)) > > Actual result: > SIGFPE (not catched) > > Initial report is https://bugzilla.redhat.com/show_bug.cgi?id=579622 Hmm, I don't get that.

Re: Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Roman Rakus
On 04/06/2010 01:49 PM, Greg Wooledge wrote: On Tue, Apr 06, 2010 at 01:29:28PM +0200, Roman Rakus wrote: Is it possible to add more traps to arithmetic evaluation? Repeated by: $((2 ** 63 / -1)) Actual result: SIGFPE (not catched) Initial report is https://bugzilla.redhat.com/show_bug.cgi

Re: Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Greg Wooledge
On Tue, Apr 06, 2010 at 02:21:05PM +0200, Roman Rakus wrote: > >>$((2 ** 63 / -1)) > I can reproduce it in 4.1.2(1)-release and 4.0.23(1)-release on x86_64 > GNU/Linux. I didn't try on bash 3.2. cyclops:~$ uname -a; echo $BASH_VERSION OpenBSD cyclops.wooledge.org 4.6 GENERIC.MP#81 amd64 4.0.24(1

Bash-4.1 Official Patch 3

2010-04-06 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.1 Patch-ID: bash41-003 Bug-Reported-by:coy...@wariat.org.pl Bug-Reference-ID: <4b64a1f8.06e2660a.60af.4...@mx.google.com> Bug-Reference-URL: http://lists.gnu.o

Bash-4.1 Official Patch 4

2010-04-06 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.1 Patch-ID: bash41-004 Bug-Reported-by:Crestez Dan Leonard Bug-Reference-ID: <1265592839.30682.21.ca...@deskbox> Bug-Reference-URL: http://lists.gnu.org/archi

Bash-4.1 Official Patch 5

2010-04-06 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.1 Patch-ID: bash41-005 Bug-Reported-by:wer...@suse.de Bug-Reference-ID: <201002251238.o1pccycg016...@boole.suse.de> Bug-Reference-URL: http://lists.gnu.org/arc

Re: [bash-bug] Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Dr. Werner Fink
On Tue, Apr 06, 2010 at 08:35:13AM -0400, Greg Wooledge wrote: > On Tue, Apr 06, 2010 at 02:21:05PM +0200, Roman Rakus wrote: > > >>$((2 ** 63 / -1)) > > > I can reproduce it in 4.1.2(1)-release and 4.0.23(1)-release on x86_64 > > GNU/Linux. I didn't try on bash 3.2. > > cyclops:~$ uname -a; ech

Re: Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Roman Rakus
On 04/06/2010 02:35 PM, Greg Wooledge wrote: On Tue, Apr 06, 2010 at 02:21:05PM +0200, Roman Rakus wrote: $((2 ** 63 / -1)) I can reproduce it in 4.1.2(1)-release and 4.0.23(1)-release on x86_64 GNU/Linux. I didn't try on bash 3.2. cyclops:~$ uname -a; echo $BASH_VERSIO

Re: [bash-bug] Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Andreas Schwab
"Dr. Werner Fink" writes: > On x86_64 the gdb shows: > > Program received signal SIGFPE, Arithmetic exception. > 0x00462cd5 in exp2 () at expr.c:761 > 761 val1 /= val2; > (gdb) print val1 > $1 = -9223372036854775808 > (gdb) print val2 > $2 = -1 > > which is strange. No

Re: [bash-bug] Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Roman Rakus
On 04/06/2010 03:59 PM, Andreas Schwab wrote: "Dr. Werner Fink" writes: On x86_64 the gdb shows: Program received signal SIGFPE, Arithmetic exception. 0x00462cd5 in exp2 () at expr.c:761 761 val1 /= val2; (gdb) print val1 $1 = -9223372036854775808 (gdb) pri

Re: [bash-bug] Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Andreas Schwab
Roman Rakus writes: > But why there is no overflow on 32bit system? Why do you think so? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: [bash-bug] Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread John Reiser
Program received signal SIGFPE, Arithmetic exception. 0x00462cd5 in exp2 () at expr.c:761 761 val1 /= val2; (gdb) print val1 $1 = -9223372036854775808 (gdb) print val2 $2 = -1 which is strange. Not at all. Overflow invokes undefined behaviour. But why there is no overflow on 32bit s

Re: [bash-bug] Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Roman Rakus
On 04/06/2010 05:32 PM, John Reiser wrote: Program received signal SIGFPE, Arithmetic exception. 0x00462cd5 in exp2 () at expr.c:761 761 val1 /= val2; (gdb) print val1 $1 = -9223372036854775808 (gdb) print val2 $2 = -1 which is strange. Not at all. Overflow invokes undefined behaviour

Re: [bash-bug] Can arithmetic evaluation trap more than just division by zero?

2010-04-06 Thread Chet Ramey
On 4/6/10 11:56 AM, Roman Rakus wrote: > On 04/06/2010 05:32 PM, John Reiser wrote: > Program received signal SIGFPE, Arithmetic exception. > 0x00462cd5 in exp2 () at expr.c:761 > 761 val1 /= val2; > (gdb) print val1 > $1 = -9223372036854775808 > (gdb) print val2 >>>