GNU bug report logs - #48150
breaking gmp

Previous Next

Package: guile;

Reported by: Zefram <zefram <at> fysh.org>

Date: Sun, 2 May 2021 01:16:02 UTC

Severity: normal

Done: lloda <lloda <at> sarc.name>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48150 in the body.
You can then email your comments to 48150 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#48150; Package guile. (Sun, 02 May 2021 01:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zefram <zefram <at> fysh.org>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sun, 02 May 2021 01:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zefram <zefram <at> fysh.org>
To: bug-guile <at> gnu.org
Subject: breaking gmp
Date: Sun, 2 May 2021 02:14:46 +0100
With Guile 2.2.6:

$ guile-2.2 -c '(ash 1 (ash 1 37))'
gmp: overflow in mpz type
zsh: abort      guile-2.2 -c '(ash 1 (ash 1 37))'
$

For shift distances of (ash 1 63) or greater Guile cleanly signals an
exception indicating the overflow.  The above treatment of a range of
smaller (but still stupidly large) shift distances is less than awesome.
It would be preferable for Guile to know gmp's limits and cleanly signal
an exception, rather than exceed those limits in a way that terminates
the process outright.

-zefram




Information forwarded to bug-guile <at> gnu.org:
bug#48150; Package guile. (Sun, 02 May 2021 20:02:01 GMT) Full text and rfc822 format available.

Message #8 received at 48150 <at> debbugs.gnu.org (full text, mbox):

From: Bengt Richter <bokr <at> bokr.com>
To: Zefram <zefram <at> fysh.org>
Cc: 48150 <at> debbugs.gnu.org
Subject: Re: bug#48150: breaking gmp
Date: Sun, 2 May 2021 22:01:05 +0200
Hi zefram.

On +2021-05-02 02:14:46 +0100, Zefram via Bug reports for GUILE, GNU's Ubiquitous Extension Language wrote:
> With Guile 2.2.6:
> 
> $ guile-2.2 -c '(ash 1 (ash 1 37))'
> gmp: overflow in mpz type
> zsh: abort      guile-2.2 -c '(ash 1 (ash 1 37))'
> $
> 
> For shift distances of (ash 1 63) or greater Guile cleanly signals an
> exception indicating the overflow.  The above treatment of a range of
> smaller (but still stupidly large) shift distances is less than awesome.
> It would be preferable for Guile to know gmp's limits and cleanly signal
> an exception, rather than exceed those limits in a way that terminates
> the process outright.
> 
> -zefram
> 
> 
>

Out of curiosity, I tried gdb on your example, running in uname -a:
--8<---------------cut here---------------start------------->8---
Linux LionPure 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux
--8<---------------cut here---------------end--------------->8---
which is puri.sm PureOS, a version of debian, with Wayland and Gnome, and tilix as terminal.
--8<---------------cut here---------------start------------->8---

[14:22 ~/bs]$ gdb --args guile-2.2 -c '(ash 1 (ash 1 37))'
GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from guile-2.2...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/guile-2.2 -c \(ash\ 1\ \(ash\ 1\ 37\)\)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff755b700 (LWP 22904)]
[New Thread 0x7ffff6d5a700 (LWP 22905)]
[New Thread 0x7ffff6559700 (LWP 22906)]
gmp: overflow in mpz type

Thread 1 "guile-2.2" received signal SIGABRT, Aborted.
__GI_raise (sig=sig <at> entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig <at> entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7b02535 in __GI_abort () at abort.c:79
#2  0x00007ffff78790ad in __gmpz_realloc () from /lib/x86_64-linux-gnu/libgmp.so.10
#3  0x00007ffff787563e in __gmpz_mul_2exp () from /lib/x86_64-linux-gnu/libgmp.so.10
#4  0x00007ffff7eede00 in ?? () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#5  0x00007ffff7f4054f in ?? () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#6  0x00007ffff7f45d9f in scm_call_n () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#7  0x00007ffff7ec8c27 in scm_primitive_eval () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#8  0x00007ffff7ec8c83 in scm_eval () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#9  0x00007ffff7f4054f in ?? () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#10 0x00007ffff7f45d9f in scm_call_n () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#11 0x00007ffff7ec8c27 in scm_primitive_eval () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#12 0x00007ffff7ec8c83 in scm_eval () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#13 0x00007ffff7f14730 in scm_shell () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#14 0x00007ffff7edf53d in ?? () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#15 0x00007ffff7ec1e1a in ?? () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#16 0x00007ffff7f4054f in ?? () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#17 0x00007ffff7f45d9f in scm_call_n () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#18 0x00007ffff7f34794 in ?? () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#19 0x00007ffff7ec2400 in ?? () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#20 0x00007ffff7ec2495 in scm_c_with_continuation_barrier () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#21 0x00007ffff7f333a6 in ?? () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#22 0x00007ffff7a86ef5 in GC_call_with_stack_base () from /lib/x86_64-linux-gnu/libgc.so.1
#23 0x00007ffff7f33738 in scm_with_guile () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#24 0x00007ffff7edf6d2 in scm_boot_guile () from /lib/x86_64-linux-gnu/libguile-2.2.so.1
#25 0x0000555555555114 in ?? ()
#26 0x00007ffff7b0409b in __libc_start_main (main=0x5555555550b0, argc=3, argv=0x7fffffffde38, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffde28) at ../csu/libc-start.c:308
#27 0x00005555555551aa in ?? ()
(gdb) quit
A debugging session is active.

	Inferior 1 [process 22900] will be killed.

Quit anyway? (y or n) y
--8<---------------cut here---------------end--------------->8---

No time to pursue it further, but it was there in another terminal window, so I thought
I'd copy-paste it as another data point.

-- 
Regards,
Bengt Richter




Reply sent to lloda <lloda <at> sarc.name>:
You have taken responsibility. (Fri, 05 Nov 2021 16:34:01 GMT) Full text and rfc822 format available.

Notification sent to Zefram <zefram <at> fysh.org>:
bug acknowledged by developer. (Fri, 05 Nov 2021 16:34:02 GMT) Full text and rfc822 format available.

Message #13 received at 48150-done <at> debbugs.gnu.org (full text, mbox):

From: lloda <lloda <at> sarc.name>
To: 48150-done <at> debbugs.gnu.org
Subject: Re: breaking gmp
Date: Fri, 5 Nov 2021 17:33:16 +0100
Fixed in bf9d30f3c3fd03cb37d604f1927e9ce5c699338b. Thanks!





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 04 Dec 2021 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 115 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.