From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: `scm_c_read ()' and `swap_buffer' trick harmful Date: Sat, 20 Dec 2008 18:10:31 +0100 Message-ID: <87prjmojqw.fsf@gnu.org> References: <87vduo92nj.fsf@gnu.org> <49dd78620811200522k315281c8m9d952a17145b2479@mail.gmail.com> <871vx6ik42.fsf@gnu.org> <49dd78620811201425j5dcd7e0g4165c8ea4c6b08ce@mail.gmail.com> <87fxllt3f7.fsf@gnu.org> <49dd78620811231430o5f0d6dc7u16c2fbf29b73c57c@mail.gmail.com> <20081219144446.GC20162@localhost> <87myerdia0.fsf@gnu.org> <20081219233256.GA32465@localhost> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1229793067 18122 80.91.229.12 (20 Dec 2008 17:11:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Dec 2008 17:11:07 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Dec 20 18:12:15 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LE5N4-0007ku-My for guile-devel@m.gmane.org; Sat, 20 Dec 2008 18:12:10 +0100 Original-Received: from localhost ([127.0.0.1]:55517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LE5Ls-00076q-Aa for guile-devel@m.gmane.org; Sat, 20 Dec 2008 12:10:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LE5Lo-00076O-OO for guile-devel@gnu.org; Sat, 20 Dec 2008 12:10:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LE5Ln-00075t-3D for guile-devel@gnu.org; Sat, 20 Dec 2008 12:10:52 -0500 Original-Received: from [199.232.76.173] (port=51043 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LE5Lm-00075p-Ud for guile-devel@gnu.org; Sat, 20 Dec 2008 12:10:50 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:55976 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LE5Lm-0005Av-G7 for guile-devel@gnu.org; Sat, 20 Dec 2008 12:10:50 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LE5Lf-0001Sm-H5 for guile-devel@gnu.org; Sat, 20 Dec 2008 17:10:43 +0000 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 20 Dec 2008 17:10:43 +0000 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 20 Dec 2008 17:10:43 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 30 Frimaire an 217 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: i686-pc-linux-gnu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) Cancel-Lock: sha1:sj/dlRM/Ejj/OC+MupQ2RGb966w= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:7938 Archived-At: Hi, Miroslav Lichvar writes: > Here it is, let me know if you need anything else. > > (gdb) bt > #0 0x00007f6b232b6f05 in raise () from /lib64/libc.so.6 > #1 0x00007f6b232b8a73 in abort () from /lib64/libc.so.6 > #2 0x00007f6b232afef9 in __assert_fail () from /lib64/libc.so.6 > #3 0x0000000000d52b92 in scm_fill_input (port=0x7f6b1d4b7420) at ports.c:978 > #4 0x0000000000638b66 in internal_ly_parse_scm (ps=0x7fff2b827bc0) at parse-scm.cc:43 This function reads this: SCM form = scm_read (port); /* Reset read_buf for scm_ftell. Shouldn't scm_read () do this for us? */ scm_fill_input (port); The answer to the question here is "yes": `scm_fill_input ()' is really an internal function (although its name suggests otherwise) and shouldn't be called directly. When calling `scm_read ()', `scm_fill_input ()' is called behind the scenes when PORT's buffer needs to be refilled. Thus, I would suggest removing the call to `scm_fill_input ()'. Can you tell whether it fixes the problem? Thanks in advance, Ludo'.