From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#24005: Segfault after playing around a bit Date: Sat, 23 Jul 2016 12:45:05 +0200 Message-ID: <87shv0tyz2.fsf@pobox.com> References: <20160716114636.GA31653@tyrael> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1469270792 29753 80.91.229.3 (23 Jul 2016 10:46:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2016 10:46:32 +0000 (UTC) Cc: 24005-done@debbugs.gnu.org To: Giedrius =?UTF-8?Q?Statkevi=C4=8Dius?= Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Jul 23 12:46:19 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQuRj-0006mu-NY for guile-bugs@m.gmane.org; Sat, 23 Jul 2016 12:46:15 +0200 Original-Received: from localhost ([::1]:51316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQuRj-00069u-4z for guile-bugs@m.gmane.org; Sat, 23 Jul 2016 06:46:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQuRb-000688-6Z for bug-guile@gnu.org; Sat, 23 Jul 2016 06:46:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQuRW-000326-V0 for bug-guile@gnu.org; Sat, 23 Jul 2016 06:46:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQuRW-000322-P2 for bug-guile@gnu.org; Sat, 23 Jul 2016 06:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bQuRW-0003mT-H0 for bug-guile@gnu.org; Sat, 23 Jul 2016 06:46:02 -0400 Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Sat, 23 Jul 2016 10:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 24005 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Mail-Followup-To: 24005@debbugs.gnu.org, wingo@pobox.com, giedriuswork@gmail.com Original-Received: via spool by 24005-done@debbugs.gnu.org id=D24005.146927072014475 (code D ref 24005); Sat, 23 Jul 2016 10:46:02 +0000 Original-Received: (at 24005-done) by debbugs.gnu.org; 23 Jul 2016 10:45:20 +0000 Original-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 Original-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 Original-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= Original-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) Original-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) In-Reply-To: <20160716114636.GA31653@tyrael> ("Giedrius =?UTF-8?Q?Statkevi=C4=8Dius?="'s message of "Sat, 16 Jul 2016 14:46:36 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: 88B42BEC-50C2-11E6-BB1A-C1836462E9F6-02397024!pb-sasl1.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8315 Archived-At: 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