Account Options

  1. Sign in
Google Groups Home
« Groups Home
A short fix for a buffer "carry over" bug
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Yoni Rabkin  
View profile  
 More options Oct 26 2009, 5:19 pm
From: Yoni Rabkin <yonirab...@gmail.com>
Date: Mon, 26 Oct 2009 14:19:13 -0700 (PDT)
Local: Mon, Oct 26 2009 5:19 pm
Subject: A short fix for a buffer "carry over" bug
I ran into another UTF-8 encoding bug and wrote a one-liner fix for
it: http://montezuma-dev.googlegroups.com/web/fix-carry-over-bug.patch.
The more octets used to encode characters, the more likely this bug is
to happen (and is therefore rare in plain English).

The problem was that the loop in `read-term-vector' expects the
"common" part of the sequence from the previous term to be available
in the buffer when it reads the new term.

The fix works for me. If it makes sense I'll post a test as well.

P.S. Perhaps a more comprehensive fix would take into account the
FIXME note for `read-char'.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leslie P. Polzer  
View profile  
 More options Oct 27 2009, 5:30 am
From: "Leslie P. Polzer" <s...@viridian-project.de>
Date: Tue, 27 Oct 2009 02:30:17 -0700 (PDT)
Local: Tues, Oct 27 2009 5:30 am
Subject: Re: A short fix for a buffer "carry over" bug
On Oct 26, 10:19 pm, Yoni Rabkin <yonirab...@gmail.com> wrote:

> I ran into another UTF-8 encoding bug and wrote a one-liner fix for
> it:http://montezuma-dev.googlegroups.com/web/fix-carry-over-bug.patch.
> The more octets used to encode characters, the more likely this bug is
> to happen (and is therefore rare in plain English).

I'm happy you manage to dig out so many hidden multi-byte character
bugs. :)

> The problem was that the loop in `read-term-vector' expects the
> "common" part of the sequence from the previous term to be available
> in the buffer when it reads the new term.

Is it never available (as I would guess from your patch) or only
sometimes?

> P.S. Perhaps a more comprehensive fix would take into account the
> FIXME note for `read-char'.

What note are you referring to? Do you mean READ-CHARS by any chance?

  Leslie


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yoni Rabkin  
View profile  
 More options Oct 27 2009, 6:17 am
From: Yoni Rabkin <yonirab...@gmail.com>
Date: Tue, 27 Oct 2009 03:17:46 -0700 (PDT)
Local: Tues, Oct 27 2009 6:17 am
Subject: Re: A short fix for a buffer "carry over" bug
On Oct 27, 11:30 am, "Leslie P. Polzer" <s...@viridian-project.de>
wrote:

When using the original 15-long buffer the content mattered or
not depending on the value of START, that is, how much in common
the current term had with the previous term.

But when the 15-long buffer wasn't long enough the code created a
completely new buffer, and didn't copy over any "common" parts
from the smaller one. So in this case the common parts where
never available.

> > P.S. Perhaps a more comprehensive fix would take into account the
> > FIXME note for `read-char'.

> What note are you referring to? Do you mean READ-CHARS by any chance?

My apologies for being so vague; Yes, I mean `read-chars' from line 50
of
store/index-io.lisp.

(I tend to agree with the FIXME note there. Forcing callers to
use the return value seems unlispy to me.)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leslie P. Polzer  
View profile  
 More options Oct 27 2009, 7:31 am
From: "Leslie P. Polzer" <s...@viridian-project.de>
Date: Tue, 27 Oct 2009 12:31:24 +0100 (CET)
Local: Tues, Oct 27 2009 7:31 am
Subject: Re: A short fix for a buffer "carry over" bug

Yoni Rabkin wrote:
> (I tend to agree with the FIXME note there. Forcing callers to
> use the return value seems unlispy to me.)

Yes, CLHS has enough precedence cases to make me agree with that.
Let's remove the FIXME and replace it with a check for the array
bounds.

The original patch looks appropriate now that I understand the
issue better.

  Leslie


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yoni Rabkin  
View profile  
 More options Oct 29 2009, 3:24 am
From: Yoni Rabkin <yonirab...@gmail.com>
Date: Thu, 29 Oct 2009 00:24:11 -0700 (PDT)
Local: Thurs, Oct 29 2009 3:24 am
Subject: Re: A short fix for a buffer "carry over" bug

> Let's remove the FIXME and replace it with a check for the array
> bounds.

> The original patch looks appropriate now that I understand the
> issue better.

OK, how about these?

http://groups.google.com/group/montezuma-dev/web/test-fix-carry-over-...
http://groups.google.com/group/montezuma-dev/web/read-chars-add-bound...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leslie P. Polzer  
View profile  
 More options Oct 29 2009, 6:12 am
