Received: (at 37066) by debbugs.gnu.org; 18 Aug 2019 21:43:54 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 18 17:43:54 2019 Received: from localhost ([127.0.0.1]:58861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hzSxu-0004eM-EE for submit <at> debbugs.gnu.org; Sun, 18 Aug 2019 17:43:54 -0400 Received: from smtpo.poczta.interia.pl ([217.74.65.159]:53908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <tona_kosmicznego_smiecia@HIDDEN>) id 1hzSxs-0004e8-Sg for 37066 <at> debbugs.gnu.org; Sun, 18 Aug 2019 17:43:53 -0400 X-Interia-R: Interia X-Interia-R-IP: 89.64.25.42 X-Interia-R-Helo: <kompiuter> Received: from kompiuter (89-64-25-42.dynamic.chello.pl [89.64.25.42]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by poczta.interia.pl (INTERIA.PL) with ESMTPSA; Sun, 18 Aug 2019 23:43:44 +0200 (CEST) Date: Sun, 18 Aug 2019 23:43:30 +0200 From: Jan <tona_kosmicznego_smiecia@HIDDEN> To: David Pirotte <david@HIDDEN> Subject: Re: bug#37066: Using GOOPS #:allocation #:virtual slot option causes stack overflow Message-ID: <20190818234330.0f4bf77d@kompiuter> In-Reply-To: <20190818050853.17b31311@capac> References: <20190818004223.22acd911@kompiuter> <20190818050853.17b31311@capac> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Interia-Antivirus: OK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=biztos; t=1566164626; bh=MGwCDxnzdH3j8r1z2A/gDnPMhE8MKPrUTcV1gJ/OZ98=; h=X-Interia-R:X-Interia-R-IP:X-Interia-R-Helo:Date:From:To:Cc: Subject:Message-ID:In-Reply-To:References:X-Mailer:MIME-Version: Content-Type:Content-Transfer-Encoding:X-Interia-Antivirus; b=XW0IBzZrMsYpU+WjcpDXROQY8d8fPe6N31G9KhibMloytzNqnhr9vxdK45HM6Mdy6 uMbJruccgGTqdQYPkOwraMLLgMzL6dgn2dBFNVlA0ko72ivQ/e4J4j5nBgvh/EIbWn k8cHPxoA49SNB/sE+gWrN+4u2W57UBUBRY41Fg2M= X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Sorry, I sent a private mail, hope this one will be in the right place. On Sun, 18 Aug 2019 05:08:53 -0300 David Pirotte wrote: > This is not goops bug. The problem occurs because you try to set the > value of the virtual slot, something you should never do. Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see <https://www.spamcop.net/bl.shtml?89.64.25.42>] 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: altosw.be] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tona_kosmicznego_smiecia[at]interia.pl) -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 37066 Cc: 37066 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.2 (/) Sorry, I sent a private mail, hope this one will be in the right place. On Sun, 18 Aug 2019 05:08:53 -0300 David Pirotte <david@HIDDEN> wrote: > This is not goops bug. The problem occurs because you try to set the > value of the virtual slot, something you should never do. Thank you for explaining, I understand it now. I don't think eating the whole CPU and RAM and segmentation fault is a good default behavior though. If this is a thing one should never do, shouldn't Guile throw an error, warning or whatever? Jan
bug-guile@HIDDEN
:bug#37066
; Package guile
.
Full text available.Received: (at 37066) by debbugs.gnu.org; 18 Aug 2019 08:09:03 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 18 04:09:03 2019 Received: from localhost ([127.0.0.1]:57309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hzGFL-0008V0-1X for submit <at> debbugs.gnu.org; Sun, 18 Aug 2019 04:09:03 -0400 Received: from maximusconfessor.all2all.org ([79.99.200.102]:35644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <david@HIDDEN>) id 1hzGFJ-0008UY-BH for 37066 <at> debbugs.gnu.org; Sun, 18 Aug 2019 04:09:01 -0400 Received: from localhost (localhost [127.0.0.1]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 14FC01BE00A7; Sun, 18 Aug 2019 10:09:00 +0200 (CEST) Received: from maximusconfessor.all2all.org ([127.0.0.1]) by localhost (maximusconfessor.all2all.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TfvDXsSQ4Y1G; Sun, 18 Aug 2019 10:09:00 +0200 (CEST) Received: from capac (unknown [179.210.16.67]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 62F461BE009E; Sun, 18 Aug 2019 10:08:59 +0200 (CEST) Date: Sun, 18 Aug 2019 05:08:53 -0300 From: David Pirotte <david@HIDDEN> To: Jan <tona_kosmicznego_smiecia@HIDDEN> Subject: Re: bug#37066: Using GOOPS #:allocation #:virtual slot option causes stack overflow Message-ID: <20190818050853.17b31311@capac> In-Reply-To: <20190818004223.22acd911@kompiuter> References: <20190818004223.22acd911@kompiuter> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/AcATnYB.ec0Q/bi1vM+3ev8"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 37066 Cc: 37066 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) --Sig_/AcATnYB.ec0Q/bi1vM+3ev8 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello Jan, > I've written the program attached below and it hangs at writing=20 > "after changing (K): ", computer freezes for a moment and then Guile > throws the following message: =20 > allocate_stack failed: Can't allocate memory > Warning: Unwind-only `stack-overflow' exception; skipping pre-unwind > handler. > ... This is not goops bug. The problem occurs because you try to set the value of the virtual slot, something you should never do. Here is a slightly corrected version of your code: (define-module (temperature) #:use-module (oop goops) #:export (<temperature> kelvin celsius)) (define-class <temperature> () (k #:accessor kelvin #:init-keyword #:k #:init-value 0) (c #:accessor celsius #:init-keyword #:c #:allocation #:virtual #:slot-ref (lambda (o) (- (kelvin o) 273.15)) #:slot-set! (lambda (o c) (set! (kelvin o) (+ 273.15 c))))) Then, in a repl: scheme@(guile-user)> (add-to-load-path "/your/temperature/module/path") scheme@(guile-user)> ,use (oop goops) scheme@(guile-user)> ,use (oop goops describe) scheme@(guile-user)> ,use (temperature) ;;; note: source file ... newer than compiled ... ;;; ... scheme@(guile-user)> (make <temperature>) $2 =3D #<<temperature> 5604c4614200> scheme@(guile-user)> (describe $2) #<<temperature> 5604c4614200> is an instance of class <temperature> Slots are:=20 k =3D 0 c =3D -273.15 scheme@(guile-user)> (set! (celsius $2) 0) $3 =3D 273.15 scheme@(guile-user)> (describe $2) #<<temperature> 5604c4614200> is an instance of class <temperature> Slots are:=20 k =3D 273.15 c =3D 0.0 > ... it also throws a different error ... I didn't look into this manual example code yet, I wanted to get back to your own example first ... David --Sig_/AcATnYB.ec0Q/bi1vM+3ev8 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAl1ZB5UACgkQ83T9k6MF etcuPQf/bMLGdfjNr8IZdCmBYcAVotYkzpUthWi9RDNJM2SOMHa59Uk41u+3Du+G ZEzol20IyvWlr1QeC16PiTi3QJIX4g2w/TdHXU8kO4p4qsxSh4xauKAE0TznrnPy E/hDjwVnNRkee7uaK2GocPOWuY6UZ7T8yFeIawlYSzeG/FoK+LiGJD7JNDoG/8a+ JxLR5+onscwUuCVybvw8gMi/UnDP+L6JQ9wDk3HiwnO9ZMnx1z8LdhEJDZtfdolg 4jFH+1+Q72dNC1gMtVjoO4pRjbi5tSw4ZtUJJw3p78Wvk5OreUbBDNqI2nl/N8LV 27DRmEOfF7DCgsEIDvnsLv/eYLBNZw== =WaA4 -----END PGP SIGNATURE----- --Sig_/AcATnYB.ec0Q/bi1vM+3ev8--
bug-guile@HIDDEN
:bug#37066
; Package guile
.
Full text available.Received: (at submit) by debbugs.gnu.org; 17 Aug 2019 22:43:07 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 17 18:43:07 2019 Received: from localhost ([127.0.0.1]:57079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hz7Pe-0001xW-So for submit <at> debbugs.gnu.org; Sat, 17 Aug 2019 18:43:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:51740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <tona_kosmicznego_smiecia@HIDDEN>) id 1hz7Pc-0001xO-KG for submit <at> debbugs.gnu.org; Sat, 17 Aug 2019 18:43:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49169) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <tona_kosmicznego_smiecia@HIDDEN>) id 1hz7Pa-0003Lw-SX for bug-guile@HIDDEN; Sat, 17 Aug 2019 18:43:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_50,FREEMAIL_FROM, RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_LOW,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <tona_kosmicznego_smiecia@HIDDEN>) id 1hz7PZ-0002BX-Fm for bug-guile@HIDDEN; Sat, 17 Aug 2019 18:43:02 -0400 Received: from smtpo.poczta.interia.pl ([217.74.65.157]:41880) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <tona_kosmicznego_smiecia@HIDDEN>) id 1hz7PY-00027v-Qw for bug-guile@HIDDEN; Sat, 17 Aug 2019 18:43:01 -0400 X-Interia-R: Interia X-Interia-R-IP: 89.64.25.42 X-Interia-R-Helo: <kompiuter> Received: from kompiuter (89-64-25-42.dynamic.chello.pl [89.64.25.42]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by poczta.interia.pl (INTERIA.PL) with ESMTPSA for <bug-guile@HIDDEN>; Sun, 18 Aug 2019 00:42:50 +0200 (CEST) Date: Sun, 18 Aug 2019 00:42:23 +0200 From: Jan <tona_kosmicznego_smiecia@HIDDEN> To: bug-guile@HIDDEN Subject: Using GOOPS #:allocation #:virtual slot option causes stack overflow Message-ID: <20190818004223.22acd911@kompiuter> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Interia-Antivirus: OK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=biztos; t=1566081771; bh=Ev6vxOozQmRNlY1fv33tbhaqmRAdTf4VlmLv7Oj0gcc=; h=X-Interia-R:X-Interia-R-IP:X-Interia-R-Helo:Date:From:To:Subject: Message-ID:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding:X-Interia-Antivirus; b=sFMUW8SQhxjvWWknSTYFzK0wbimJNvqsi4O0LdbVmMnhRGj9N06bQv4L2oGB4sJnY UC4hwjhVGemzoGQWsJ00a1qShvT/5uibu16AZB2W+m2kAjVnm8ktcylihp849XIvYl hNJGwpOO5uPdPlzuVeKA3Rp3I4k/tCWBzeZMH8kc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 217.74.65.157 X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.1 (-) Hi everyone. I've written the program attached below and it hangs at writing=20 "after changing (K): ", computer freezes for a moment and then Guile throws the following message: allocate_stack failed: Can't allocate memory Warning: Unwind-only `stack-overflow' exception; skipping pre-unwind handler. allocate_stack failed: Can't allocate memory Warning: Unwind-only `stack-overflow' exception; skipping pre-unwind handler. Guile version: 2.9.3 OS: Devuan ASCII GNU/Linux Architecture: x86_64 Code: (define-class <temperature> () (k #:init-value 0 #:init-keyword #:k #:accessor kelvin) (c #:accessor celsius #:init-keyword #:c #:allocation #:virtual #:slot-ref (lambda (o) (let ((k (slot-ref o 'k))) (- k 273.15))) #:slot-set! (lambda (o c) (slot-set! o 'c c) (slot-set! o 'k (+ 273.15 c))))) (define (test-virtual-slots) (let ((temp1 (make <temperature> #:k 0))) (display "Absolute zero(K): ") (display (kelvin temp1)) (newline) (display "Absolute zero(C): ") (display (celsius temp1)) (newline) (display "After changing (K): ") (slot-set! temp1 'c 0) (display (kelvin temp1)))) (test-virtual-slots) I couldn't find any mistake, because I'm a new Guile user, so please tell me if I'm doing something wrong. Using an example from the manual (8.5 Illustrating Slot Description) didn't help, because it also throws a different error, not sure if I hadn't copied everything or if there's something fundamentally wrong in GOOPS. The code of the example: (define-class <my-complex> (<number>) ;; True slots use rectangular coordinates (r #:init-value 0 #:accessor real-part #:init-keyword #:r) (i #:init-value 0 #:accessor imag-part #:init-keyword #:i) ;; Virtual slots access do the conversion (m #:accessor magnitude #:init-keyword #:magn #:allocation #:virtual #:slot-ref (lambda (o) (let ((r (slot-ref o =E2=80=99r)) (i (slot-ref o =E2=80= =99i))) (sqrt (+ (* r r) (* i i))))) #:slot-set! (lambda (o m) (let ((a (slot-ref o =E2=80=99a))) (slot-set! o =E2=80=99r (* m (cos a))) (slot-set! o =E2=80=99i (* m (sin a)))))) (a #:accessor angle #:init-keyword #:angle #:allocation #:virtual #:slot-ref (lambda (o) (atan (slot-ref o =E2=80=99i) (slot-ref o =E2=80=99r))) #:slot-set! (lambda(o a) (let ((m (slot-ref o =E2=80=99m))) (slot-set! o =E2=80=99r (* m (cos a))) (slot-set! o =E2=80=99i (* m (sin a))))))) (define c (make <my-complex> #:r 12 #:i 20)) (slot-set! c =E2=80=99a 3) (display "Real part: ") (display (real-part c)) (newline) (display "Angle: ") (display (angle c)) (newline) (slot-set! c =E2=80=99i 10) (set! (real-part c) 1) (describe c) The error: ;;; /home/user/Projects/guile/./goops-bug.scm:44:47: warning: possibly unbound variable `#{\x2019;i}#' ;;; /home/user/Projects/guile/./goops-bug.scm:47:28: warning: possibly unbound variable `#{\x2019;a}#' ;;; /home/user/Projects/guile/./goops-bug.scm:48:21: warning: possibly unbound variable `#{\x2019;r}#' ;;; /home/user/Projects/guile/./goops-bug.scm:49:21: warning: possibly unbound variable `#{\x2019;i}#' ;;; /home/user/Projects/guile/./goops-bug.scm:53:24: warning: possibly unbound variable `#{\x2019;i}#' ;;; /home/user/Projects/guile/./goops-bug.scm:53:40: warning: possibly unbound variable `#{\x2019;r}#' ;;; /home/user/Projects/guile/./goops-bug.scm:55:28: warning: possibly unbound variable `#{\x2019;m}#' ;;; /home/user/Projects/guile/./goops-bug.scm:56:21: warning: possibly unbound variable `#{\x2019;r}#' ;;; /home/user/Projects/guile/./goops-bug.scm:57:21: warning: possibly unbound variable `#{\x2019;i}#' ;;; /home/user/Projects/guile/./goops-bug.scm:60:0: warning: possibly unbound variable `#{\x2019;a}#' ;;; /home/user/Projects/guile/./goops-bug.scm:67:0: warning: possibly unbound variable `#{\x2019;i}#' ;;; compiled /home/user/.cache/guile/ccache/3.0-LE-8-4.1/home/user/Projects/gui= le/goops-bug.scm.go Backtrace: 5 (apply-smob/1 #<catch-closure 55db22ad7780>) In ice-9/boot-9.scm: 702:2 4 (call-with-prompt _ _ #<procedure default-prompt-handle=E2=80= =A6>) In ice-9/eval.scm: 619:8 3 (_ #(#(#<directory (guile-user) 55db22b9d750>))) In ice-9/boot-9.scm: 2296:4 2 (save-module-excursion _) 3816:12 1 (_) In /home/user/Projects/guile/./goops-bug.scm: 69:0 0 (_) /home/user/Projects/guile/./goops-bug.scm:69:0: Unbound variable: #{\x2019;a}# The line 69 is the last line of the program.
Jan <tona_kosmicznego_smiecia@HIDDEN>
:bug-guile@HIDDEN
.
Full text available.bug-guile@HIDDEN
:bug#37066
; Package guile
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.