From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Han-Wen Nienhuys Newsgroups: gmane.lisp.guile.devel Subject: Re: stumped by scm_car/scm_cdr Date: Fri, 8 Oct 2004 00:51:23 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <16741.51307.618175.489403@byrd.xs4all.nl> References: <16724.44532.557784.986630@byrd.xs4all.nl> <87zn3e739g.fsf@zagadka.ping.de> <16725.64761.208412.328474@byrd.xs4all.nl> <16740.33606.743452.458667@byrd.xs4all.nl> <87ekkaxjmm.fsf@zagadka.ping.de> Reply-To: hanwen@xs4all.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1097189563 12196 80.91.229.6 (7 Oct 2004 22:52:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Oct 2004 22:52:43 +0000 (UTC) Cc: jantien@xs4all.nl, guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Oct 08 00:52:34 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CFh7i-0000br-00 for ; Fri, 08 Oct 2004 00:52:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CFhER-0003sI-W9 for guile-devel@m.gmane.org; Thu, 07 Oct 2004 18:59:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CFhDQ-0003NC-Kk for guile-devel@gnu.org; Thu, 07 Oct 2004 18:58:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CFhDP-0003KY-2a for guile-devel@gnu.org; Thu, 07 Oct 2004 18:58:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CFhDO-0003KI-S0 for guile-devel@gnu.org; Thu, 07 Oct 2004 18:58:26 -0400 Original-Received: from [213.84.26.127] (helo=byrd.xs4all.nl) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CFh6b-0006zL-Q8 for guile-devel@gnu.org; Thu, 07 Oct 2004 18:51:26 -0400 Original-Received: from byrd.xs4all.nl (byrd.xs4all.nl [127.0.0.1]) by byrd.xs4all.nl (8.13.1/8.13.1) with ESMTP id i97MpOGH030795; Fri, 8 Oct 2004 00:51:24 +0200 Original-To: Marius Vollmer In-Reply-To: <87ekkaxjmm.fsf@zagadka.ping.de> X-Mailer: VM 7.14 under Emacs 21.3.1 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:4232 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:4232 mvo@zagadka.de writes: > Han-Wen Nienhuys writes: > > > I tried to remove all fishy looking places where SCM_C[AD]R were used, > > and now it seems to work OK. You might want to consider just doing > > abort() or a something similar as a standard. > > That would not fit SCM_CAR, SCM_CDR etc well. These macros are there > for code that knows what it does and wants to do it fast. You can use > SCM_DEBUG_CELL_ACCESSES to have them do some checks, however. These > checks will only assert that you access a cell, not whether that cell > represents a pair. > > In general Guile only aborts when there is no other way, for example > when it has run out of memory or when the error reporting mechanism > itself fails. Ok. In that case, we should figure out why this could hang. One thing that is fishy, is the fact that void scm_wrong_type_arg_msg tries to call scm_list_2(), which will fail if GC is active. I've added a check to scm_cell/scm_double_cell that calls abort() if GC is running. > So, we might talk about whether SCM_CAR and SCM_CDR should abort when > passed a non-pair, or whether they should signal an error; or whether > they should check that they are passed a cell. No, I just don't want GUILE to ever hang. An error, ungraceful or not, is always preferable. This probably fixes the cause, but wouldn't it be better to check the thread handling as well? I guess that calling scm_cell from GC causes a problem, because GC will (again) put all threads to sleep. -- Han-Wen Nienhuys | hanwen@xs4all.nl | http://www.xs4all.nl/~hanwen _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel