From: Andreas Rottmann <a.rottmann@gmx.at>
To: Thien-Thi Nguyen <ttn@gnuvola.org>
Cc: Guile Development <guile-devel@gnu.org>
Subject: Re: Implementing R6RS `transcoded-port'
Date: Sat, 31 Jul 2010 17:10:16 +0200 [thread overview]
Message-ID: <87iq3vwuuf.fsf@delenn.lan> (raw)
In-Reply-To: <878w4yu005.fsf@ambire.localdomain> (Thien-Thi Nguyen's message of "Mon, 26 Jul 2010 10:21:14 +0200")
Thien-Thi Nguyen <ttn@gnuvola.org> writes:
> () Andreas Rottmann <a.rottmann@gmx.at>
> () Sun, 25 Jul 2010 21:12:22 +0200
>
> result_pt->file_name = pt->file_name;
> result_pt->line_number = pt->line_number;
> result_pt->column_number = pt->column_number;
>
> result_pt->read_buf = pt->read_buf;
> result_pt->read_pos = pt->read_pos;
> result_pt->read_end = pt->read_end;
> result_pt->read_buf_size = pt->read_buf_size;
>
> result_pt->saved_read_buf = pt->saved_read_buf;
> result_pt->saved_read_pos = pt->saved_read_pos;
> result_pt->saved_read_end = pt->saved_read_end;
> result_pt->saved_read_buf_size = pt->saved_read_buf_size;
>
> result_pt->write_buf = pt->write_buf;
> result_pt->write_pos = pt->write_pos;
> result_pt->write_end = pt->write_end;
> result_pt->write_buf_size = pt->write_buf_size;
>
> result_pt->shortbuf = pt->shortbuf;
> result_pt->rw_random = pt->rw_random;
> result_pt->rw_active = pt->rw_active;
> result_pt->putback_buf = pt->putback_buf;
> result_pt->putback_buf_size = pt->putback_buf_size;
>
> scm_i_remove_port (port);
> SCM_CLR_PORT_OPEN_FLAG (port);
>
> Most likely ‘scm_i_remove_port’ arranges to clean up pt->FOO, so ‘gc’
> 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
--
Andreas Rottmann -- <http://rotty.yi.org/>
prev parent reply other threads:[~2010-07-31 15:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-25 19:12 Implementing R6RS `transcoded-port' Andreas Rottmann
2010-07-26 8:21 ` Thien-Thi Nguyen
2010-07-31 15:10 ` Andreas Rottmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87iq3vwuuf.fsf@delenn.lan \
--to=a.rottmann@gmx.at \
--cc=guile-devel@gnu.org \
--cc=ttn@gnuvola.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).