From unknown Sat Aug 16 18:10:44 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#24005 <24005@debbugs.gnu.org> To: bug#24005 <24005@debbugs.gnu.org> Subject: Status: Segfault after playing around a bit Reply-To: bug#24005 <24005@debbugs.gnu.org> Date: Sun, 17 Aug 2025 01:10:44 +0000 retitle 24005 Segfault after playing around a bit reassign 24005 guile submitter 24005 Giedrius Statkevi=C4=8Dius severity 24005 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 16 11:21:35 2016 Received: (at submit) by debbugs.gnu.org; 16 Jul 2016 15:21:35 +0000 Received: from localhost ([127.0.0.1]:53909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bORPJ-0007DQ-9p for submit@debbugs.gnu.org; Sat, 16 Jul 2016 11:21:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bOO3b-00027k-SU for submit@debbugs.gnu.org; Sat, 16 Jul 2016 07:46:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOO3V-00009I-0E for submit@debbugs.gnu.org; Sat, 16 Jul 2016 07:46:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOO3U-000098-TA for submit@debbugs.gnu.org; Sat, 16 Jul 2016 07:46:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOO3S-0001yJ-1Z for bug-guile@gnu.org; Sat, 16 Jul 2016 07:46:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOO3N-00008k-R7 for bug-guile@gnu.org; Sat, 16 Jul 2016 07:46:45 -0400 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:38045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOO3N-00008Z-Ga for bug-guile@gnu.org; Sat, 16 Jul 2016 07:46:41 -0400 Received: by mail-wm0-x22b.google.com with SMTP id o80so60470623wme.1 for ; Sat, 16 Jul 2016 04:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=c/26k80VulGVso3ehwQQunMUR7xjTddpwglP9fU2AMc=; b=pr4+gEbhhOQc0NpFVx6Bj79DkeIw19NeA2QnnKaYcKNgHMLBtdk5MdTxXoq7NzJZrQ cnbi+WhNuNTM1z3guCAdAzeQMixa2PaMVjmhRkHTs/LbL1QmsXOyHPwWQ0Eq3UwdpHwB AI0xjJeAzdTSnjrAS2eKX2UhX36/Qva7qzfplMU27eIWXrKeGabr72axqL1ucHyZd14p rJIaaFutbLlCZs9rygqDDkolTLbYwMlREj+qFbV10eakgTjDo0X5FqVCJhgOjYCfjYQP ZhVHu7sxCTnmneeAApevxIM3rYIFk3W3Yzvv9cAMD+voYQ2bOfs3G6sSQtLxBxDyAKs0 y0AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=c/26k80VulGVso3ehwQQunMUR7xjTddpwglP9fU2AMc=; b=eM8I5lg7Kjw1IZKD/sYj0lSwnkkfAyr/slakkwKlOP0sdvPVdQVnqhVvCoRst4LDBb 4eB7BBaq0h9/ELwqMXutyB78z1aey5Ciaxd3RTrzTEeJYt8bjexS67uyfwUinnHRE2rk bMOxHGfmPfRdlNuATybhFawdgqcvOXTBS6IKbixCpb1V9rOYOU0xgM3TjismF5L270/J camDLc5NOOJ6rikb01l4ks/sswBKwt+DGIlPM0pW/XpWSzKEMgWmQtgqxsajFXxWWh38 P74hWEWn+IsYXCeGrBRFF5WHYOQIGNOmKPmfPrKEsXHi7Alf92hoeyPTW1uy1EXnagHm iVbA== X-Gm-Message-State: ALyK8tLfE7L+3iASRFrLuTzjI0WEDQyjGMVxysaSqNeik6whqyFdhl6TFNw29EGRkGeBiQ== X-Received: by 10.195.18.198 with SMTP id go6mr5031597wjd.172.1468669598839; Sat, 16 Jul 2016 04:46:38 -0700 (PDT) Received: from localhost (78-57-189-147.static.zebra.lt. [78.57.189.147]) by smtp.gmail.com with ESMTPSA id e9sm5305239wjy.25.2016.07.16.04.46.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Jul 2016 04:46:38 -0700 (PDT) Date: Sat, 16 Jul 2016 14:46:36 +0300 From: Giedrius =?utf-8?Q?Statkevi=C4=8Dius?= To: bug-guile@gnu.org Subject: Segfault after playing around a bit Message-ID: <20160716114636.GA31653@tyrael> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.2 (2016-07-01) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 16 Jul 2016 11:21:32 -0400 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: -4.0 (----) Basically I've been playing around with guile and trying to do a SICP exercise: diablo@tyrael:~/ > guile GNU Guile 2.0.11 Copyright (C) 1995-2014 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (define (improve guess x) (average guess (/ x guess))) ;;; :1:26: warning: possibly unbound variable `average' scheme@(guile-user)> (define (average x y) (/ (+ x y) 2)) scheme@(guile-user)> (define (improve guess x) (average guess (/ x guess))) scheme@(guile-user)> (define (good-enough? guess x) (< (abs (- (square guess) x)) 0.001)) ;;; :4:42: warning: possibly unbound variable `square' scheme@(guile-user)> (define (sqrt x) (sqrt-iter 1.0 x)) ;;; :5:17: warning: possibly unbound variable `sqrt-iter' scheme@(guile-user)> (define (square x) (* x x)) scheme@(guile-user)> (define (sqrt-iter guess x) (if (good-enough? guess x) guess (sqrt-iter (improve guess x) x))) scheme@(guile-user)> (sqrt 2) $1 = 1.4142156862745097 scheme@(guile-user)> (sqrt 9) $2 = 3.00009155413138 scheme@(guile-user)> (define (new-if predicate then-clause else-clause) (cond (predicate then-clause) (else else-clause))) scheme@(guile-user)> (new-if (> 2 1) (sqrt 2) (sqrt 3)) $3 = 1.4142156862745097 scheme@(guile-user)> (define (sqrt-iter guess x) (new-if (good-enough? guess x) guess (sqrt-iter (improve guess x) x))) scheme@(guile-user)> (sqrt 2) :4:42: In procedure good-enough?: :4:42: Throw to key `vm-error' with args `(vm-run "VM: Stack overflow" ())'. Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> (define (sqrt-iter guess x) (new-if (good-enough? guess x) guess x)) zsh: abort (core dumped) guile Stack traces: Stack trace of thread 31457: #0 0x00007f13299c0295 raise (libc.so.6) #1 0x00007f13299c16da abort (libc.so.6) #2 0x00007f132a02b128 n/a (libguile-2.0.so.22) #3 0x00007f132a02c0dd n/a (libguile-2.0.so.22) #4 0x00007f132a042968 scm_call_with_vm (libguile-2.0.so.22) #5 0x00007f132a02a9bb n/a (libguile-2.0.so.22) #6 0x00007f132a02b123 n/a (libguile-2.0.so.22) #7 0x00007f132a02c0dd n/a (libguile-2.0.so.22) #8 0x00007f1329faf023 scm_primitive_eval (libguile-2.0.so.22) #9 0x00007f1329faf083 scm_eval (libguile-2.0.so.22) #10 0x00007f132a0032c0 scm_shell (libguile-2.0.so.22) #11 0x00007f1329fcc3dd n/a (libguile-2.0.so.22) #12 0x00007f1329fa4caa n/a (libguile-2.0.so.22) #13 0x00007f132a0423b2 n/a (libguile-2.0.so.22) #14 0x00007f1329faea73 scm_call_4 (libguile-2.0.so.22) #15 0x00007f1329fa5451 n/a (libguile-2.0.so.22) #16 0x00007f1329fa5535 scm_c_with_continuation_barrier (libguile-2.0.so.22) #17 0x00007f132a0251dc n/a (libguile-2.0.so.22) #18 0x00007f1329738832 GC_call_with_stack_base (libgc.so.1) #19 0x00007f132a025608 scm_with_guile (libguile-2.0.so.22) #20 0x00007f1329fcc5b5 scm_boot_guile (libguile-2.0.so.22) #21 0x0000000000400c20 n/a (guile) #22 0x00007f13299ad741 __libc_start_main (libc.so.6) #23 0x0000000000400ca9 n/a (guile) Stack trace of thread 31461: #0 0x00007f1329d3e16d read (libpthread.so.0) #1 0x00007f132a001ea7 n/a (libguile-2.0.so.22) #2 0x00007f132973e7e2 n/a (libgc.so.1) #3 0x00007f13297329cf n/a (libgc.so.1) #4 0x00007f132973888c GC_do_blocking (libgc.so.1) #5 0x00007f132a02569a scm_without_guile (libguile-2.0.so.22) #6 0x00007f132a001df3 n/a (libguile-2.0.so.22) #7 0x00007f132a03880e n/a (libguile-2.0.so.22) #8 0x00007f1329faea0e scm_call_3 (libguile-2.0.so.22) #9 0x00007f132a027bfe scm_internal_catch (libguile-2.0.so.22) #10 0x00007f132a025b3c n/a (libguile-2.0.so.22) #11 0x00007f1329fa4caa n/a (libguile-2.0.so.22) #12 0x00007f132a03880e n/a (libguile-2.0.so.22) #13 0x00007f1329faea73 scm_call_4 (libguile-2.0.so.22) #14 0x00007f1329fa5451 n/a (libguile-2.0.so.22) #15 0x00007f1329fa5535 scm_c_with_continuation_barrier (libguile-2.0.so.22) #16 0x00007f132a0251dc n/a (libguile-2.0.so.22) #17 0x00007f1329738832 GC_call_with_stack_base (libgc.so.1) #18 0x00007f132a024bdc n/a (libguile-2.0.so.22) #19 0x00007f132973d976 n/a (libgc.so.1) #20 0x00007f1329738832 GC_call_with_stack_base (libgc.so.1) #21 0x00007f1329d35484 start_thread (libpthread.so.0) #22 0x00007f1329a746dd __clone (libc.so.6) Stack trace of thread 31458: #0 0x00007f1329d3b0af pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0) #1 0x00007f132973f867 n/a (libgc.so.1) #2 0x00007f132973570a n/a (libgc.so.1) #3 0x00007f132973da5f n/a (libgc.so.1) #4 0x00007f1329d35484 start_thread (libpthread.so.0) #5 0x00007f1329a746dd __clone (libc.so.6) Stack trace of thread 31459: #0 0x00007f1329d3b0af pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0) #1 0x00007f132973f867 n/a (libgc.so.1) #2 0x00007f132973570a n/a (libgc.so.1) #3 0x00007f132973da5f n/a (libgc.so.1) #4 0x00007f1329d35484 start_thread (libpthread.so.0) #5 0x00007f1329a746dd __clone (libc.so.6) Stack trace of thread 31460: #0 0x00007f1329d3b0af pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0) #1 0x00007f132973f867 n/a (libgc.so.1) #2 0x00007f132973570a n/a (libgc.so.1) #3 0x00007f132973da5f n/a (libgc.so.1) #4 0x00007f1329d35484 start_thread (libpthread.so.0) #5 0x00007f1329a746dd __clone (libc.so.6) So it seems to me like guile doesn't handle stack overflows gracefully and just crashes but I'm not sure. diablo@tyrael:~/ > guile --version guile (GNU Guile) 2.0.11 Copyright (C) 2014 Free Software Foundation, Inc. License LGPLv3+: GNU LGPL 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. -- Giedrius From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 06:45:20 2016 Received: (at 24005-done) by debbugs.gnu.org; 23 Jul 2016 10:45:20 +0000 Received: from localhost ([127.0.0.1]:34199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQuQq-0003lP-4q for submit@debbugs.gnu.org; Sat, 23 Jul 2016 06:45:20 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:54597 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQuQm-0003lF-3U for 24005-done@debbugs.gnu.org; Sat, 23 Jul 2016 06:45:18 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id A31AA205E5; Sat, 23 Jul 2016 06:45:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=9mMRXr0qolFU 2g2+KxrMT2asdpM=; b=kHNqDPtcx8KgtqOPXnpzInS9RYBAlI0zZ77VRmOGw5s3 T5vOUmBlroiUR/bi60Mkhekv8lECpLjnCHRP1ThSbJcs42OIin0dqZlakClOJmVP CcKsjNzBwrbo7mdmOWklf8nkq4MJ2ppVZD3fR4SdkG/67r9XWTUhI65Ys0GKxMA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=ujeLqp ycwxdvta2Wog8ayFKMGapNBzUs7IN0obCnsiI6UolzxumOBVC8HRva8I7I5EwtoT OBtENlaM4GdZaleDAESd1T8ZNDdweBNKEL4S9IsVdyRsabABsZmuc48EYMo+QNGE sVmNqjq9YXfeD3dbFNkTSAVNzwlsXNgl383jI= Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 8A6B9205E3; Sat, 23 Jul 2016 06:45:13 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 95A05205E2; Sat, 23 Jul 2016 06:45:12 -0400 (EDT) From: Andy Wingo To: Giedrius =?utf-8?Q?Statkevi=C4=8Dius?= Subject: Re: bug#24005: Segfault after playing around a bit References: <20160716114636.GA31653@tyrael> Date: Sat, 23 Jul 2016 12:45:05 +0200 In-Reply-To: <20160716114636.GA31653@tyrael> ("Giedrius =?utf-8?Q?Statkevi?= =?utf-8?Q?=C4=8Dius=22's?= message of "Sat, 16 Jul 2016 14:46:36 +0300") Message-ID: <87shv0tyz2.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: 88B42BEC-50C2-11E6-BB1A-C1836462E9F6-02397024!pb-sasl1.pobox.com X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 24005-done Cc: 24005-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: -1.3 (-) Hi :) On Sat 16 Jul 2016 13:46, Giedrius Statkevi=C4=8Dius writes: > scheme@(guile-user)> (define (sqrt-iter guess x) (new-if (good-enough? gu= ess x) > guess (sqrt-iter (improve guess x) x))) > scheme@(guile-user)> (sqrt 2) > :4:42: In procedure good-enough?: > :4:42: Throw to key `vm-error' with args `(vm-run "VM: Stack What's happening here is that you have a function that uses too much stack. In Guile 2.0 there is a fixed amount of stack. If you exceed that amount, Guile enters a nested REPL at the error: > Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. > scheme@(guile-user) [1]> (define (sqrt-iter guess x) (new-if (good-enough= ? guess > x) guess x)) So you can get a backtrace to see what's on your stack. This repl is in the context of the stack overflow -- so all the frames are still on the stack. There's just a little bit of stack reserved so that you can poke around and see what's going on. You then cause the stack overflow again, when it already overflowed, and at some point Guile detects this and because it can't handle it, it aborts (not segfaults): > zsh: abort (core dumped) guile Ah well. In Guile 2.0 we can't fix this very nicely. There's no corruption here, just a limit that we can't handle. Fortunately we fixed it in 2.2: https://wingolog.org/archives/2014/03/17/stack-overflow My machine is down for maintenance atm, should be back shortly, in the meantime there's https://web.archive.org/web/*/https://wingolog.org/archives/2014/03/17/st= ack-overflow Anyway. Thanks for the report, it's a limitation in 2.0 that's fixed in 2.2. Cheers, Andy From unknown Sat Aug 16 18:10:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 20 Aug 2016 11:24:03 +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