Ferret crashing ruby while highlighting


#1

Hi,

I am having a problem where ferret.so is crashing which highlighting
search results. The query string is
“25,42,53,80,88,119,135,139,389,445,464,563,593,636,1441,1442,1444,1515,
1519,1527,1537,1546,3389”. In the debugger I can see that the crash
happens in search.c on line 907. The reason is that the excerpt->end
field is -1. I think the reason is because in this code from search.c:

        for (e_start = e_end = 0; e_start < mv->size; e_start++) {

            const int start_offset = matches[e_start].start_offset;

            if (e_start > e_end) {

                running_score = 0.0;

                e_end = e_start;

            }

            while (e_end < mv->size && (matches[e_end].end_offset

                                         <= start_offset +

excerpt_len)) {

                running_score += matches[e_end].score;

                e_end++;

            }

            pq_push(excerpt_pq,

                    excerpt_new(e_start, e_end - 1, running_score));

            /* - 0.1 so that earlier matches take priority */

            running_score -= matches[e_start].score;

        }

e_end is never being incremented beyond 0, so e_end-1 is stored as the
excerpt. However I am not sure why that is.

Anyway, thought this bug report might be useful.

Regards,

Chris Waters

CTO, PhD

Network Chemistry, Inc

Email: removed_email_address@domain.invalid
mailto:removed_email_address@domain.invalid

Phone: (650) 858-3125

www.networkchemistry.com http://www.networkchemistry.com/

www.projectwishbone.com http://www.wirelessve.org/