Thanks for the reply.

The only Valgrind errors I see in HelloWorld on Linux are with CreateFont:

==25307== Invalid read of size 1
==25307==    at 0x47F43F8: memmove (mc_replace_strmem.c:517)
==25307==    by 0x80672AF:
PoDoFo::PdfFontType1::EmbedFontFile(PoDoFo::PdfObject*) (in
/home/jkelley/c/a.out)
==25307==    by 0x80EE799: PoDoFo::PdfFontSimple::Init(bool, PoDoFo::PdfName
const&) (in /home/jkelley/c/a.out)
==25307==    by 0x8067DC9:
PoDoFo::PdfFontType1::PdfFontType1(PoDoFo::PdfFontMetrics*,
PoDoFo::PdfEncoding const*, PoDoFo::PdfVecObjects*, bool) (in
/home/jkelley/c/a.out)
==25307==    by 0x80667AD:
PoDoFo::PdfFontFactory::CreateFontForType(PoDoFo::EPdfFontType,
PoDoFo::PdfFontMetrics*, PoDoFo::PdfEncoding const*, bool,
PoDoFo::PdfVecObjects*) (in /home/jkelley/c/a.out)
==25307==    by 0x80669A7:
PoDoFo::PdfFontFactory::CreateFontObject(PoDoFo::PdfFontMetrics*, int,
PoDoFo::PdfEncoding const*, PoDoFo::PdfVecObjects*) (in
/home/jkelley/c/a.out)
==25307==    by 0x805D1D5:
PoDoFo::PdfFontCache::CreateFontObject(__gnu_cxx::__normal_iterator<PoDoFo::TFontCacheElement*,
std::vector<PoDoFo::TFontCacheElement,
std::allocator<PoDoFo::TFontCacheElement> > >,
std::vector<PoDoFo::TFontCacheElement,
std::allocator<PoDoFo::TFontCacheElement> >&, PoDoFo::PdfFontMetrics*, bool,
bool, bool, char const*, PoDoFo::PdfEncoding const*) (in
/home/jkelley/c/a.out)
==25307==    by 0x805E95E: PoDoFo::PdfFontCache::GetFont(char const*, bool,
bool, bool, PoDoFo::PdfEncoding const*, char const*) (in
/home/jkelley/c/a.out)
==25307==    by 0x804FCC1: PoDoFo::PdfDocument::CreateFont(char const*,
PoDoFo::PdfEncoding const*, bool) (in /home/jkelley/c/a.out)
==25307==    by 0x804C3E5: HelloWorld(char const*) (in
/home/jkelley/c/a.out)
==25307==    by 0x804C8FB: main (in /home/jkelley/c/a.out)
==25307==  Address 0x750cc4d is 0 bytes after a block of size 106,309
alloc'd
==25307==    at 0x47F2D6E: malloc (vg_replace_malloc.c:207)
==25307==    by 0x80670BE:
PoDoFo::PdfFontType1::EmbedFontFile(PoDoFo::PdfObject*) (in
/home/jkelley/c/a.out)
==25307==    by 0x80EE799: PoDoFo::PdfFontSimple::Init(bool, PoDoFo::PdfName
const&) (in /home/jkelley/c/a.out)
==25307==    by 0x8067DC9:
PoDoFo::PdfFontType1::PdfFontType1(PoDoFo::PdfFontMetrics*,
PoDoFo::PdfEncoding const*, PoDoFo::PdfVecObjects*, bool) (in
/home/jkelley/c/a.out)
==25307==    by 0x80667AD:
PoDoFo::PdfFontFactory::CreateFontForType(PoDoFo::EPdfFontType,
PoDoFo::PdfFontMetrics*, PoDoFo::PdfEncoding const*, bool,
PoDoFo::PdfVecObjects*) (in /home/jkelley/c/a.out)
==25307==    by 0x80669A7:
PoDoFo::PdfFontFactory::CreateFontObject(PoDoFo::PdfFontMetrics*, int,
PoDoFo::PdfEncoding const*, PoDoFo::PdfVecObjects*) (in
/home/jkelley/c/a.out)
==25307==    by 0x805D1D5:
PoDoFo::PdfFontCache::CreateFontObject(__gnu_cxx::__normal_iterator<PoDoFo::TFontCacheElement*,
std::vector<PoDoFo::TFontCacheElement,
std::allocator<PoDoFo::TFontCacheElement> > >,
std::vector<PoDoFo::TFontCacheElement,
std::allocator<PoDoFo::TFontCacheElement> >&, PoDoFo::PdfFontMetrics*, bool,
bool, bool, char const*, PoDoFo::PdfEncoding const*) (in
/home/jkelley/c/a.out)
==25307==    by 0x805E95E: PoDoFo::PdfFontCache::GetFont(char const*, bool,
bool, bool, PoDoFo::PdfEncoding const*, char const*) (in
/home/jkelley/c/a.out)
==25307==    by 0x804FCC1: PoDoFo::PdfDocument::CreateFont(char const*,
PoDoFo::PdfEncoding const*, bool) (in /home/jkelley/c/a.out)
==25307==    by 0x804C3E5: HelloWorld(char const*) (in
/home/jkelley/c/a.out)
==25307==    by 0x804C8FB: main (in /home/jkelley/c/a.out)