From: "Leslie P. Polzer" <s...@viridian-project.de>
Date: Thu, 29 Oct 2009 11:12:08 +0100 (CET)
Local: Thurs, Oct 29 2009 6:12 am
Subject: Re: A short fix for a buffer "carry over" bug

Hmm, the test case fails for me even after rebuilding all object files:

;; MONTEZUMA::TEST-TERM-VECTOR-IO-ADD-FIELDS-BMP .........
WARNING: FAILURE:
   Test MONTEZUMA::TEST-TERM-VECTOR-IO-ADD-FIELDS-OVERFLOW-BUFFER-10:
   (AREF (MONTEZUMA::TERMS MONTEZUMA::TV)
         1) evaluated to " RUNNING {A989C49}>:
  Condition MONTEZUMA::TEST-FAILURE was signalled.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yoni Rabkin  
View profile  
 More options Oct 29 2009, 1:00 pm
From: Yoni Rabkin <yonirab...@gmail.com>
Date: Thu, 29 Oct 2009 10:00:11 -0700 (PDT)
Local: Thurs, Oct 29 2009 1:00 pm
Subject: Re: A short fix for a buffer "carry over" bug
On Oct 29, 12:12 pm, "Leslie P. Polzer" <s...@viridian-project.de>
wrote:

> Yoni Rabkin wrote:
> >http://groups.google.com/group/montezuma-dev/web/test-fix-carry-over-...
> >http://groups.google.com/group/montezuma-dev/web/read-chars-add-bound...

> Hmm, the test case fails for me even after rebuilding all object files:

> ;; MONTEZUMA::TEST-TERM-VECTOR-IO-ADD-FIELDS-BMP .........
> WARNING: FAILURE:
>    Test MONTEZUMA::TEST-TERM-VECTOR-IO-ADD-FIELDS-OVERFLOW-BUFFER-10:
>    (AREF (MONTEZUMA::TERMS MONTEZUMA::TV)
>          1) evaluated to " RUNNING {A989C49}>:
>   Condition MONTEZUMA::TEST-FAILURE was signalled.

I definitely don't get that with the patch installed. Can you post the
rest of the "evaluated to ..." The null chars cause the copy-paste to
truncate.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leslie P. Polzer  
View profile  
 More options Oct 30 2009, 9:28 am
From: "Leslie P. Polzer" <s...@viridian-project.de>
Date: Fri, 30 Oct 2009 06:28:06 -0700 (PDT)
Local: Fri, Oct 30 2009 9:28 am
Subject: Re: A short fix for a buffer "carry over" bug
On Oct 29, 6:00 pm, Yoni Rabkin <yonirab...@gmail.com> wrote:

> I definitely don't get that with the patch installed. Can you post the
> rest of the "evaluated to ..." The null chars cause the copy-paste to
> truncate.

The output is actually truncated at the console already.

A print form of the string in (aref (terms tv) 1) after putting it
through string-to-octets
yields:

  #(0 0 0 0 0 0 112 115 101 117 100 111 104 121 112 111 112 97 114 97
116 104 121
    114 111 105 100 105 115 109)

The exact form I put in before test-term-vector-io-add-fields-overflow-
buffer-10 is:

  (pprint (babel:string-to-octets (aref (terms tv) 1)))

Hope that helps...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yoni Rabkin  
View profile  
 More options Oct 30 2009, 10:53 am
From: Yoni Rabkin <yonirab...@gmail.com>
Date: Fri, 30 Oct 2009 07:53:18 -0700 (PDT)
Local: Fri, Oct 30 2009 10:53 am
Subject: Re: A short fix for a buffer "carry over" bug
That's the exact output I would expect without the term-vectors-
io.lisp patch. Could you please post your version of (defmethod read-
term-vector ((self term-vectors-reader) ...) from term-vectors-
io.lisp?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leslie P. Polzer  
View profile  
 More options Oct 30 2009, 11:08 am
From: "Leslie P. Polzer" <s...@viridian-project.de>
Date: Fri, 30 Oct 2009 08:08:42 -0700 (PDT)
Local: Fri, Oct 30 2009 11:08 am
Subject: Re: A short fix for a buffer "carry over" bug
On Oct 30, 3:53 pm, Yoni Rabkin <yonirab...@gmail.com> wrote:

> That's the exact output I would expect without the term-vectors-
> io.lisp patch. Could you please post your version of (defmethod read-
> term-vector ((self term-vectors-reader) ...) from term-vectors-
> io.lisp?

Committed as r420 after having resolved the problem on #lisp.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »