RE: PANIC: gwlib/octstr.c ...

"Igor Ivoilov" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
I have added debug output to octstr_case_search() (see below) 
and got the following just before the crash

2003-11-06 17:50:48 [7] DEBUG: octstr_case_search: haystack check: "Accept: application/vnd.wap.wtls-ca-certificate, text/plain, text/x-vCard, text/x-vCalendar, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/x-wap-prov.browser-settings, application/x-nokia.settings, application/vnd.wap.wtls-ca-certificate"
2003-11-06 17:50:48 [7] DEBUG: length: 261 : 261, 262 - 0
2003-11-06 17:50:48 [7] PANIC: gwlib/octstr.c:2165: seems_valid_real: Assertion `ostr->data[ostr->len] == '\0'' failed. (Called from gwlib/octstr.c:928:octstr_case_search.)


Don't understand how it is possible !!!!
Any ideas?

Igor

------
int octstr_case_search(Octstr *haystack, Octstr *needle, long pos)
{
    long i, j;
    int c1, c2;

    debug("gwlib.octstr", 0, "octstr_case_search: haystack check: \"%s\"", octstr_get_cstr(haystack));
    debug("gwlib.octsrt", 0, "length: %u : %u, %u - %u",
    				strlen(octstr_get_cstr(haystack)),
    				haystack->len,haystack->size,
    				(unsigned)haystack->data[haystack->len]);
    seems_valid(haystack);
    debug("gwlib.octstr", 0, "octstr_case_search: neddle check: \"%s\"", octstr_get_cstr(needle));
    seems_valid(needle);
    gw_assert(pos >= 0);

    /* Always "find" an empty string */
    if (needle->len == 0)
        return 0;

    for (i = pos; i <= haystack->len - needle->len; ++i) {
	for (j = 0; j < needle->len; ++j) {
	    c1 = toupper(haystack->data[i + j]);
	    c2 = toupper(needle->data[j]);
	    if (c1 != c2)
	    	break;
	}
	if (j == needle->len)
	    return i;
    }

    return -1;    
}

> -----Original Message-----
> From: Alexander Malysh [mailto:[email protected]]
> Sent: Monday, November 03, 2003 11:32 PM
> To: Igor Ivoilov; [email protected]
> Subject: Re: PANIC: gwlib/octstr.c ...
> 
> 
> Hi Igor,
> 
> unfortunately I'm not a wap expert :( Your bug is known one 
> and was reported 
> already. The bug #95 was reopened again...
> 
> Thanks a lot for backtrace!
> 
> On Monday 03 November 2003 19:26, Igor Ivoilov wrote:
> > That gives
> >
> > #0  0x080bfb72 in gw_panic ()
> > #1  0x080c6c70 in seems_valid_real ()
> > #2  0x080c39a7 in octstr_case_search ()
> > #3  0x080bd806 in http_something_accepted ()
> > #4  0x080bd851 in http_type_accepted ()
> > #5  0x08051b3b in return_reply ()
> > #6  0x08051e62 in return_replies_thread ()
> > #7  0x080b635f in new_thread ()
> > #8  0x4009eb9c in pthread_start_thread (arg=0x43b7dbe0) at 
> manager.c:259
> >
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.