From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bengt Richter Newsgroups: gmane.lisp.guile.bugs Subject: bug#48150: breaking gmp Date: Sun, 2 May 2021 22:01:05 +0200 Message-ID: <20210502200105.GA26078@LionPure> References: <20210502011446.GA10772@fysh.org> Reply-To: Bengt Richter Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26946"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 48150@debbugs.gnu.org To: Zefram Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sun May 02 22:02:14 2021 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldIIA-0006uX-11 for guile-bugs@m.gmane-mx.org; Sun, 02 May 2021 22:02:14 +0200 Original-Received: from localhost ([::1]:33554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldII9-0002BT-4w for guile-bugs@m.gmane-mx.org; Sun, 02 May 2021 16:02:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldIHy-0002B4-J1 for bug-guile@gnu.org; Sun, 02 May 2021 16:02:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldIHx-0006Rc-NI for bug-guile@gnu.org; Sun, 02 May 2021 16:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldIHx-0000Dw-ME for bug-guile@gnu.org; Sun, 02 May 2021 16:02:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bengt Richter Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 02 May 2021 20:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48150 X-GNU-PR-Package: guile Original-Received: via spool by 48150-submit@debbugs.gnu.org id=B48150.1619985680852 (code B ref 48150); Sun, 02 May 2021 20:02:01 +0000 Original-Received: (at 48150) by debbugs.gnu.org; 2 May 2021 20:01:20 +0000 Original-Received: from localhost ([127.0.0.1]:44443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldIHI-0000Dg-8z for submit@debbugs.gnu.org; Sun, 02 May 2021 16:01:20 -0400 Original-Received: from imta-37.everyone.net ([216.200.145.37]:59216 helo=imta-38.everyone.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldIHF-0000DZ-Ib for 48150@debbugs.gnu.org; Sun, 02 May 2021 16:01:19 -0400 Original-Received: from pps.filterd (localhost.localdomain [127.0.0.1]) by imta-38.everyone.net (8.16.0.43/8.16.0.43) with SMTP id 142JrLbT013356; Sun, 2 May 2021 13:01:15 -0700 X-Eon-Originating-Account: WzanFZxx8BUjzbyXkGas99aVKPwWDyxfJmWbL8wljkY X-Eon-Dm: m0117124.ppops.net Original-Received: by m0117124.mta.everyone.net (EON-AUTHRELAY2 - 53b92615) id m0117124.6062c7b8.30c979; Sun, 2 May 2021 13:01:14 -0700 X-Eon-Sig: AQMHrIJgjwUKjbn2pQIAAAAC,970f84c350dd91c9d331dbacddd325ba X-Eip: aFJEJVMW8karZVBaIKyZZy82Td3GPBlzTx-xfZ6xuOk Content-Disposition: inline In-Reply-To: <20210502011446.GA10772@fysh.org> X-Proofpoint-ORIG-GUID: 085j_EkQTiK5fJI8Ale1PehmgpghmePY X-Proofpoint-GUID: 085j_EkQTiK5fJI8Ale1PehmgpghmePY X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-05-02_14:2021-04-30, 2021-05-02 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 suspectscore=0 adultscore=0 priorityscore=1501 clxscore=1034 mlxlogscore=999 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105020160 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10033 Archived-At: 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 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: . Find the GDB manual and other documentation resources online at: . 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@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@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=, fini=, rtld_fini=, 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