Bug found in glimpse regarding long <title>s and -X flag

11 views
Skip to first unread message

Doug McLaren

unread,
Nov 21, 2008, 2:03:54 PM11/21/08
to Webglimpse Search Software
I used to occasionally get errors like this from glimpseindex when
using the -X flag --

permission denied or non-existent file: /x/search/data/stripped/vipers/
024500-024999/24675.html tag for the ssc_run_pipe_toptemplate.
Add Detail Text bmccoy Jun 22 2000 05\:52\:03PM 5.x
StoryServer Platform; 5.0 Site Server IntegrationToolkit\:
SSCEToolkit50.zip Changed State jromano Jun 23 2000 07\:17\:
08AM -START- FIELD\: ResponsibleUserID FROM\:TO\: tzgarba -END- -
START- FIELD\: StateID FROM\: Open - Unassigned TO\: Open - Assigned -
END- -START- FIELD\: Action FROM\: NoAction TO\: Fix -END- -START-
FIELD\: Expected Releases FROM\: -unspecified- TO\: 1.0 -END- Add
Detail Text tzgarba Jul06 2000 03\:28\:05PM Updated all
template titles to match file names in the Test Cases project.
Changed State tzgarba Jul 06 2000 03\:28\:05PM -START- FIELD\:
StateID FROM\: Open - Assigned TO\: Resolved -END- -START- FIELD\:
Action FROM\: FixTO\: Fixed -END- Add Detail Text bmccoy Jul
10 2000 08\:59\:59AM Verified in Release Candidate #2. Changed
Statebmccoy Jul 10 2000 08\:59\:59AM -START- FIELD\: StateID FROM
\: Resolved TO\: Closed -E

... and the file would not be indexed. It was always the same files,
and they failed every time. (It was occasionally in that only a few
files would fail, but it was constant in that they failed every time I
indexed.)

Turns out that what the files had in common was a <title> tag but no
corresponding </title> tag. The bug was also triggered by titles that
were over 1024 characters in length (which explains why having no
closing tag would trigger it -- everything after <title> was
considered to be part of the title, and that's usually more than 1024
bytes. It happened even if the files were actually text as well --
but somebody mentioned a <title> tag ...

I was able to fix it myself. I went into index/filetype.c and changed
line 227 from --

while ((i<num_read) && (k<max_len - 1)) {

to

while ((i<num_read) && (k<max_len - strlen(name) - 3)) {

I'm not sure why I had to subtract 3 (seperator, line feed?) but 2 and
1 didn't work. My C-fu is weak. Perhaps 3 is too small for all
cases, though it seems to work for my test cases.

I sent a report to Golda Velez about it, but no response. I don't
think there's much development or much of anything going on with
glimpse any more ...

Reply all
Reply to author
Forward
0 new messages