unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: `scm_c_read ()' and `swap_buffer' trick harmful
Date: Sat, 20 Dec 2008 18:10:31 +0100	[thread overview]
Message-ID: <87prjmojqw.fsf@gnu.org> (raw)
In-Reply-To: 20081219233256.GA32465@localhost

Hi,

Miroslav Lichvar <mlichvar@redhat.com> 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'.





  reply	other threads:[~2008-12-20 17:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-15 20:04 `scm_c_read ()' and `swap_buffer' trick harmful Ludovic Courtès
2008-11-20 13:22 ` Neil Jerram
2008-11-20 13:48   ` Ludovic Courtès
2008-11-20 22:25     ` Neil Jerram
2008-11-21 17:05       ` Ludovic Courtès
2008-11-22 15:02         ` Ludovic Courtès
2008-11-23 23:08           ` Neil Jerram
2008-11-23 22:30         ` Neil Jerram
2008-12-19 14:44           ` Miroslav Lichvar
2008-12-19 20:25             ` Ludovic Courtès
2008-12-19 23:32               ` Miroslav Lichvar
2008-12-20 17:10                 ` Ludovic Courtès [this message]
2008-12-20 19:11                   ` Miroslav Lichvar

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=87prjmojqw.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.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).