Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Mar 29, 2024 11:21 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
PostPosted: Sat Jun 26, 2010 5:47 am 
Offline
Newbie

Joined: Sat Jun 26, 2010 5:30 am
Posts: 2
Howdy,

After scanning a system, when I try and download a full pdf, I get the dreaded blank html file. Partial PDFs work just fine.

Took a look at the server logs, it first was exceeding the php time limit, so i disabled time limits altogether. Then it started exceeding the memory limit (was 128M) so I upped it to 256M. Still no luck - it now runs for quite a while... I'd say somewhere between 5 and 10 minutes, slowly eating more and more memory. Eventually, it exceeds the new memory limit and reverts to blank page. Partial downloads are returned almost immediatly (so fast that I can't tell how much memory they're using via top). I can keep increasing memory I suppose, but on another server a full report is topping out at about 40 MB, so I'm thinking that's not my problem.

I'm using the latest SVN build (svn revision 1244), running on CentOS 5.5, Apache 2.2.3, php 5.1.6.

Any suggestions?


Last edited by bigfitz on Mon Jun 28, 2010 6:40 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 28, 2010 6:37 am 
Offline
Newbie

Joined: Sat Jun 26, 2010 5:30 am
Posts: 2
Well, after not getting any response and seeing that there were a few similar support / bug posts with the same problem and no responses there either, I thought I'd find and fix the problem. Probably too little too late, since V2 is on it's way, but better late than never, I suppose.

Anyway problem was a bug in the ancient ezpdf library. Essentially the horizontal tables were too big for the page, and ezpdf's algorithm to shrink the table has a flaw in it. In certain cases, it would make a column smaller than the width of a single character... when putting that text in a pdf, it would see there wasn't enough room and move to the next line, where it would see there wasn't enough room and move to the next line, etc. It would go on creating blank lines and new pages until memory was exhausted. I've submitted the fix to the ezpdf authors, but since they haven't updated it in 7 years, i'm not expecting any luck with that. In the meantime here's the fix:

Starting on line 774 of lib/ezpdf/class.ezpdf.php change
[code] if ($w>$widest){
$aWidest=array($colName);
$nWidest = $widest;
$widest=$w;
}else if ($w==$widest){
$aWidest[]=$colName;
} [/code]
to
[code] if ($w>$widest){
$aWidest=array($colName);
$nWidest = $widest;
$widest=$w;
}else if ($w==$widest){
$aWidest[]=$colName;
}else if($w > $nWidest){
$nWidest = $w;
}[/code]

This is an issue that could affect anyone, so Dev's - you may want to look into including this change into the codebase.

Hope it helps.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group