On 07.02.2017 11:53, zyx wrote: > On Mon, 2017-02-06 at 23:20 +0100, Sandro Mani wrote: >> I'll narrow this down as time allows and file a GCC bug as soon as I >> have a reduced test case (provided the narrowing down confirms my >> miscompilation theory). > Hi, > I tried to reproduce this with gcc 7.0.1, but still no luck. It doesn't > matter whether I compile PoDoFo as a static library (the default) or as > a shared library, neither whether I use Boost or Lua or some other > optional dependencies on or off (my podofo_config.h currently shows > that I have all the development libraries installed and available). > > I use the attached code, which is the same as yours, it only avoids a > memory leak and unused variable, thus neither gcc nor valgrind claim > any issue. The file contain my steps (note the missing `make install`, > the code is run out of the build tree) at the top of it. > > Maybe I do something wrong? > I can reproduce it with $ cat test.cpp #include <podofo/base/PdfDictionary.h> #include <podofo/doc/PdfImage.h> #include <podofo/doc/PdfStreamedDocument.h>
int main() { PoDoFo::PdfStreamedDocument* document = new PoDoFo::PdfStreamedDocument("test.pdf"); PoDoFo::PdfImage pdfImage(document); PoDoFo::PdfDictionary& dictionary = pdfImage.GetObject()->GetDictionary(); return 0; } $ cmake -DPODOFO_BUILD_SHARED=ON .. $ make DESTDIR=$PWD/dist install $ g++ -g -o testprog test.cpp -L$PWD/dist/usr/local/lib -lpodofo -I$PWD/dist/usr/local/include -Wl,-rpath,$PWD/dist/usr/local/lib $ ./testprog terminate called after throwing an instance of 'PoDoFo::PdfError' Aborted (core dumped) Relevant cmake output: Using gcc specific compiler options -- Found ZLIB: /usr/lib64/libz.so Found zlib headers in /usr/include, library at /usr/lib64/libz.so -- Found PkgConfig: /usr/bin/pkg-config (found version "1.2.2") -- Checking for module 'libcrypto' -- Found libcrypto, version 1.1.0d -- Found LIBCRYPTO: /usr/lib64/libcrypto.so -- Performing Test PODOFO_HAVE_OPENSSL_1_1 -- Performing Test PODOFO_HAVE_OPENSSL_1_1 - Success Found OpenSSL's libCrypto headers in /usr/include, library at /usr/lib64/libcrypto.so -- Could NOT find LIBIDN (missing: LIBIDN_LIBRARY LIBIDN_INCLUDE_DIR) Libidn not found. AES-256 Encryption support will be disabled -- Found LIBJPEG: /usr/lib64/libjpeg.so Found libjpeg headers in /usr/include, library at /usr/lib64/libjpeg.so -- Found TIFF: /usr/lib64/libtiff.so Found libtiff headers in /usr/include, library at /usr/lib64/libtiff.so -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") -- Found PNG: /usr/lib64/libpng.so (found version "1.6.28") Found LibPng headers in /usr/include;/usr/include, library at /usr/lib64/libpng.so;/usr/lib64/libz.so -- Ensure you cppunit installed version is at least 1.12.0 -- Found cppunit: /usr/lib64/libcppunit.so Found cppunit. Unit tests will be built. -- Found OpenSSL: /usr/lib64/libssl.so Found freetype library at /usr/lib64/libfreetype.so, headers /usr/include/freetype2 -- Checking for module 'fontconfig' -- Found fontconfig, version 2.12.1 -- Found Fontconfig: fontconfig;freetype Found fontconfig headers in /usr/include, library at fontconfig;freetype -- Could NOT find Lua50 (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) -- Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) Lua not found - PoDoFoImpose and PoDoFoColor will be built without Lua support Building multithreaded version of PoDoFo. -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE Building shared PoDoFo library Pkg-config found, creating a pkg-config file for linking against shared library. All this on Fedora rawhide. (I'm working on narrowing down as time allows). Sandro ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users