guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `scm_c_read ()' and `swap_buffer' trick harmful


From: Ludovic Courtès
Subject: Re: `scm_c_read ()' and `swap_buffer' trick harmful
Date: Sat, 20 Dec 2008 18:10:31 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Hi,

Miroslav Lichvar <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]