objects.cache : CGI fails if line longer than 64K characters (2.0 b3)

Andreas Ericsson ae at op5.se
Mon May 23 16:16:41 CEST 2005


François Laupretre wrote:
> Hi all,
>  

[ some cruft cut ]

>  
> After some traces in the code, I found that every CGI programs are failing
> in xodtemplate_register_servicegroup in the test for a non null
> svc_description.
>  
> If I tell him to printf 'this_servicegroup->members', I get a SIGSEGV ! Hmm
> ! So, I had it printf every 'host_name' returned by strtok, and I saw that
> the last one before the errror was truncated. And after this field, strtok
> returns NULL (for svc_description). There, we know that we have a problem
> when reading the cache file because the string is not null-terminated. And,
> looking in the cache file, I found the line to be perfect. So, the problem
> is in the read part. Another thing : if I look at the character offset where
> it is stopping, it is character number 65538 in the line. If I substract the
> 'members' prefix of 12 chars, I get an offset of 65526.
>  
> This is where I am for now. I am going to look at the function reading the
> cache file.
> 

That would be mmap_fgets. I've got a feeling you're about to discover 
that 65536 is the magic roof of the length of member-lists in 
service-descriptions. Perhaps there is an unsigned short somewhere in 
there which causes this weird limit.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click




More information about the Developers mailing list