From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.devel Subject: Re: Implementing R6RS `transcoded-port' Date: Sat, 31 Jul 2010 17:10:16 +0200 Message-ID: <87iq3vwuuf.fsf@delenn.lan> References: <87eiere5pl.fsf@delenn.lan> <878w4yu005.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1280589041 31540 80.91.229.12 (31 Jul 2010 15:10:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 31 Jul 2010 15:10:41 +0000 (UTC) Cc: Guile Development To: Thien-Thi Nguyen Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jul 31 17:10:39 2010 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.69) (envelope-from ) id 1OfDhr-00039j-Ns for guile-devel@m.gmane.org; Sat, 31 Jul 2010 17:10:36 +0200 Original-Received: from localhost ([127.0.0.1]:55718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfDhq-0007zy-Tn for guile-devel@m.gmane.org; Sat, 31 Jul 2010 11:10:34 -0400 Original-Received: from [140.186.70.92] (port=49435 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfDhj-0007zs-1x for guile-devel@gnu.org; Sat, 31 Jul 2010 11:10:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfDhh-0005qp-UM for guile-devel@gnu.org; Sat, 31 Jul 2010 11:10:26 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:47626 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OfDhh-0005qG-Ir for guile-devel@gnu.org; Sat, 31 Jul 2010 11:10:25 -0400 Original-Received: (qmail invoked by alias); 31 Jul 2010 15:10:22 -0000 Original-Received: from 83-215-154-5.hage.dyn.salzburg-online.at (EHLO nathot.lan) [83.215.154.5] by mail.gmx.net (mp046) with SMTP; 31 Jul 2010 17:10:22 +0200 X-Authenticated: #3102804 X-Provags-ID: V01U2FsdGVkX1+sC95B1TisM9qTp5f1+50xrq2bEpPFhUHaHxrocJ IeXE9w78I7rPLm Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by nathot.lan (Postfix) with ESMTP id 8875D3A695; Sat, 31 Jul 2010 17:10:21 +0200 (CEST) Original-Received: from nathot.lan ([127.0.0.1]) by localhost (nathot.lan [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EGOw5J9k-Qj8; Sat, 31 Jul 2010 17:10:17 +0200 (CEST) Original-Received: from delenn.lan (delenn.lan [192.168.3.11]) by nathot.lan (Postfix) with ESMTP id 8556D3A693; Sat, 31 Jul 2010 17:10:17 +0200 (CEST) Original-Received: by delenn.lan (Postfix, from userid 1000) id 3D2524A83EC; Sat, 31 Jul 2010 17:10:17 +0200 (CEST) In-Reply-To: <878w4yu005.fsf@ambire.localdomain> (Thien-Thi Nguyen's message of "Mon, 26 Jul 2010 10:21:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:10748 Archived-At: Thien-Thi Nguyen writes: > () Andreas Rottmann > () Sun, 25 Jul 2010 21:12:22 +0200 > > result_pt->file_name =3D pt->file_name; > result_pt->line_number =3D pt->line_number; > result_pt->column_number =3D pt->column_number; > > result_pt->read_buf =3D pt->read_buf; > result_pt->read_pos =3D pt->read_pos; > result_pt->read_end =3D pt->read_end; > result_pt->read_buf_size =3D pt->read_buf_size; > > result_pt->saved_read_buf =3D pt->saved_read_buf; > result_pt->saved_read_pos =3D pt->saved_read_pos; > result_pt->saved_read_end =3D pt->saved_read_end; > result_pt->saved_read_buf_size =3D pt->saved_read_buf_size; > > result_pt->write_buf =3D pt->write_buf; > result_pt->write_pos =3D pt->write_pos; > result_pt->write_end =3D pt->write_end; > result_pt->write_buf_size =3D pt->write_buf_size; > > result_pt->shortbuf =3D pt->shortbuf; > result_pt->rw_random =3D pt->rw_random; > result_pt->rw_active =3D pt->rw_active; > result_pt->putback_buf =3D pt->putback_buf; > result_pt->putback_buf_size =3D pt->putback_buf_size;=20 > > scm_i_remove_port (port); > SCM_CLR_PORT_OPEN_FLAG (port); > > Most likely =E2=80=98scm_i_remove_port=E2=80=99 arranges to clean up pt->= FOO, so =E2=80=98gc=E2=80=99 > ends up leaving some these assigned members (result_pt->FOO) pointing to > "valid" memory with invalid contents. For those, a pointer copy is > insufficient; you need to copy their contents to newly allocated memory. > I thought along these lines as well, but it seems the whole memory area pointed to by `result_pt' is set to zero somewhere during GC. Additionally, removing the call to `scm_i_remove_port' doesn't change this. Regards, Rotty --=20 Andreas Rottmann --