Hi,

FYI: The AES decryption seems to corrupt memory. Valgrind shows tons of 
errors.

Best regards,
        Dom

Am Mittwoch, 30. September 2009 schrieb Dominik Seichter:
> Hi Alan,
>
> I can reproduce the crash with current trunk on Linux, too. It seems to be
> a PoDoFo issue. I currently have no time to look into this issue, I will be
> away for four days. Maybe someone else want's to take a look until I am
> back. Callstack can be found below (reproduced using ParserTest from the
> PoDoFo distribution).
>
> Best regards,
>       Dom
>
> _gdb ./ParserTest
> GNU gdb 6.8-debian
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html> This is free software: you are free to
> change and redistribute it. There is NO WARRANTY, to the extent permitted
> by law.  Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu"...
> (gdb) run ch06-error-handling.pdf out.pdf
> Starting
> program: /home/dominik/Desktop/Programming/podofo/podofo-build/test/Par
> serTest/ParserTest ch06-error-handling.pdf out.pdf
> [Thread debugging using libthread_db enabled]
> This test reads a PDF file from disk and writes it to a new pdf file.
> The PDF file should look unmodified in any viewer
> ---
> Parsing  ch06-error-handling.pdf with demand loading off ...DEBUG:
> Size=3115 DEBUG: Reading numbers: 3115 263
> DEBUG: Reading XRef Section: 3115 with 263 Objects.
> DEBUG: Reading numbers: 0 3115
> DEBUG: Reading XRef Section: 0 with 3115 Objects.
> DEBUG: The PDF file is encrypted.
> DEBUG: Authentication with empty password: 1.
> [New Thread 0x7fb8685836f0 (LWP 24323)]
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x7fb8685836f0 (LWP 24323)]
> 0x00007fb8667be360 in ?? () from /lib/libc.so.6
> (gdb) bt
> #0  0x00007fb8667be360 in ?? () from /lib/libc.so.6
> #1  0x00007fb8667bfea1 in ?? () from /lib/libc.so.6
> #2  0x00007fb8667c3c1c in free () from /lib/libc.so.6
> #3  0x00007fb86805db2f in
> __gnu_cxx::new_allocator<PoDoFo::PdfObject>::deallocat
> e (this=0x6ebd18, __p=0x6ef760)
> at /usr/include/c++/4.2/ext/new_allocator.h:97
> #4  0x00007fb86805db61 in std::_Vector_base<PoDoFo::PdfObject,
> std::allocator<Po
> DoFo::PdfObject> >::_M_deallocate (this=0x6ebd18, __p=0x6ef760, __n=4)
>     at /usr/include/c++/4.2/bits/stl_vector.h:134
> #5  0x00007fb86805f3cf in ~_Vector_base (this=0x6ebd18)
>     at /usr/include/c++/4.2/bits/stl_vector.h:120
> #6  0x00007fb86805f42e in ~vector (this=0x6ebd18)
>     at /usr/include/c++/4.2/bits/stl_vector.h:268
> #7  0x00007fb86805e813 in ~PdfArray (this=0x6ebd10)
>     at /home/dominik/Desktop/Programming/podofo/podofo/src/PdfArray.cpp:35
> #8  0x00007fb86810b0cc in PoDoFo::PdfVariant::Clear (this=0x7fff705b2d50)
>     at
> /home/dominik/Desktop/Programming/podofo/podofo/src/PdfVariant.cpp:179 #9 
> 0x00007fb86810b11a in PoDoFo::PdfVariant::operator= (this=0x7fff705b2d50,
> r...@0x7fff705b2af0)
>     at
> /home/dominik/Desktop/Programming/podofo/podofo/src/PdfVariant.cpp:292 #10
> 0x00007fb868106980 in PoDoFo::PdfTokenizer::ReadName (this=0x6ef338,
> rvaria...@0x7fff705b2d50)
>
> at /home/dominik/Desktop/Programming/podofo/podofo/src/PdfTokenizer.cpp:731
> #11 0x00007fb8681075f9 in PoDoFo::PdfTokenizer::ReadDataType
> (this=0x6ef338, ---Type <return> to continue, or q <return> to quit---
>     eDataType=PoDoFo::ePdfDataType_Name, rvaria...@0x7fff705b2d50,
>     pEncrypt=0x60f980)
>
> at /home/dominik/Desktop/Programming/podofo/podofo/src/PdfTokenizer.cpp:501
> #12 0x00007fb8681076f0 in PoDoFo::PdfTokenizer::GetNextVariant
> (this=0x6ef338, pszToken=0x604510 "Subtype",
> eType=PoDoFo::ePdfTokenType_Delimiter, rvaria...@0x7fff705b2d50,
> pEncrypt=0x60f980)
>
> at /home/dominik/Desktop/Programming/podofo/podofo/src/PdfTokenizer.cpp:339
> #13 0x00007fb8681073d6 in PoDoFo::PdfTokenizer::ReadDictionary
> (this=0x6ef338, rvaria...@0x6ef2f0, pEncrypt=0x60f980)
>
> at /home/dominik/Desktop/Programming/podofo/podofo/src/PdfTokenizer.cpp:540
> #14 0x00007fb8681075a5 in PoDoFo::PdfTokenizer::ReadDataType
> (this=0x6ef338, eDataType=PoDoFo::ePdfDataType_Dictionary,
> rvaria...@0x6ef2f0, pEncrypt=0x60f980)
>
> at /home/dominik/Desktop/Programming/podofo/podofo/src/PdfTokenizer.cpp:489
> #15 0x00007fb8681076f0 in PoDoFo::PdfTokenizer::GetNextVariant
> (this=0x6ef338, pszToken=0x604510 "Subtype",
> eType=PoDoFo::ePdfTokenType_Delimiter, rvaria...@0x6ef2f0,
> pEncrypt=0x60f980)
>
> at /home/dominik/Desktop/Programming/podofo/podofo/src/PdfTokenizer.cpp:339
> #16 0x00007fb8680f3534 in PoDoFo::PdfParserObject::ParseFileComplete (
>     this=0x6ef2f0, bIsTrailer=false)
>
> at
> /home/dominik/Desktop/Programming/podofo/podofo/src/PdfParserObject.cpp:194
> #17 0x00007fb8680f3709 in PoDoFo::PdfParserObject::DelayedLoadImpl (
> ---Type <return> to continue, or q <return> to quit---
>     this=0x6ef2f0)
>
> at
> /home/dominik/Desktop/Programming/podofo/podofo/src/PdfParserObject.cpp:345
> #18 0x00007fb8680591cf in PoDoFo::PdfVariant::DelayedLoad (this=0x6ef2f0)
> at /home/dominik/Desktop/Programming/podofo/podofo/src/PdfVariant.h:502 #19
> 0x00007fb8680f3c1e in PoDoFo::PdfParserObject::ParseFile (this=0x6ef2f0,
> pEncrypt=0x60f980, bIsTrailer=false)
>
> at
> /home/dominik/Desktop/Programming/podofo/podofo/src/PdfParserObject.cpp:144
> #20 0x00007fb8680eabad in PoDoFo::PdfParser::ReadObjectsInternal (
> this=0x7fff705b3510)
>     at
> /home/dominik/Desktop/Programming/podofo/podofo/src/PdfParser.cpp:1009 #21
> 0x00007fb8680ebac4 in PoDoFo::PdfParser::ReadObjects (this=0x7fff705b3510)
> at /home/dominik/Desktop/Programming/podofo/podofo/src/PdfParser.cpp:992
> #22 0x00007fb8680ef362 in PoDoFo::PdfParser::ParseFile
> (this=0x7fff705b3510, rdevi...@0x7fff705b3480, bLoadOnDemand=false)
>     at
> /home/dominik/Desktop/Programming/podofo/podofo/src/PdfParser.cpp:194 #23
> 0x00007fb8680ef6b8 in PoDoFo::PdfParser::ParseFile (this=0x7fff705b3510,
> pszFilename=0x7fff705b564f "ch06-error-handling.pdf", bLoadOnDemand=false)
> at /home/dominik/Desktop/Programming/podofo/podofo/src/PdfParser.cpp:136
> #24 0x0000000000401f07 in main (argc=3, argv=0x7fff705b3938)
>
> at
> /home/dominik/Desktop/Programming/podofo/podofo/test/ParserTest/ParserTest.
>cpp:157 (gdb)
>
> Am Mittwoch, 30. September 2009 schrieb Alan Morgan:
> > Windows XP, podofo-0.7.0, VS8
> >
> > Here is the call stack:
> >
> > ntdll.dll!executehand...@20()  + 0x24 bytes
> > ntdll.dll!_kiuserexceptiondispatc...@8()  + 0xe bytes
> > ntdll.dll!_rtlallocateh...@12()  + 0xc0a bytes
> > oDoFoLib.dll!malloc(unsigned int size=0x00000038)  Line 163 + 0x63
> > bytes       C PoDoFoLib.dll!operator new(unsigned int size=0x00000038)  
> > Line 59
> > + 0x8 bytes C++ PoDoFoLib.dll!PoDoFo::PdfDictionary::AddKey(const
> > PoDoFo::PdfName & identifier={...}, const PoDoFo::PdfObject &
> > rObject={...})  Line 129 + 0x7 bytes        C++
> > PoDoFoLib.dll!PoDoFo::PdfTokenizer::ReadDictionary(PoDoFo::PdfVariant &
> > rVariant={...}, PoDoFo::PdfEncrypt * pEncrypt=0x00b2b4d8)  Line 521 +
> > 0x2f bytes  C++
> > PoDoFoLib.dll!PoDoFo::PdfTokenizer::ReadDataType(PoDoFo::EPdfDataType
> > eDataType=ePdfDataType_Dictionary, PoDoFo::PdfVariant & rVariant={...},
> > PoDoFo::PdfEncrypt * pEncrypt=0x00b2b4d8)  Line 495 C++
> > PoDoFoLib.dll!PoDoFo::PdfTokenizer::GetNextVariant(PoDoFo::PdfVariant &
> > rVariant={...}, PoDoFo::PdfEncrypt * pEncrypt=0x00b2b4d8)  Line 315 +
> > 0x3d bytes  C++
> > PoDoFoLib.dll!PoDoFo::PdfParserObject::ParseFileComplete(bool
> > bIsTrailer=false)  Line 176 C++
> > PoDoFoLib.dll!PoDoFo::PdfParserObject::DelayedLoadImpl()  Line 325  C++
> > PoDoFoLib.dll!PoDoFo::PdfElement::PdfElement(const char *
> > pszType=0x00000000, PoDoFo::PdfObject * pObject=0x0185c1e0)  Line 51 +
> > 0xe bytes   C++ PoDoFoLib.dll!PoDoFo::PdfInfo::PdfInfo(PoDoFo::PdfObject *
> > pObject=0x0185c1e0)  Line 40        C++
> > PoDoFoLib.dll!PoDoFo::PdfMemDocument::InitFromParser(PoDoFo::PdfParser *
> > pParser=0x00b25300)  Line 125 + 0x17 bytes  C++
> > PoDoFoLib.dll!PoDoFo::PdfMemDocument::Load(const char *
> > pszFilename=0x00b35398)  Line 145   C++
> > PoDoFoLib.dll!PoDoFo::PdfMemDocument::PdfMemDocument(const char *
> > pszFilename=0x00b35398)  Line 65    C++
> >
> > The PDF file in question is
> > http://advancedqtp.net/newtest/wp-content/uploads/2008/03/ch06-error-hand
> >li ng.pdf
> >
> > The only interesting thing about it that I can see is that it's
> > modification password protected, but other files from the same site are
> > too and they work fine.  ac...@t doesn't have complaints.   Other than
> > that I've done very little analysis.
> >
> > I had some difficulty in getting CMake to work so I rolled my own vcproj
> > files.  User error is not out of the question (although other PDF files
> > are working fine, as I said).
> >
> > Alan



-- 
**********************************************************************
Dominik Seichter - [email protected]
KRename  - http://www.krename.net  - Powerful batch renamer for KDE
KBarcode - http://www.kbarcode.net - Barcode and label printing
PoDoFo - http://podofo.sf.net - PDF generation and parsing library
SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game,  for KDE
Alan - http://alan.sf.net - A Turing Machine in Java
**********************************************************************

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to