From unknown Thu Aug 14 21:49:37 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#10616 <10616@debbugs.gnu.org> To: bug#10616 <10616@debbugs.gnu.org> Subject: Status: flush procedure for soft ports isn't called Reply-To: bug#10616 <10616@debbugs.gnu.org> Date: Fri, 15 Aug 2025 04:49:37 +0000 retitle 10616 flush procedure for soft ports isn't called reassign 10616 guile submitter 10616 Ian Price severity 10616 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 26 17:18:39 2012 Received: (at submit) by debbugs.gnu.org; 26 Jan 2012 22:18:39 +0000 Received: from localhost ([127.0.0.1]:45928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RqXeQ-0001hQ-3V for submit@debbugs.gnu.org; Thu, 26 Jan 2012 17:18:38 -0500 Received: from eggs.gnu.org ([140.186.70.92]:52385) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RqXeM-0001hD-UA for submit@debbugs.gnu.org; Thu, 26 Jan 2012 17:18:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqXdi-0001SB-Rz for submit@debbugs.gnu.org; Thu, 26 Jan 2012 17:17:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:48393) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqXdi-0001S7-O3 for submit@debbugs.gnu.org; Thu, 26 Jan 2012 17:17:54 -0500 Received: from eggs.gnu.org ([140.186.70.92]:34464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqXdh-00037v-Gu for bug-guile@gnu.org; Thu, 26 Jan 2012 17:17:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqXdd-0001Ri-2c for bug-guile@gnu.org; Thu, 26 Jan 2012 17:17:53 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:44671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqXdc-0001RI-Re for bug-guile@gnu.org; Thu, 26 Jan 2012 17:17:49 -0500 Received: by wgbds1 with SMTP id ds1so913541wgb.30 for ; Thu, 26 Jan 2012 14:17:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=pMAsRIzhTr/eR0g45gVKBRqGelnWZ0PBhsFoqa4OBP4=; b=CuxLjwv3AEYwZEK07Zc6JZlt6ZyQMelgPMbv5Z6VjchrrYV2e2yfly5zV1eUegrrWA xt7hbrIWtm//YeRIhGlfDFQOgDEHWYZnXuptkdwz645xU8rFQ/yTKzPKQTAxCmS4vNjV C9tNS8cD2AWBUdTEuu8le9G+34fiQc57+xgoE= Received: by 10.180.97.166 with SMTP id eb6mr6957666wib.5.1327616267305; Thu, 26 Jan 2012 14:17:47 -0800 (PST) Received: from Kagami.home (host86-161-100-160.range86-161.btcentralplus.com. [86.161.100.160]) by mx.google.com with ESMTPS id ho4sm7809665wib.3.2012.01.26.14.17.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jan 2012 14:17:45 -0800 (PST) From: Ian Price To: bug-guile Subject: flush procedure for soft ports isn't called Date: Thu, 26 Jan 2012 22:10:37 +0000 Message-ID: <878vkuyv1e.fsf@Kagami.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.2 (---) Hi guilers, I've noticed when trying to use soft ports that the 3rd procedure in the vector doesn't get called when I use `force-output'. The simplest example follows scheme@(guile=E2=88=92user)> (let* ((port (make-soft-port (vector #f #f (lambda () 'flushed) #f #f) "rw"))) (force-output port)) scheme@(guile=E2=88=92user)>=20 I have no issues with the other procedures. This is on current stable, on 32 bit x86 running Fedora 16. More complicated examples available on request. --=20 Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 00:52:53 2012 Received: (at 10616) by debbugs.gnu.org; 27 Jan 2012 05:52:53 +0000 Received: from localhost ([127.0.0.1]:46033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rqek0-0003lF-JA for submit@debbugs.gnu.org; Fri, 27 Jan 2012 00:52:53 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:37875) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rqejw-0003kx-G9 for 10616@debbugs.gnu.org; Fri, 27 Jan 2012 00:52:49 -0500 Received: by wicr5 with SMTP id r5so941988wic.3 for <10616@debbugs.gnu.org>; Thu, 26 Jan 2012 21:52:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=lkFgDATlRCO5Rqa7xnNPY5h5LcZRnk2UvbrFf7jCsyE=; b=JALiFNrEfKXzAvMXVdpsiPIIxwYibqKQhNoKv99C65SvdRICl3YCYLrlkZxaVQyqn7 UCJZumRss2YL9IlrVb5hCaRHVD8bffNM5+aoeQelyxD1tXLsi58JTDPjOJEDJyuHwg+o zq533JvrzWRDZ0snCFUwLFxCpOSTHmAwJimzY= Received: by 10.180.104.4 with SMTP id ga4mr9214571wib.17.1327643526906; Thu, 26 Jan 2012 21:52:06 -0800 (PST) Received: from Kagami.home (host86-161-100-160.range86-161.btcentralplus.com. [86.161.100.160]) by mx.google.com with ESMTPS id d9sm9382080wiy.2.2012.01.26.21.52.05 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jan 2012 21:52:06 -0800 (PST) From: Ian Price To: 10616@debbugs.gnu.org Subject: Re: bug#10616: flush procedure for soft ports isn't called References: <878vkuyv1e.fsf@Kagami.home> Date: Fri, 27 Jan 2012 05:44:59 +0000 In-Reply-To: <878vkuyv1e.fsf@Kagami.home> (Ian Price's message of "Thu, 26 Jan 2012 22:10:37 +0000") Message-ID: <874nvhzokk.fsf@Kagami.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 10616 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) Ian Price writes: > scheme@(guile=E2=88=92user)> (let* ((port (make-soft-port > (vector #f #f (lambda () 'flushed) #f = #f) > "rw"))) > (force-output port)) > scheme@(guile=E2=88=92user)>=20 Yak, this example is a horrible one, since force-output doesn't return the return value of the procedure anyway, but if you try replacing it with (lambda () (throw 'wontthrow)), and you'll see it doesn't error In sf_flush in libguile/vports.c, there is a test if (pt->write_pos > pt->write_buf) which some printf debugging tells me is never true, in fact, those values never change, no matter how much I write to the port. Some food for thought while I grapple with how the ports code is supposed to work. --=20 Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 01:35:44 2012 Received: (at 10616) by debbugs.gnu.org; 27 Jan 2012 06:35:44 +0000 Received: from localhost ([127.0.0.1]:46038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RqfPT-00054H-D0 for submit@debbugs.gnu.org; Fri, 27 Jan 2012 01:35:44 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:34920) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RqfPQ-00053x-1n for 10616@debbugs.gnu.org; Fri, 27 Jan 2012 01:35:41 -0500 Received: by wicr5 with SMTP id r5so956795wic.3 for <10616@debbugs.gnu.org>; Thu, 26 Jan 2012 22:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=OoMlPvwrbCtmaGj1zxklPOczwKFZfc5Lf6y8/Vv6ojc=; b=VYiAUdn9jL7FP/OBj2N9jAuCepBtEmmV2i1VL07lx1NVCSillXY95auWwZ0Up9KxfV Olo2fN1x7MuE7EbAWcbUQXbRyIT30QX7dLdQjUFcaTWWBGBbaYOrArokWCLT1hdjIwZX mWEM+87GzaBe+SqCR6oj4XxKWLgO6IfU7s5kw= Received: by 10.180.92.73 with SMTP id ck9mr8795071wib.2.1327646098270; Thu, 26 Jan 2012 22:34:58 -0800 (PST) Received: from Kagami.home (host86-161-100-160.range86-161.btcentralplus.com. [86.161.100.160]) by mx.google.com with ESMTPS id hc10sm9510242wib.8.2012.01.26.22.34.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jan 2012 22:34:57 -0800 (PST) From: Ian Price To: 10616@debbugs.gnu.org Subject: Re: bug#10616: flush procedure for soft ports isn't called References: <878vkuyv1e.fsf@Kagami.home> <874nvhzokk.fsf@Kagami.home> Date: Fri, 27 Jan 2012 06:27:47 +0000 In-Reply-To: <874nvhzokk.fsf@Kagami.home> (Ian Price's message of "Fri, 27 Jan 2012 05:44:59 +0000") Message-ID: <87zkd9y80s.fsf@Kagami.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 10616 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) Ian Price writes: > Yak, this example is a horrible one, since force-output doesn't return > the return value of the procedure anyway, but if you try replacing it > with (lambda () (throw 'wontthrow)), and you'll see it doesn't error > > In sf_flush in libguile/vports.c, there is a test > if (pt->write_pos > pt->write_buf) > which some printf debugging tells me is never true, in fact, those > values never change, no matter how much I write to the port. Some food > for thought while I grapple with how the ports code is supposed to work. OK, so as I understand it, this is supposed to check if there has been a write to the port. And the buffer will have at most one character in it because it is set up that way in scm_port_non_buffer. I notice that sf_write doesn't update this buffer, but instead just calls the write procedure directly. In that case, it makes sense that the value isn't changing, and therefore maybe I should just change sf_flush into a wrapper for the flush procedure? -- Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 01:52:45 2012 Received: (at 10616) by debbugs.gnu.org; 27 Jan 2012 06:52:45 +0000 Received: from localhost ([127.0.0.1]:46058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rqffv-0005YK-Kb for submit@debbugs.gnu.org; Fri, 27 Jan 2012 01:52:44 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:38293) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rqfft-0005Y4-59 for 10616@debbugs.gnu.org; Fri, 27 Jan 2012 01:52:42 -0500 Received: by werm10 with SMTP id m10so971233wer.3 for <10616@debbugs.gnu.org>; Thu, 26 Jan 2012 22:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=Klja9W2aEaLr21jvmjdzFHavJnamvuJMjtJsBkD0BPc=; b=bEQ43KC15P2SgqUdsqEEOdIw06fI46w0VMUZ/90WotjxkIh8Au/ffC8jiN2SelA2Sq tyKxHb6oV3S7/44vorbu4bIhYZ/q6bD2yvz3rGYhZsBAgnRiZGHD7SbsNqvORmtjy993 6QaaV3TJprw/vwcttslxIeCMq2HBG4CXBRCYQ= Received: by 10.216.137.7 with SMTP id x7mr2347740wei.52.1327647119305; Thu, 26 Jan 2012 22:51:59 -0800 (PST) Received: from Kagami.home (host86-161-100-160.range86-161.btcentralplus.com. [86.161.100.160]) by mx.google.com with ESMTPS id t6sm9623007wid.1.2012.01.26.22.51.57 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jan 2012 22:51:58 -0800 (PST) From: Ian Price To: 10616@debbugs.gnu.org Subject: Re: bug#10616: flush procedure for soft ports isn't called References: <878vkuyv1e.fsf@Kagami.home> <874nvhzokk.fsf@Kagami.home> <87zkd9y80s.fsf@Kagami.home> Date: Fri, 27 Jan 2012 06:44:52 +0000 In-Reply-To: <87zkd9y80s.fsf@Kagami.home> (Ian Price's message of "Fri, 27 Jan 2012 06:27:47 +0000") Message-ID: <87vcnxy78b.fsf@Kagami.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 10616 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) --=-=-= Ian Price writes: > I notice that sf_write doesn't update this buffer, but instead just > calls the write procedure directly. In that case, it makes sense that > the value isn't changing, and therefore maybe I should just change > sf_flush into a wrapper for the flush procedure? I decided to go ahead and do this. Patch attached. Test case missing as is traditional for soft ports :), though in all seriousness, soft ports have been around for ages, and this lack of testing for it is, unsettling. -- Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" --=-=-= Content-Type: message/external-body; name*0*=us-ascii''~%2fsrc%2fguile%2f0001-Fix-flush-on-soft-ports-so-that-; name*1*=it-actually-runs.patch; access-type=local-file Content-Type: text/x-patch Content-ID: <87ty3hy78b.fsf@Kagami.home> Content-Transfer-Encoding: binary --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 15:37:15 2012 Received: (at 10616) by debbugs.gnu.org; 27 Jan 2012 20:37:15 +0000 Received: from localhost ([127.0.0.1]:47066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RqsXr-000403-2K for submit@debbugs.gnu.org; Fri, 27 Jan 2012 15:37:15 -0500 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:29980) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RqsXo-0003zn-Af for 10616@debbugs.gnu.org; Fri, 27 Jan 2012 15:37:13 -0500 X-IronPort-AV: E=Sophos;i="4.71,582,1320620400"; d="scan'208";a="141754860" Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 27 Jan 2012 21:36:26 +0100 From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) To: Ian Price Subject: Re: bug#10616: flush procedure for soft ports isn't called References: <878vkuyv1e.fsf@Kagami.home> <874nvhzokk.fsf@Kagami.home> <87zkd9y80s.fsf@Kagami.home> <87vcnxy78b.fsf@Kagami.home> Date: Fri, 27 Jan 2012 21:36:17 +0100 In-Reply-To: <87vcnxy78b.fsf@Kagami.home> (Ian Price's message of "Fri, 27 Jan 2012 06:44:52 +0000") Message-ID: <8762fwublq.fsf@gnu.org> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: 10616 Cc: 10616@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Hi Ian, I fail to see the patch, and to retrieve it from . Could you resend it inline? Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 15:59:51 2012 Received: (at 10616) by debbugs.gnu.org; 27 Jan 2012 20:59:51 +0000 Received: from localhost ([127.0.0.1]:47072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rqsti-0004Va-Dj for submit@debbugs.gnu.org; Fri, 27 Jan 2012 15:59:51 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:39432) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rqstf-0004VL-Px for 10616@debbugs.gnu.org; Fri, 27 Jan 2012 15:59:48 -0500 Received: by werm10 with SMTP id m10so1570288wer.3 for <10616@debbugs.gnu.org>; Fri, 27 Jan 2012 12:59:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=m72jpdGwt1dzncUoCJNflcXCwmrFs9qg5xHZtysiSG0=; b=v90jN/dRvW16uDqHXs203dgqwUIAdkoDuIIIT8aUYbflZE2H42A4LLuvSp5EtqPMYA EJz+Ag5Jm8OYZo+S0DxRG+cjJfrS0fBm5DjSTmB4mOR/yRwm10diLI4ccW/1g/6wWyly fGV/nuEo5sLiPcQea1MyNsem2dZ9xgg3CVPn8= Received: by 10.216.133.141 with SMTP id q13mr3656093wei.1.1327697942662; Fri, 27 Jan 2012 12:59:02 -0800 (PST) Received: from Kagami.home (host86-161-100-160.range86-161.btcentralplus.com. [86.161.100.160]) by mx.google.com with ESMTPS id t6sm14316167wid.1.2012.01.27.12.59.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jan 2012 12:59:01 -0800 (PST) From: Ian Price To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#10616: flush procedure for soft ports isn't called References: <878vkuyv1e.fsf@Kagami.home> <874nvhzokk.fsf@Kagami.home> <87zkd9y80s.fsf@Kagami.home> <87vcnxy78b.fsf@Kagami.home> <8762fwublq.fsf@gnu.org> Date: Fri, 27 Jan 2012 20:51:52 +0000 In-Reply-To: <8762fwublq.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Fri, 27 Jan 2012 21:36:17 +0100") Message-ID: <87obtoyil3.fsf@Kagami.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 10616 Cc: 10616@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi Ian, > > I fail to see the patch, and to retrieve it from > . Could you resend it inline? Bah, that's twice this has happened recently. --=20 Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-flush-on-soft-ports-so-that-it-actually-runs.patch Content-Description: soft port patch >From 8a9524014ce85fb34fe5cfd7a2667395ce0cdf5d Mon Sep 17 00:00:00 2001 From: Ian Price Date: Fri, 27 Jan 2012 06:38:09 +0000 Subject: [PATCH] Fix flush on soft ports, so that it actually runs. * libguile/vports.c (sf_flush): Remove conditional testing the position in the port's write_buf, as it is no longer used. --- libguile/vports.c | 18 ++++-------------- 1 files changed, 4 insertions(+), 14 deletions(-) diff --git a/libguile/vports.c b/libguile/vports.c index 5178d79..75e7df3 100644 --- a/libguile/vports.c +++ b/libguile/vports.c @@ -56,21 +56,11 @@ sf_flush (SCM port) scm_t_port *pt = SCM_PTAB_ENTRY (port); SCM stream = SCM_PACK (pt->stream); - if (pt->write_pos > pt->write_buf) - { - /* write the byte. */ - scm_call_1 (SCM_SIMPLE_VECTOR_REF (stream, 0), - SCM_MAKE_CHAR (*pt->write_buf)); - pt->write_pos = pt->write_buf; - - /* flush the output. */ - { - SCM f = SCM_SIMPLE_VECTOR_REF (stream, 2); + SCM f = SCM_SIMPLE_VECTOR_REF (stream, 2); + + if (scm_is_true (f)) + scm_call_0 (f); - if (scm_is_true (f)) - scm_call_0 (f); - } - } } static void -- 1.7.7.6 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 08 00:10:11 2012 Received: (at 10616-done) by debbugs.gnu.org; 8 Mar 2012 05:10:11 +0000 Received: from localhost ([127.0.0.1]:38419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S5VcB-0005on-BT for submit@debbugs.gnu.org; Thu, 08 Mar 2012 00:10:11 -0500 Received: from world.peace.net ([96.39.62.75]:40281) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S5Vbp-0005o7-Mw for 10616-done@debbugs.gnu.org; Thu, 08 Mar 2012 00:10:00 -0500 Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1S5Vai-0000xX-8m; Thu, 08 Mar 2012 00:08:40 -0500 From: Mark H Weaver To: Ian Price Subject: Re: bug#10616: flush procedure for soft ports isn't called References: <878vkuyv1e.fsf@Kagami.home> <874nvhzokk.fsf@Kagami.home> <87zkd9y80s.fsf@Kagami.home> <87vcnxy78b.fsf@Kagami.home> <8762fwublq.fsf@gnu.org> <87obtoyil3.fsf@Kagami.home> Date: Thu, 08 Mar 2012 00:06:38 -0500 In-Reply-To: <87obtoyil3.fsf@Kagami.home> (Ian Price's message of "Fri, 27 Jan 2012 20:51:52 +0000") Message-ID: <8762efvfz5.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10616-done Cc: 10616-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hi Ian, Ian Price writes: > From 8a9524014ce85fb34fe5cfd7a2667395ce0cdf5d Mon Sep 17 00:00:00 2001 > From: Ian Price > Date: Fri, 27 Jan 2012 06:38:09 +0000 > Subject: [PATCH] Fix flush on soft ports, so that it actually runs. > > * libguile/vports.c (sf_flush): Remove conditional testing the > position in the port's write_buf, as it is no longer used. > --- > libguile/vports.c | 18 ++++-------------- > 1 files changed, 4 insertions(+), 14 deletions(-) > > diff --git a/libguile/vports.c b/libguile/vports.c > index 5178d79..75e7df3 100644 > --- a/libguile/vports.c > +++ b/libguile/vports.c > @@ -56,21 +56,11 @@ sf_flush (SCM port) > scm_t_port *pt = SCM_PTAB_ENTRY (port); > SCM stream = SCM_PACK (pt->stream); > > - if (pt->write_pos > pt->write_buf) > - { > - /* write the byte. */ > - scm_call_1 (SCM_SIMPLE_VECTOR_REF (stream, 0), > - SCM_MAKE_CHAR (*pt->write_buf)); > - pt->write_pos = pt->write_buf; > - > - /* flush the output. */ > - { > - SCM f = SCM_SIMPLE_VECTOR_REF (stream, 2); > + SCM f = SCM_SIMPLE_VECTOR_REF (stream, 2); > + > + if (scm_is_true (f)) > + scm_call_0 (f); > > - if (scm_is_true (f)) > - scm_call_0 (f); > - } > - } > } > > static void Applied, thanks! Mark From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 08 08:54:53 2012 Received: (at 10616) by debbugs.gnu.org; 8 Mar 2012 13:54:53 +0000 Received: from localhost ([127.0.0.1]:38875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S5dnw-0001sE-PQ for submit@debbugs.gnu.org; Thu, 08 Mar 2012 08:54:53 -0500 Received: from xanadu.aquilenet.fr ([88.191.123.111]:48753) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S5dnj-0001rq-Si for 10616@debbugs.gnu.org; Thu, 08 Mar 2012 08:54:40 -0500 Received: from localhost (xanadu.aquilenet.fr [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id 91E71736D; Thu, 8 Mar 2012 14:53:33 +0100 (CET) Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a8NwdayGLhWs; Thu, 8 Mar 2012 14:53:33 +0100 (CET) Received: from pluto (unknown [193.50.110.167]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id 3D316736C; Thu, 8 Mar 2012 14:53:33 +0100 (CET) From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) To: Ian Price Subject: Re: bug#10616: flush procedure for soft ports isn't called References: <878vkuyv1e.fsf@Kagami.home> <874nvhzokk.fsf@Kagami.home> <87zkd9y80s.fsf@Kagami.home> <87vcnxy78b.fsf@Kagami.home> <8762fwublq.fsf@gnu.org> <87obtoyil3.fsf@Kagami.home> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 19 =?iso-8859-1?Q?Vent=F4se?= an 220 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: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Thu, 08 Mar 2012 14:53:32 +0100 In-Reply-To: <87obtoyil3.fsf@Kagami.home> (Ian Price's message of "Fri, 27 Jan 2012 20:51:52 +0000") Message-ID: <87vcmfjj1f.fsf@gnu.org> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 10616 Cc: 10616@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hello! Ian Price skribis: >=20=20 > - if (pt->write_pos > pt->write_buf) > - { > - /* write the byte. */ > - scm_call_1 (SCM_SIMPLE_VECTOR_REF (stream, 0), > - SCM_MAKE_CHAR (*pt->write_buf)); > - pt->write_pos =3D pt->write_buf; > -=20=20 > - /* flush the output. */ > - { > - SCM f =3D SCM_SIMPLE_VECTOR_REF (stream, 2); > + SCM f =3D SCM_SIMPLE_VECTOR_REF (stream, 2); > + > + if (scm_is_true (f)) > + scm_call_0 (f); >=20=20 > - if (scm_is_true (f)) > - scm_call_0 (f); > - } > - } > } It=E2=80=99s a bit late to reply (sorry, Ian!), but the reason it took me so long, is that I wanted to understand the rationale for the =E2=80=98if=E2= =80=99, and the implications of dropping it (which I never got around to, as you can see. ;-)) Mark: what=E2=80=99s your take on this? I=E2=80=99m especially concerned w= ith undesirable side effects in user code. Thanks, Ludo=E2=80=99. From mhw@netris.org Thu Mar 08 10:43:55 2012 Received: (at 10616) by debbugs.gnu.org; 9 Mar 2012 07:46:36 +0000 Received: from [96.39.62.75] (port=40878 helo=world.peace.net) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S5fV1-0004Pk-SK for 10616@debbugs.gnu.org; Thu, 08 Mar 2012 10:43:55 -0500 Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1S5fTC-0007eR-V6; Thu, 08 Mar 2012 10:41:35 -0500 From: Mark H Weaver To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#10616: flush procedure for soft ports isn't called References: <878vkuyv1e.fsf@Kagami.home> <874nvhzokk.fsf@Kagami.home> <87zkd9y80s.fsf@Kagami.home> <87vcnxy78b.fsf@Kagami.home> <8762fwublq.fsf@gnu.org> <87obtoyil3.fsf@Kagami.home> <87vcmfjj1f.fsf@gnu.org> Date: Thu, 08 Mar 2012 10:39:31 -0500 In-Reply-To: <87vcmfjj1f.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 08 Mar 2012 14:53:32 +0100") Message-ID: <87linbt83w.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 10616 Cc: Ian Price , 10616@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 15:43:55 -0000 ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Ian Price skribis: > >>=20=20 >> - if (pt->write_pos > pt->write_buf) >> - { >> - /* write the byte. */ >> - scm_call_1 (SCM_SIMPLE_VECTOR_REF (stream, 0), >> - SCM_MAKE_CHAR (*pt->write_buf)); >> - pt->write_pos =3D pt->write_buf; >> -=20=20 >> - /* flush the output. */ >> - { >> - SCM f =3D SCM_SIMPLE_VECTOR_REF (stream, 2); >> + SCM f =3D SCM_SIMPLE_VECTOR_REF (stream, 2); >> + >> + if (scm_is_true (f)) >> + scm_call_0 (f); >>=20=20 >> - if (scm_is_true (f)) >> - scm_call_0 (f); >> - } >> - } >> } > > It=E2=80=99s a bit late to reply (sorry, Ian!), but the reason it took me= so > long, is that I wanted to understand the rationale for the =E2=80=98if=E2= =80=99, and the > implications of dropping it (which I never got around to, as you can > see. ;-)) > > Mark: what=E2=80=99s your take on this? I=E2=80=99m especially concerned= with > undesirable side effects in user code. I searched libguile for occurrences of 'write_pos' and 'write_buf', and convinced myself that Ian's analysis was indeed correct. The write buffer is not used by the core ports code. Writes are forwarded directly to the write function of the specific port type, which may use the write buffer if it wishes to, but need not. The write buffer is used only by certain types of ports: currently string ports and file ports. It is not used by soft ports. Thanks, Mark From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 10 17:44:26 2012 Received: (at 10616) by debbugs.gnu.org; 10 Mar 2012 22:44:26 +0000 Received: from localhost ([127.0.0.1]:44077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6V1V-0007VN-Df for submit@debbugs.gnu.org; Sat, 10 Mar 2012 17:44:25 -0500 Received: from xanadu.aquilenet.fr ([88.191.123.111]:39645) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6V1T-0007VD-6A for 10616@debbugs.gnu.org; Sat, 10 Mar 2012 17:44:24 -0500 Received: from localhost (xanadu.aquilenet.fr [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id B210473CF; Sat, 10 Mar 2012 23:14:40 +0100 (CET) Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KjT-pLGx8Rc9; Sat, 10 Mar 2012 23:14:40 +0100 (CET) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id D96B173CE; Sat, 10 Mar 2012 23:14:39 +0100 (CET) From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) To: Mark H Weaver Subject: Re: bug#10616: flush procedure for soft ports isn't called References: <878vkuyv1e.fsf@Kagami.home> <874nvhzokk.fsf@Kagami.home> <87zkd9y80s.fsf@Kagami.home> <87vcnxy78b.fsf@Kagami.home> <8762fwublq.fsf@gnu.org> <87obtoyil3.fsf@Kagami.home> <87vcmfjj1f.fsf@gnu.org> <87linbt83w.fsf@netris.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 21 =?iso-8859-1?Q?Vent=F4se?= an 220 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: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Sat, 10 Mar 2012 23:14:39 +0100 In-Reply-To: <87linbt83w.fsf@netris.org> (Mark H. Weaver's message of "Thu, 08 Mar 2012 10:39:31 -0500") Message-ID: <87399gaysw.fsf@gnu.org> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 10616 Cc: Ian Price , 10616@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hi Mark, Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Ian Price skribis: >> >>>=20=20 >>> - if (pt->write_pos > pt->write_buf) >>> - { >>> - /* write the byte. */ >>> - scm_call_1 (SCM_SIMPLE_VECTOR_REF (stream, 0), >>> - SCM_MAKE_CHAR (*pt->write_buf)); >>> - pt->write_pos =3D pt->write_buf; >>> -=20=20 >>> - /* flush the output. */ >>> - { >>> - SCM f =3D SCM_SIMPLE_VECTOR_REF (stream, 2); >>> + SCM f =3D SCM_SIMPLE_VECTOR_REF (stream, 2); >>> + >>> + if (scm_is_true (f)) >>> + scm_call_0 (f); >>>=20=20 >>> - if (scm_is_true (f)) >>> - scm_call_0 (f); >>> - } >>> - } >>> } >> >> It=E2=80=99s a bit late to reply (sorry, Ian!), but the reason it took m= e so >> long, is that I wanted to understand the rationale for the =E2=80=98if= =E2=80=99, and the >> implications of dropping it (which I never got around to, as you can >> see. ;-)) >> >> Mark: what=E2=80=99s your take on this? I=E2=80=99m especially concerne= d with >> undesirable side effects in user code. > > I searched libguile for occurrences of 'write_pos' and 'write_buf', and > convinced myself that Ian's analysis was indeed correct. The write > buffer is not used by the core ports code. Writes are forwarded > directly to the write function of the specific port type, which may use > the write buffer if it wishes to, but need not. The write buffer is > used only by certain types of ports: currently string ports and file > ports. It is not used by soft ports. OK. Thanks for the detailed analysis! Ludo=E2=80=99. From unknown Thu Aug 14 21:49:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 08 Apr 2012 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