I'm not sure if this is a false positive or a genuine error.  At any rate,
it's occurring after the crash I'm getting in C++Builder, so I'm assuming at
this point that my problem is caused by a compiler or RTL bug in
C++Builder.  (Although I have no idea how to pinpoint the bug; I spent some
time mucking around in the source and debugger and got nowhere.)

-- 
Josh Kelley

On Mon, Oct 11, 2010 at 11:44 AM, Dominik Seichter <[email protected]>wrote:

> Hi Josh,
>
> Sorry for my delay in answering.
> I don't know of anyone who succeeded in building PoDoFo with C++ Builder. I
> once tried with an older C++ Builder version and an older PoDoFo version
> and
> ran into tons of STL and template problems.
>
> If you have a memory problem, you could try to build a small test case (Ok,
> the hello world sample should be fine) and try to debug it using valgrind
> under
> Linux. If valgrind does not show any memory corruptions, I assume the
> library
> to be correct.
>
> My tests with valgrind under Linux look pretty good. I added an additional
> call to     PdfEncodingFactory::FreeGlobalEncodingInstances(); at the end
> of
> the program, to free globally allocated instances.
>
> Cheers,
>        Dominik
>
> Am Montag 04 Oktober 2010 schrieb Josh Kelley:
> > I'm trying to get PoDoFo 0.8.2 working in Embarcadero (formerly Borland)
> > C++Builder 2010 and am getting an access violation when I run the sample
> > "Hello world!" application.
> >
> > >From looking at the call stack, the sample HelloWorld function calls
> >
> > PdfStreamedDocument::CreatePage, which calls PdfPagesTree::InsertPage,
> >  which calls PdfPagesTree::GetPageNode.  GetPageNode tries to iterate
> over
> >  rKidsArray, but from what I can tell from poking around in the debugger,
> >  rKidsArray's vector pointers are corrupt.  (They're apparently getting
> >  corrupted in PdfOutputDevice's constructor's call to PdfLocaleImbue, but
> >  if I disable locale support, the corruption simply appears elsewhere.)
>  I
> >  could be misdiagnosing the problem, though - this afternoon is the first
> >  time that I've done anything with PoDoFo.
> >
> > If I build and test under Linux, everything works just fine.  So I'm not
> > sure if I'm running into an Embarcadero C++Builder compiler bug (entirely
> > possible - it's not the greatest compiler) or a memory bug that only
> > manifests itself under Windows for some reason.
> >
> > Any suggestions?  CppUnit apparently isn't supported under C++Builder, so
> > running PoDoFo's test suite would be inconvenient.
> >
>
>
> --
> **********************************************************************
> 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
> **********************************************************************
>
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to