PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ScanHexadecimalString gets stuck in an infinite loop

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Bug Reports - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
Flecto



Joined: 03 Jun 2008
Posts: 1

PostPosted: Tue Jun 03, 2008 3:21 pm    Post subject: ScanHexadecimalString gets stuck in an infinite loop Reply with quote

The opening angle brackets of the follwoing subdictionary

Code:
<</Predictor 15
/Columns 8
/Colors 3>>


inside a content stream are falsely interpreted as the beginning of hexdecimal number. The result is that ScanHexadecimalString() of CLexer gets stuck in an infinite loop.

A possible solution to this problem might be to check at the beginning of ScanHexadecimalString() whether the NextChar is also '<'. If that's the case, ScanHexadecimalString() shouldn't continue.
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Wed Jun 04, 2008 7:49 am    Post subject: Reply with quote

That bug will be fixed with the next release (which is scheduled for summer 2008).
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
Soldier-B



Joined: 14 Oct 2008
Posts: 16
Location: USA

PostPosted: Tue Nov 25, 2008 8:49 pm    Post subject: Reply with quote

Is there a fix for this issue? I took it upon myself to basically reinvent the wheel as far as paring content streams, but I'd rather not rely on regular expressions to do all my heavy lifting. Thanks.
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Wed Nov 26, 2008 12:19 pm    Post subject: Reply with quote

If this issue still occurs with PDFsharp 1.20 published June 24, 2008 then please provide us a PDF file that allows us to replicate the issue.
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
Soldier-B



Joined: 14 Oct 2008
Posts: 16
Location: USA

PostPosted: Wed Nov 26, 2008 1:45 pm    Post subject: Reply with quote

Gladly. 140.pdf
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Thu Nov 27, 2008 8:18 am    Post subject: Reply with quote

Hi!
Soldier-B wrote:
Gladly. 140.pdf

I tested that file with PdfSharp.Explorer and with the TwoPagesOnOne sample - no endless loop.
I cannot replicate this problem with PDFsharp 1.20 published June 24, 2008.

When does this endless loop occur?
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
Soldier-B



Joined: 14 Oct 2008
Posts: 16
Location: USA

PostPosted: Mon Dec 01, 2008 5:44 pm    Post subject: Reply with quote

When using the ContentReader.ReadContent function, 100% of the time I end up stuck in the ScanHexadecimalString function with the current character always being "<" and the position never advances.

Here's some sample VB code to show you how I get stuck in the loop.

Code:

Sub Main()
    Dim doc As PdfDocument = PdfReader.Open("140.pdf")

    For Each page As PdfPage In doc.Pages
        Dim cseq As CSequence = ContentReader.ReadContent(page)
        Console.WriteLine("This message will not show.")
    Next

    doc.Close()
End Sub


I realize that this code doesn't really accomplish anything, but if you run it you will never get it to output to the console because its stuck in ScanHexadecimalString.

I hope that helps out some and thanks again.

- B
Back to top
View user's profile Send private message
Soldier-B



Joined: 14 Oct 2008
Posts: 16
Location: USA

PostPosted: Wed Dec 17, 2008 3:50 pm    Post subject: Reply with quote

Hi Thomas, I was curious to know if you were able to reproduce the infinite loop I get based on the code I posted?
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Wed Jan 07, 2009 9:40 am    Post subject: Reply with quote

Yes, I was able to replicate the problem ...
... but because parsing PDF is not my area of expertise I had to forward it to a team member.

I'm back from holiday today. I'll check if the problem was solved.
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
Soldier-B



Joined: 14 Oct 2008
Posts: 16
Location: USA

PostPosted: Mon Jan 12, 2009 2:06 pm    Post subject: Reply with quote

Thanks Thomas.
Back to top
View user's profile Send private message
Soldier-B



Joined: 14 Oct 2008
Posts: 16
Location: USA

PostPosted: Thu Apr 09, 2009 1:42 pm    Post subject: Reply with quote

I'm just curious if any progress has been made towards fixing this bug.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Bug Reports - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com