From unknown Fri Jun 20 07:16:20 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#60487 <60487@debbugs.gnu.org> To: bug#60487 <60487@debbugs.gnu.org> Subject: Status: string-ref segfaults with n < 0 on Guile 3.0.8 Reply-To: bug#60487 <60487@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:16:20 +0000 retitle 60487 string-ref segfaults with n < 0 on Guile 3.0.8 reassign 60487 guile submitter 60487 festerdam@posteo.net severity 60487 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 02 03:53:55 2023 Received: (at submit) by debbugs.gnu.org; 2 Jan 2023 08:53:55 +0000 Received: from localhost ([127.0.0.1]:42407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCGZu-0005Sh-Ni for submit@debbugs.gnu.org; Mon, 02 Jan 2023 03:53:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:60828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCCBl-00045E-FK for submit@debbugs.gnu.org; Sun, 01 Jan 2023 23:12:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCCBl-0003Cl-7m for bug-guile@gnu.org; Sun, 01 Jan 2023 23:12:41 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCCBj-0001Bd-6B for bug-guile@gnu.org; Sun, 01 Jan 2023 23:12:40 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 58529240314 for ; Mon, 2 Jan 2023 05:12:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1672632755; bh=Q8GQ0g0g4/h8iiJE2a0X5kQxgyI6NK0CpLvOvY2gb2Q=; h=Date:From:To:Subject:From; b=FGa/aq9k0T7vzTIqwfsfFcqAMN7uy4+Z1XheFp8aRS2AFPd2Z5pwPT8zFLFmZAuIA 70P+1gjx7b4Iac1hMojU6ZcYCSDsn8ZZCNJh1J9iq4L2pSCYZargUHA9c1pPNuhh1Q 9z6Tz4opv2Pu77SBgLVXDhncymDYnywjHoVq/LEWFDEq5ixqrdLTMSFmylBMTA6KSe iSntOhR4Wc6kK5o5VwWg6AShlV/aETuBbHlkSguTQJQed/NdbYFpvH4NPwBuuHjMSv 7Znewr3fqLebgLia5gZ6XWgWrkkO/+W/xJ+DA1ws+bRqMhk3jVE5VZAz9FJrfm3gX1 uhKWuxppi8YxA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NljBV58wMz6trh for ; Mon, 2 Jan 2023 05:12:33 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 02 Jan 2023 04:12:33 +0000 From: festerdam@posteo.net To: bug-guile@gnu.org Subject: string-ref segfaults with n < 0 on Guile 3.0.8 Message-ID: Received-SPF: pass client-ip=185.67.36.66; envelope-from=festerdam@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 02 Jan 2023 03:53:53 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) The following code results in a segmentation fault on Guile 3.0.8-deb+3.0.8-2 (obtained from the Debian repositories): (string-ref "my string" -3) gdb's backtrace is the following: #0 0x00007ffff7f1bcc5 in ?? () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #1 0x00007ffff7f26c49 in scm_call_n () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #2 0x00007ffff7e97b29 in scm_apply_0 () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #3 0x00007ffff7f15966 in scm_throw () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #4 0x00007ffff7f174e9 in scm_ithrow () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #5 0x00007ffff7e94735 in scm_error_scm () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #6 0x00007ffff7e94790 in scm_error () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #7 0x00007ffff7ee19e7 in ?? () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #8 0x00007ffff7ee208b in scm_to_uint64 () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #9 0x00007ffff7f1c5e4 in ?? () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #10 0x00007ffff7f26c49 in scm_call_n () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #11 0x00007ffff7e93a97 in scm_primitive_eval () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #12 0x00007ffff7e99a86 in scm_eval () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #13 0x00007ffff7ef91c6 in scm_shell () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #14 0x00007ffff7ea865c in ?? () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #15 0x00007ffff7e91f6a in ?? () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #16 0x00007ffff7f194e8 in ?? () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #17 0x00007ffff7f26c49 in scm_call_n () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #18 0x00007ffff7e936ea in scm_call_2 () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #19 0x00007ffff7f42292 in ?? () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #20 0x00007ffff7f0ff4f in scm_c_catch () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #21 0x00007ffff7e942e6 in scm_c_with_continuation_barrier () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #22 0x00007ffff7f14b89 in ?? () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #23 0x00007ffff7c190e7 in GC_call_with_stack_base () from /lib/x86_64-linux-gnu/libgc.so.1 #24 0x00007ffff7f0fe68 in scm_with_guile () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #25 0x00007ffff7eb1185 in scm_boot_guile () from /lib/x86_64-linux-gnu/libguile-3.0.so.1 #26 0x000055555555510f in ?? () #27 0x00007ffff7c9918a in __libc_start_call_main (main=main@entry=0x5555555550b0, argc=argc@entry=1, argv=argv@entry=0x7fffffffe0b8) at ../sysdeps/nptl/libc_start_call_main.h:58 #28 0x00007ffff7c99245 in __libc_start_main_impl (main=0x5555555550b0, argc=1, argv=0x7fffffffe0b8, init=, fini=, rtld_fini=, stack_end=0x7fffffffe0a8) at ../csu/libc-start.c:381 #29 0x00005555555551aa in ?? () From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 16 17:15:47 2023 Received: (at 60487-done) by debbugs.gnu.org; 16 Jan 2023 22:15:47 +0000 Received: from localhost ([127.0.0.1]:35137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHXla-0003Rv-HL for submit@debbugs.gnu.org; Mon, 16 Jan 2023 17:15:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHXlV-0003Rc-G0 for 60487-done@debbugs.gnu.org; Mon, 16 Jan 2023 17:15:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHXlP-0006SC-HT; Mon, 16 Jan 2023 17:15:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=vHtklc+/sKOn++2G9jqIKTfJ6Qm5bBnakaV0MZir5IE=; b=hrKJ2S2QfzvLfU5OY5PL RqzT7Wl1M/7Mt+JblOBmtC144KLl7gv0Lh8IhRGnE19I8nx7Q3MHO30cY0QnuTFxyHrLeEeQNDT0q 5DgzjvZzz1TUfma81H9+ww9X8JbnnigXkS4W4wmAzOPBcwNEdHutiyO9lKrzALrwMe11Xi7/sDdi1 gNpuHN0DsgoqscTOTmUc8pgJ0PlloaJWbZzji1Yj6qb30ph+NQSYHewt6g64ysInNdo+E6aRMDziL rcYyKrhM/KbiUNZm19RUF14W2syuN+epdOiaGZsyfckMZR1KOUM8forlaw0U6n9S0HOZSH9ScHhvT SMXmO3Jwu9oZmw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHXlO-0006kd-Ev; Mon, 16 Jan 2023 17:15:35 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: festerdam@posteo.net Subject: Re: bug#60487: string-ref segfaults with n < 0 on Guile 3.0.8 References: Date: Mon, 16 Jan 2023 23:15:31 +0100 In-Reply-To: (festerdam@posteo.net's message of "Mon, 02 Jan 2023 04:12:33 +0000") Message-ID: <877cxmktx8.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60487-done Cc: 60487-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, festerdam@posteo.net skribis: > The following code results in a segmentation fault on Guile > 3.0.8-deb+3.0.8-2 (obtained from the Debian repositories): > (string-ref "my string" -3) I can reproduce it with 3.0.8, where I get this backtrace: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (string-ref "my string" -3) Thread 1 "guile" received signal SIGSEGV, Segmentation fault. 0x00007ffff7f419d9 in scm_is_values (x=3D) at values.h:30 30 values.h: No such file or directory. (gdb) bt #0 0x00007ffff7f419d9 in scm_is_values (x=3D) at values.h:30 #1 vm_debug_engine (thread=3D0x7ffff75c1d80) at vm-engine.c:974 #2 0x00007ffff7f4c5d9 in scm_call_n (proc=3D, argv=3D, nargs=3D5) at vm.c:1610 #3 0x00007ffff7eb8571 in scm_apply_0 (proc=3D#, args= =3D()) at eval.c:603 #4 0x00007ffff7f3dc8d in scm_throw (key=3Dout-of-range,=20 args=3D0x7ffff2bb2c30) at throw.c:262 #5 0x00007ffff7f3dca9 in scm_ithrow (key=3D, args=3D,=20 no_return=3D) at throw.c:457 #6 0x00007ffff7eb5245 in scm_error_scm (key=3Dkey@entry=3Dout-of-range, su= br=3D,=20 message=3Dmessage@entry=3D"Value out of range ~S to< ~S: ~S",=20 args=3Dargs@entry=3D0x7ffff2bb2c70, data=3Ddata@entry=3D(4611686018427387901))= at error.c:90 #7 0x00007ffff7eb52a0 in scm_error (key=3Dout-of-range, subr=3D0x0, messag= e=3D,=20 args=3D0x7ffff2bb2c70,=20 rest=3D(4611686018427387901)) at error.c:62 #8 0x00007ffff7f02dd7 in range_error (bad_val=3Dbad_val@entry=3D4611686018= 427387901,=20 min=3Dmin@entry=3D0x0,=20 max=3D#) at numbers.c:6611 #9 0x00007ffff7f04dfb in scm_to_uint64 (arg=3D4611686018427387901) at inte= gers.c:259 #10 0x00007ffff7f42215 in vm_debug_engine (thread=3D0x7ffff75c1d80) at vm-e= ngine.c:1533 #11 0x00007ffff7f4c5d9 in scm_call_n (proc=3D, argv=3D, nargs=3D1) at vm.c:1610 #12 0x00007ffff7eb4457 in scm_primitive_eval (exp=3D,=20 exp@entry=3D((@ (ice-9 control) %) (begin (load-user-init) ((@ (ice-9 t= op-repl) top-repl))))) at eval.c:671 #13 0x00007ffff7eba4b6 in scm_eval ( exp=3D((@ (ice-9 control) %) (begin (load-user-init) ((@ (ice-9 top-rep= l) top-repl)))),=20 module_or_state=3D"#" =3D {...}) at eval.c:705 #14 0x00007ffff7f1e3b6 in scm_shell (argc=3D1, argv=3D0x7fffffffd058) at sc= ript.c:357 --8<---------------cut here---------------end--------------->8--- Fortunately, this was fixed recently in c0004442b7691f59a0e37869ef288eb26382ad9e. Thanks! Ludo=E2=80=99. From unknown Fri Jun 20 07:16:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 14 Feb 2023 12:24:14 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator