Package: xpdf; Maintainer for xpdf is Debian QA Group <packages@qa.debian.org>; Source for xpdf is src:xpdf (PTS, buildd, popcon).
Reported by: Wolfram Gloger <bugzilla1@malloc.de>
Date: Wed, 1 Feb 2012 16:27:02 UTC
Severity: important
Tags: help
Merged with 662882
Found in versions xpdf/3.02-12+squeeze1, xpdf/3.03-10
Fixed in version xpdf/3.03-12
Done: Michael Gilbert <mgilbert@debian.org>
Bug is archived. No further changes may be made.
View this report as an mbox folder, status mbox, maintainer mbox
Report forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <michael.s.gilbert@gmail.com>:
Bug#658264; Package xpdf.
(Wed, 01 Feb 2012 16:27:05 GMT) (full text, mbox, link).
Acknowledgement sent
to Wolfram Gloger <bugzilla1@malloc.de>:
New Bug report received and forwarded. Copy sent to Michael Gilbert <michael.s.gilbert@gmail.com>.
(Wed, 01 Feb 2012 16:27:05 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: xpdf
Version: 3.02-12+squeeze1
Severity: grave
After upgrading to squeeze, xpdf crashes on startup, even without any
input file:
% /usr/bin/xpdf any.pdf
xpdf: pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion
`mutex->__data.__owner == 0' failed.
Abgebrochen (core dumped)
I also compiled poppler_0.16.7-2 and xpdf_3.03-8 from unstable
and the problem persists -- there is no crash but an indefinite
hang.
Source inspection and -instrumentation clearly show the explanation,
however I have no patch or even a good suggestion.
There is a class 'GlobalParams' in poppler and in xpdf.
Its ABI is defined in
/usr/include/poppler/GlobalParams.h (A)
and
xpdf-<version>/xpdf/GlobalParams.h (B)
and these 2 files have diverged considerably.
In xpdf, the class is actually instantiated by
globalParams = new GlobalParams(cfgFileName);
in xpdf-<version>/xpdf/xpdf.cc and this uses (A). However, all the
GlobalParams-functions in libpoppler used by xpdf call the ABI (B).
This results in memory corruption, notably of the 'mutex' member.
If you are not convinced, apply the following to GlobalParams.h
in _both_ source packages:
--- poppler-0.16.7/poppler/GlobalParams.cc~ 2010-12-27 21:44:28.000000000 +0100
+++ poppler-0.16.7/poppler/GlobalParams.cc 2012-02-01 16:26:24.000000000 +0100
@@ -74,7 +74,7 @@
#endif
#if MULTITHREADED
-# define lockGlobalParams gLockMutex(&mutex)
+# define lockGlobalParams do { fprintf(stderr, "t=%p m=%p\n",this,&mutex);gLockMutex(&mutex); }while(0)
# define lockUnicodeMapCache gLockMutex(&unicodeMapCacheMutex)
# define lockCMapCache gLockMutex(&cMapCacheMutex)
# define unlockGlobalParams gUnlockMutex(&mutex)
(also applies to the xpdf version)
When running xpdf such instrumented, I get:
% LD_LIBRARY_PATH=/home/wg/Debian/poppler-0.16.7/poppler/.libs \
~/Debian/xpdf-3.03/build/xpdf.real any.pdf
t=0x18ae010 m=0x18ae188
t=0x18ae010 m=0x18ae188
t=0x18ae010 m=0x18ae188
...
t=0x18ae010 m=0x18ae0f0
This proves that the same mutex object is accessed at two locations.
As said, I have no easy fix. I'd say including the GlobalParams class
and also the globalParams global variable in libpoppler was a horrible
design decision. But going back to a poppler-independent xpdf package
now also doesn't look good. :-(
The problem was already clearly pointed out 8 months ago:
https://bugs.launchpad.net/ubuntu/+source/xpdf/+bug/669211
esp. comment 47..
Regards,
Wolfram.
Reply sent
to Michael Gilbert <michael.s.gilbert@gmail.com>:
You have taken responsibility.
(Thu, 02 Feb 2012 00:09:05 GMT) (full text, mbox, link).
Notification sent
to Wolfram Gloger <bugzilla1@malloc.de>:
Bug acknowledged by developer.
(Thu, 02 Feb 2012 00:09:05 GMT) (full text, mbox, link).
Message #10 received at 658264-close@bugs.debian.org (full text, mbox, reply):
forcemerge 628591 658264 thanks On Wed, Feb 1, 2012 at 11:23 AM, Wolfram Gloger wrote: > Package: xpdf > Version: 3.02-12+squeeze1 > Severity: grave > > After upgrading to squeeze, xpdf crashes on startup, even without any > input file: Make sure you've also updated to the expa from squeeze. This bug has been reported many times now: #628591, #603153, etc. Best wishes, Mike
Information forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <michael.s.gilbert@gmail.com>:
Bug#658264; Package xpdf.
(Thu, 02 Feb 2012 13:03:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Wolfram Gloger <wg@malloc.de>:
Extra info received and forwarded to list. Copy sent to Michael Gilbert <michael.s.gilbert@gmail.com>.
(Thu, 02 Feb 2012 13:03:03 GMT) (full text, mbox, link).
Message #15 received at 658264@bugs.debian.org (full text, mbox, reply):
owner@bugs.debian.org (Debian Bug Tracking System) writes: > Make sure you've also updated to the expa from squeeze. This bug has > been reported many times now: #628591, #603153, etc. Upgrading libexpat1 indeed changes behaviour and avoids the obvious bug symptoms, presumably due to a differently aligned heap/stack. That explains why only a few people have experienced this. However, this changes _absolutely nothing_ with regard to the grave bug in Debian's xpdf or -- if you will -- poppler. Like I have stated, due to the incompatibility of GlobalParams in xpdf and poppler, xpdf is accessing uninitilized memory, leading to undefined behaviour. In the best case, it 'works' by chance. But on the next upgrade, whether it be libexpat or libc or whatever, the bug _surely_ will bite again! At worst, this will become a security issue sometime. If you don't want to reproduce my instrumentation, please try "valgrind xpdf any.pdf": ==5746== Conditional jump or move depends on uninitialised value(s) ==5746== at 0x5289CD4: Gfx::go(bool) (in /usr/lib/libpoppler.so.13.0.0) ==5746== by 0x528A104: Gfx::display(Object*, bool) (in /usr/lib/libpoppler.so.13.0.0) ==5746== by 0x52D3B35: Page::displaySlice(OutputDev*, double, double, int, bool, bool, int, int, int, int, bool, Catalog*, bool (*)(void*), void*, bool (*)(Annot*, void*), void*) (in /usr/lib/libpoppler.so.13.0.0) ==5746== by 0x41C87C: PDFCore::needTile(PDFCorePage*, int, int) (PDFCore.cc:890) ==5746== by 0x41BC39: PDFCore::update(int, int, int, double, int, bool, bool, bool) (PDFCore.cc:712) ==5746== by 0x4248E2: XPDFCore::update(int, int, int, double, int, bool, bool, bool) (XPDFCore.cc:288) ==5746== by 0x419E98: PDFCore::displayPage(int, double, int, bool, bool) (PDFCore.cc:301) ==5746== by 0x42E3FC: XPDFViewer::displayPage(int, double, int, bool, bool) (XPDFViewer.cc:463) ==5746== by 0x42D881: XPDFViewer::XPDFViewer(XPDFApp*, GooString*, int, GooString*, bool, GooString*, GooString*) (XPDFViewer.cc:302) ==5746== by 0x4225CD: XPDFApp::open(GooString*, int, GooString*, GooString*) (XPDFApp.cc:228) ==5746== by 0x42B405: main (xpdf.cc:313) ==5746== Uninitialised value was created by a heap allocation ==5746== at 0x4C24DFA: operator new(unsigned long) (vg_replace_malloc.c:261) ==5746== by 0x42AB77: main (xpdf.cc:159) and xpdf.xx:159 is exactly the forementioned problematic: globalParams = new GlobalParams(cfgFileName); I have now invested \approx 6h in this report and am 100% sure it is a grave bug. Please consider re-opening. Thanks, Wolfram Gloger
Information forwarded
to debian-bugs-dist@lists.debian.org:
Bug#658264; Package xpdf.
(Fri, 03 Feb 2012 23:57:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Michael Gilbert <michael.s.gilbert@gmail.com>:
Extra info received and forwarded to list.
(Fri, 03 Feb 2012 23:57:02 GMT) (full text, mbox, link).
Message #20 received at 658264@bugs.debian.org (full text, mbox, reply):
reopen 658264 severity 658264 important tag 658264 help retitle 658264 possible memory corruption in GlobalParams thanks > and xpdf.xx:159 is exactly the forementioned problematic: > > globalParams = new GlobalParams(cfgFileName); > > I have now invested \approx 6h in this report and am 100% sure it is a > grave bug. Please consider re-opening. OK, reopening. I'm probably not going to get around to looking at this for a while, so I'm tagging "help." Since you're interested in this, it would be great if you could spend some time trying to find a solution. Thanks, Mike
Did not alter fixed versions and reopened.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Fri, 03 Feb 2012 23:57:09 GMT) (full text, mbox, link).
Severity set to 'important' from 'grave'
Request was from Michael Gilbert <michael.s.gilbert@gmail.com>
to control@bugs.debian.org.
(Fri, 03 Feb 2012 23:57:10 GMT) (full text, mbox, link).
Added tag(s) help.
Request was from Michael Gilbert <michael.s.gilbert@gmail.com>
to control@bugs.debian.org.
(Fri, 03 Feb 2012 23:57:11 GMT) (full text, mbox, link).
Changed Bug title to 'possible memory corruption in GlobalParams' from 'xpdf totally unusable due to memory corruption in globalParams class (namespace conflict with libpoppler)'
Request was from Michael Gilbert <michael.s.gilbert@gmail.com>
to control@bugs.debian.org.
(Fri, 03 Feb 2012 23:57:11 GMT) (full text, mbox, link).
Message sent on
to Wolfram Gloger <bugzilla1@malloc.de>:
Bug#658264.
(Fri, 03 Feb 2012 23:57:14 GMT) (full text, mbox, link).
Information stored
:
Bug#658264; Package xpdf.
(Sun, 05 Feb 2012 16:45:13 GMT) (full text, mbox, link).
Acknowledgement sent
to Wolfram Gloger <wg@malloc.de>:
Extra info received and filed, but not forwarded.
(Sun, 05 Feb 2012 16:45:13 GMT) (full text, mbox, link).
Message #36 received at 658264-quiet@bugs.debian.org (full text, mbox, reply):
Michael Gilbert <michael.s.gilbert@gmail.com> writes: > OK, reopening. I'm probably not going to get around to looking at > this for a while, so I'm tagging "help." Since you're interested in > this, it would be great if you could spend some time trying to find a > solution. Thank you. Currently I think the best solution would be to derive a GlobalParams_xpdf class in the xpdf sources and so keep compatibility with poppler. I will look at this tomorrow. Regards, Wolfram.
Information forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <michael.s.gilbert@gmail.com>:
Bug#658264; Package xpdf.
(Wed, 08 Feb 2012 21:00:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Wolfram Gloger <wg@malloc.de>:
Extra info received and forwarded to list. Copy sent to Michael Gilbert <michael.s.gilbert@gmail.com>.
(Wed, 08 Feb 2012 21:00:03 GMT) (full text, mbox, link).
Message #41 received at 658264@bugs.debian.org (full text, mbox, reply):
tag 658264 patch
thanks
Michael Gilbert <michael.s.gilbert@gmail.com> writes:
> Since you're interested in
> this, it would be great if you could spend some time trying to find a
> solution.
Ok, here is a patch, to be applied after all other debian patches. It
is not nice, but IMHO should work. valgrind doesn't complain any more.
An issue remains with the format string of the error() messages but that
is a different, less serious bug.
Regards,
Wolfram.
===File fix-globalparams-clash.patch===
description: fix type clash GlobalParam xpdf vs. poppler
author: Wolfram Gloger <bugzilla1@malloc.de>
debian-bug: http://bugs.debian.org/658264
Index: xpdf-3.03/xpdf/GlobalParams.cc
===================================================================
--- xpdf-3.03.orig/xpdf/GlobalParams.cc 2012-02-08 16:42:24.000000000 +0100
+++ xpdf-3.03/xpdf/GlobalParams.cc 2012-02-08 21:26:51.000000000 +0100
@@ -48,19 +48,11 @@
#endif
#if MULTITHREADED
-# define lockGlobalParams gLockMutex(&mutex)
-# define lockUnicodeMapCache gLockMutex(&unicodeMapCacheMutex)
-# define lockCMapCache gLockMutex(&cMapCacheMutex)
-# define unlockGlobalParams gUnlockMutex(&mutex)
-# define unlockUnicodeMapCache gUnlockMutex(&unicodeMapCacheMutex)
-# define unlockCMapCache gUnlockMutex(&cMapCacheMutex)
+# define lockGlobalParams gLockMutex(&xpdf_mutex)
+# define unlockGlobalParams gUnlockMutex(&xpdf_mutex)
#else
# define lockGlobalParams
-# define lockUnicodeMapCache
-# define lockCMapCache
# define unlockGlobalParams
-# define unlockUnicodeMapCache
-# define unlockCMapCache
#endif
#include "NameToUnicodeTable.h"
@@ -626,20 +618,26 @@
// parsing
//------------------------------------------------------------------------
-GlobalParams::GlobalParams(char *cfgFileName) {
- UnicodeMap *map;
+GlobalParams::GlobalParams(char *cfgFileName)
+#if POPPLER_GLOBAL
+: poppler_GlobalParams()
+#endif
+{
GString *fileName;
FILE *f;
- int i;
+
+#if POPPLER_GLOBAL
+#undef globalParams
+ globalParams = this;
+#endif
#if MULTITHREADED
- gInitMutex(&mutex);
- gInitMutex(&unicodeMapCacheMutex);
- gInitMutex(&cMapCacheMutex);
+ gInitMutex(&xpdf_mutex);
#endif
initBuiltinFontTables();
+#if !POPPLER_GLOBAL
// scan the encoding in reverse because we want the lowest-numbered
// index for each char name ('space' is encoded twice)
macRomanReverseMap = new NameToCharCode();
@@ -662,6 +660,7 @@
unicodeMaps = new GHash(gTrue);
cMapDirs = new GHash(gTrue);
toUnicodeDirs = new GList();
+#endif
fontFiles = new GHash(gTrue);
fontDirs = new GList();
ccFontFiles = new GHash(gTrue);
@@ -688,11 +687,6 @@
psImageableURX = psPaperWidth;
psImageableURY = psPaperHeight;
psCrop = gTrue;
- psExpandSmaller = gFalse;
- psShrinkLarger = gTrue;
- psCenter = gTrue;
- psDuplex = gFalse;
- psLevel = psLevel2;
psFile = NULL;
psResidentFonts = new GHash(gTrue);
psResidentFonts16 = new GList();
@@ -702,44 +696,27 @@
psEmbedCIDPostScript = gTrue;
psEmbedCIDTrueType = gTrue;
psFontPassthrough = gFalse;
- psPreload = gFalse;
- psOPI = gFalse;
- psASCIIHex = gFalse;
+
psUncompressPreloadedImages = gFalse;
psRasterResolution = 300;
psRasterMono = gFalse;
psAlwaysRasterize = gFalse;
- textEncoding = new GString("Latin1");
-#if defined(WIN32)
- textEOL = eolDOS;
-#elif defined(MACOS)
- textEOL = eolMac;
-#else
- textEOL = eolUnix;
-#endif
- textPageBreaks = gTrue;
- textKeepTinyChars = gFalse;
+
initialZoom = new GString("125");
continuousView = gFalse;
enableT1lib = gTrue;
- enableFreeType = gTrue;
+
disableFreeTypeHinting = gFalse;
- antialias = gTrue;
- vectorAntialias = gTrue;
+
antialiasPrinting = gFalse;
- strokeAdjust = gTrue;
- screenType = screenUnset;
- screenSize = -1;
- screenDotRadius = -1;
- screenGamma = 1.0;
- screenBlackThreshold = 0.0;
- screenWhiteThreshold = 1.0;
+
minLineWidth = 0.0;
drawAnnotations = gTrue;
overprintPreview = gFalse;
launchCommand = NULL;
urlCommand = NULL;
movieCommand = NULL;
+#if !POPPLER_GLOBAL
mapNumericCharNames = gTrue;
mapUnknownCharNames = gFalse;
createDefaultKeyBindings();
@@ -779,6 +756,9 @@
residentUnicodeMaps->add(map->getEncodingName(), map);
map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
residentUnicodeMaps->add(map->getEncodingName(), map);
+#else
+ createDefaultKeyBindings();
+#endif
// look for a user config file, then a system-wide config file
f = NULL;
@@ -958,6 +938,9 @@
GString *cmd, *incFile;
char *p1, *p2;
FILE *f2;
+ GBool pBool;
+ int pInt;
+ double pDouble;
// break the line into tokens
tokens = new GList();
@@ -1023,12 +1006,15 @@
} else if (!cmd->cmp("psCrop")) {
parseYesNo("psCrop", &psCrop, tokens, fileName, line);
} else if (!cmd->cmp("psExpandSmaller")) {
- parseYesNo("psExpandSmaller", &psExpandSmaller,
- tokens, fileName, line);
+ if (parseYesNo("psExpandSmaller", &pBool,
+ tokens, fileName, line))
+ setPSExpandSmaller(pBool);
} else if (!cmd->cmp("psShrinkLarger")) {
- parseYesNo("psShrinkLarger", &psShrinkLarger, tokens, fileName, line);
+ if (parseYesNo("psShrinkLarger", &pBool, tokens, fileName, line))
+ setPSShrinkLarger(pBool);
} else if (!cmd->cmp("psCenter")) {
- parseYesNo("psCenter", &psCenter, tokens, fileName, line);
+ if (parseYesNo("psCenter", &pBool, tokens, fileName, line))
+ setPSCenter(pBool);
} else if (!cmd->cmp("psDuplex")) {
parseYesNo("psDuplex", &psDuplex, tokens, fileName, line);
} else if (!cmd->cmp("psLevel")) {
@@ -1054,11 +1040,14 @@
parseYesNo("psFontPassthrough", &psFontPassthrough,
tokens, fileName, line);
} else if (!cmd->cmp("psPreload")) {
- parseYesNo("psPreload", &psPreload, tokens, fileName, line);
+ if (parseYesNo("psPreload", &pBool, tokens, fileName, line))
+ setPSPreload(pBool);
} else if (!cmd->cmp("psOPI")) {
- parseYesNo("psOPI", &psOPI, tokens, fileName, line);
+ if (parseYesNo("psOPI", &pBool, tokens, fileName, line))
+ setPSOPI(pBool);
} else if (!cmd->cmp("psASCIIHex")) {
- parseYesNo("psASCIIHex", &psASCIIHex, tokens, fileName, line);
+ if (parseYesNo("psASCIIHex", &pBool, tokens, fileName, line))
+ setPSASCIIHex(pBool);
} else if (!cmd->cmp("psUncompressPreloadedImages")) {
parseYesNo("psUncompressPreloadedImages", &psUncompressPreloadedImages,
tokens, fileName, line);
@@ -1075,11 +1064,12 @@
} else if (!cmd->cmp("textEOL")) {
parseTextEOL(tokens, fileName, line);
} else if (!cmd->cmp("textPageBreaks")) {
- parseYesNo("textPageBreaks", &textPageBreaks,
- tokens, fileName, line);
+ if (parseYesNo("textPageBreaks", &pBool, tokens, fileName, line))
+ setTextPageBreaks(pBool);
} else if (!cmd->cmp("textKeepTinyChars")) {
- parseYesNo("textKeepTinyChars", &textKeepTinyChars,
- tokens, fileName, line);
+ if (parseYesNo("textKeepTinyChars", &pBool,
+ tokens, fileName, line))
+ setTextKeepTinyChars(pBool);
} else if (!cmd->cmp("initialZoom")) {
parseInitialZoom(tokens, fileName, line);
} else if (!cmd->cmp("continuousView")) {
@@ -1087,36 +1077,46 @@
} else if (!cmd->cmp("enableT1lib")) {
parseYesNo("enableT1lib", &enableT1lib, tokens, fileName, line);
} else if (!cmd->cmp("enableFreeType")) {
- parseYesNo("enableFreeType", &enableFreeType, tokens, fileName, line);
+ char *t = parseYesNo("enableFreeType", &pBool, tokens, fileName, line);
+ if (t)
+ setEnableFreeType(t);
} else if (!cmd->cmp("disableFreeTypeHinting")) {
parseYesNo("disableFreeTypeHinting", &disableFreeTypeHinting,
tokens, fileName, line);
} else if (!cmd->cmp("antialias")) {
- parseYesNo("antialias", &antialias, tokens, fileName, line);
+ char *t = parseYesNo("antialias", &pBool, tokens, fileName, line);
+ if (t)
+ setAntialias(t);
} else if (!cmd->cmp("vectorAntialias")) {
- parseYesNo("vectorAntialias", &vectorAntialias,
- tokens, fileName, line);
+ char *t = parseYesNo("vectorAntialias", &pBool,
+ tokens, fileName, line);
+ if (t)
+ setVectorAntialias(t);
} else if (!cmd->cmp("antialiasPrinting")) {
parseYesNo("antialiasPrinting", &antialiasPrinting,
tokens, fileName, line);
} else if (!cmd->cmp("strokeAdjust")) {
- parseYesNo("strokeAdjust", &strokeAdjust, tokens, fileName, line);
+ if (parseYesNo("strokeAdjust", &pBool, tokens, fileName, line))
+ setStrokeAdjust(pBool);
} else if (!cmd->cmp("screenType")) {
parseScreenType(tokens, fileName, line);
} else if (!cmd->cmp("screenSize")) {
- parseInteger("screenSize", &screenSize, tokens, fileName, line);
+ if (parseInteger("screenSize", &pInt, tokens, fileName, line))
+ setScreenSize(pInt);
} else if (!cmd->cmp("screenDotRadius")) {
- parseInteger("screenDotRadius", &screenDotRadius,
- tokens, fileName, line);
+ if (parseInteger("screenDotRadius", &pInt, tokens, fileName, line))
+ setScreenDotRadius(pInt);
} else if (!cmd->cmp("screenGamma")) {
- parseFloat("screenGamma", &screenGamma,
- tokens, fileName, line);
+ if (parseFloat("screenGamma", &pDouble, tokens, fileName, line))
+ setScreenGamma(pDouble);
} else if (!cmd->cmp("screenBlackThreshold")) {
- parseFloat("screenBlackThreshold", &screenBlackThreshold,
- tokens, fileName, line);
+ if (parseFloat("screenBlackThreshold", &pDouble,
+ tokens, fileName, line))
+ setScreenBlackThreshold(pDouble);
} else if (!cmd->cmp("screenWhiteThreshold")) {
- parseFloat("screenWhiteThreshold", &screenWhiteThreshold,
- tokens, fileName, line);
+ if (parseFloat("screenWhiteThreshold", &pDouble,
+ tokens, fileName, line))
+ setScreenWhiteThreshold(pDouble);
} else if (!cmd->cmp("minLineWidth")) {
parseFloat("minLineWidth", &minLineWidth,
tokens, fileName, line);
@@ -1143,9 +1143,11 @@
} else if (!cmd->cmp("unbind")) {
parseUnbind(tokens, fileName, line);
} else if (!cmd->cmp("printCommands")) {
- parseYesNo("printCommands", &printCommands, tokens, fileName, line);
+ if (parseYesNo("printCommands", &pBool, tokens, fileName, line))
+ setPrintCommands(pBool);
} else if (!cmd->cmp("errQuiet")) {
- parseYesNo("errQuiet", &errQuiet, tokens, fileName, line);
+ if (parseYesNo("errQuiet", &pBool, tokens, fileName, line))
+ setErrQuiet(pBool);
} else {
error(errConfig, -1, "Unknown config file command '{0:t}' ({1:t}:{2:d})",
cmd, fileName, line);
@@ -1166,6 +1168,8 @@
deleteGList(tokens, GString);
}
+#if !POPPLER_GLOBAL
+
void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
int line) {
GString *name;
@@ -1284,6 +1288,23 @@
toUnicodeDirs->append(((GString *)tokens->get(1))->copy());
}
+#else // POPPLER_GLOBAL
+
+// provide dummys as unicode parsing is handled by poppler
+void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
+ int line) {}
+void GlobalParams::parseCIDToUnicode(GList *tokens, GString *fileName,
+ int line) {}
+void GlobalParams::parseUnicodeToUnicode(GList *tokens, GString *fileName,
+ int line) {}
+void GlobalParams::parseUnicodeMap(GList *tokens, GString *fileName,
+ int line) {}
+void GlobalParams::parseCMapDir(GList *tokens, GString *fileName, int line) {}
+void GlobalParams::parseToUnicodeDir(GList *tokens, GString *fileName,
+ int line) {}
+
+#endif
+
void GlobalParams::parseFontFile(GList *tokens, GString *fileName, int line) {
if (tokens->getLength() != 3) {
error(errConfig, -1, "Bad 'fontFile' config file command ({0:t}:{1:d})",
@@ -1375,17 +1396,17 @@
}
tok = (GString *)tokens->get(1);
if (!tok->cmp("level1")) {
- psLevel = psLevel1;
+ setPSLevel(psLevel1);
} else if (!tok->cmp("level1sep")) {
- psLevel = psLevel1Sep;
+ setPSLevel(psLevel1Sep);
} else if (!tok->cmp("level2")) {
- psLevel = psLevel2;
+ setPSLevel(psLevel2);
} else if (!tok->cmp("level2sep")) {
- psLevel = psLevel2Sep;
+ setPSLevel(psLevel2Sep);
} else if (!tok->cmp("level3")) {
- psLevel = psLevel3;
+ setPSLevel(psLevel3);
} else if (!tok->cmp("level3Sep")) {
- psLevel = psLevel3Sep;
+ setPSLevel(psLevel3Sep);
} else {
error(errConfig, -1, "Bad 'psLevel' config file command ({0:t}:{1:d})",
fileName, line);
@@ -1467,8 +1488,7 @@
fileName, line);
return;
}
- delete textEncoding;
- textEncoding = ((GString *)tokens->get(1))->copy();
+ setTextEncoding(((GString *)tokens->get(1))->getCString());
}
void GlobalParams::parseTextEOL(GList *tokens, GString *fileName, int line) {
@@ -1480,13 +1500,7 @@
return;
}
tok = (GString *)tokens->get(1);
- if (!tok->cmp("unix")) {
- textEOL = eolUnix;
- } else if (!tok->cmp("dos")) {
- textEOL = eolDOS;
- } else if (!tok->cmp("mac")) {
- textEOL = eolMac;
- } else {
+ if (!setTextEOL(tok->getCString())) {
error(errConfig, -1, "Bad 'textEOL' config file command ({0:t}:{1:d})",
fileName, line);
}
@@ -1514,11 +1528,11 @@
}
tok = (GString *)tokens->get(1);
if (!tok->cmp("dispersed")) {
- screenType = screenDispersed;
+ setScreenType(screenDispersed);
} else if (!tok->cmp("clustered")) {
- screenType = screenClustered;
+ setScreenType(screenClustered);
} else if (!tok->cmp("stochasticClustered")) {
- screenType = screenStochasticClustered;
+ setScreenType(screenStochasticClustered);
} else {
error(errConfig, -1, "Bad 'screenType' config file command ({0:t}:{1:d})",
fileName, line);
@@ -1732,20 +1746,22 @@
*val = ((GString *)tokens->get(1))->copy();
}
-void GlobalParams::parseYesNo(const char *cmdName, GBool *flag,
+char *GlobalParams::parseYesNo(const char *cmdName, GBool *flag,
GList *tokens, GString *fileName, int line) {
GString *tok;
if (tokens->getLength() != 2) {
error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
cmdName, fileName, line);
- return;
+ return NULL;
}
tok = (GString *)tokens->get(1);
if (!parseYesNo2(tok->getCString(), flag)) {
error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
cmdName, fileName, line);
+ return NULL;
}
+ return tok->getCString();
}
GBool GlobalParams::parseYesNo2(char *token, GBool *flag) {
@@ -1759,7 +1775,7 @@
return gTrue;
}
-void GlobalParams::parseInteger(const char *cmdName, int *val,
+GBool GlobalParams::parseInteger(const char *cmdName, int *val,
GList *tokens, GString *fileName, int line) {
GString *tok;
int i;
@@ -1767,13 +1783,13 @@
if (tokens->getLength() != 2) {
error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
cmdName, fileName, line);
- return;
+ return gFalse;
}
tok = (GString *)tokens->get(1);
if (tok->getLength() == 0) {
error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
cmdName, fileName, line);
- return;
+ return gFalse;
}
if (tok->getChar(0) == '-') {
i = 1;
@@ -1784,13 +1800,14 @@
if (tok->getChar(i) < '0' || tok->getChar(i) > '9') {
error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
cmdName, fileName, line);
- return;
+ return gFalse;
}
}
*val = atoi(tok->getCString());
+ return gTrue;
}
-void GlobalParams::parseFloat(const char *cmdName, double *val,
+GBool GlobalParams::parseFloat(const char *cmdName, double *val,
GList *tokens, GString *fileName, int line) {
GString *tok;
int i;
@@ -1798,13 +1815,13 @@
if (tokens->getLength() != 2) {
error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
cmdName, fileName, line);
- return;
+ return gFalse;
}
tok = (GString *)tokens->get(1);
if (tok->getLength() == 0) {
error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
cmdName, fileName, line);
- return;
+ return gFalse;
}
if (tok->getChar(0) == '-') {
i = 1;
@@ -1816,13 +1833,15 @@
tok->getChar(i) == '.')) {
error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
cmdName, fileName, line);
- return;
+ return gFalse;
}
}
*val = atof(tok->getCString());
+ return gTrue;
}
GlobalParams::~GlobalParams() {
+#if !POPPLER_GLOBAL
GHashIter *iter;
GString *key;
GList *list;
@@ -1839,6 +1858,11 @@
deleteGHash(unicodeMaps, GString);
deleteGList(toUnicodeDirs, GString);
deleteGHash(fontFiles, GString);
+#else
+ freeBuiltinFontTables();
+
+ deleteGHash(fontFiles, GString);
+#endif
deleteGList(fontDirs, GString);
deleteGHash(ccFontFiles, GString);
delete sysFonts;
@@ -1848,7 +1872,7 @@
deleteGHash(psResidentFonts, GString);
deleteGList(psResidentFonts16, PSFontParam16);
deleteGList(psResidentFontsCC, PSFontParam16);
- delete textEncoding;
+
delete initialZoom;
if (launchCommand) {
delete launchCommand;
@@ -1861,6 +1885,7 @@
}
deleteGList(keyBindings, KeyBinding);
+#if !POPPLER_GLOBAL
cMapDirs->startIter(&iter);
while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
deleteGList(list, GString);
@@ -1876,21 +1901,15 @@
delete securityHandlers;
deleteGList(plugins, Plugin);
#endif
+#endif
#if MULTITHREADED
- gDestroyMutex(&mutex);
- gDestroyMutex(&unicodeMapCacheMutex);
- gDestroyMutex(&cMapCacheMutex);
+ gDestroyMutex(&xpdf_mutex);
#endif
}
//------------------------------------------------------------------------
-void GlobalParams::setBaseDir(char *dir) {
- delete baseDir;
- baseDir = new GString(dir);
-}
-
void GlobalParams::setupBaseFonts(char *dir) {
GString *fontName;
GString *fileName;
@@ -1994,6 +2013,7 @@
// accessors
//------------------------------------------------------------------------
+#if !POPPLER_GLOBAL
CharCode GlobalParams::getMacRomanCharCode(char *charName) {
// no need to lock - macRomanReverseMap is constant
return macRomanReverseMap->lookup(charName);
@@ -2124,6 +2144,7 @@
unlockGlobalParams;
return NULL;
}
+#endif
GString *GlobalParams::findSystemFontFile(GString *fontName,
SysFontType *type,
@@ -2198,6 +2219,7 @@
return f;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::getPSExpandSmaller() {
GBool f;
@@ -2224,6 +2246,7 @@
unlockGlobalParams;
return f;
}
+#endif
GBool GlobalParams::getPSDuplex() {
GBool d;
@@ -2234,15 +2257,6 @@
return d;
}
-PSLevel GlobalParams::getPSLevel() {
- PSLevel level;
-
- lockGlobalParams;
- level = psLevel;
- unlockGlobalParams;
- return level;
-}
-
GString *GlobalParams::getPSResidentFont(GString *fontName) {
GString *psName;
@@ -2349,6 +2363,7 @@
return e;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::getPSPreload() {
GBool preload;
@@ -2375,6 +2390,7 @@
unlockGlobalParams;
return ah;
}
+#endif
GBool GlobalParams::getPSUncompressPreloadedImages() {
GBool ah;
@@ -2412,6 +2428,7 @@
return rast;
}
+#if !POPPLER_GLOBAL
GString *GlobalParams::getTextEncodingName() {
GString *s;
@@ -2447,6 +2464,7 @@
unlockGlobalParams;
return tiny;
}
+#endif
GString *GlobalParams::getInitialZoom() {
GString *s;
@@ -2475,15 +2493,6 @@
return f;
}
-GBool GlobalParams::getEnableFreeType() {
- GBool f;
-
- lockGlobalParams;
- f = enableFreeType;
- unlockGlobalParams;
- return f;
-}
-
GBool GlobalParams::getDisableFreeTypeHinting() {
GBool f;
@@ -2493,7 +2502,7 @@
return f;
}
-
+#if !POPPLER_GLOBAL
GBool GlobalParams::getAntialias() {
GBool f;
@@ -2511,6 +2520,7 @@
unlockGlobalParams;
return f;
}
+#endif
GBool GlobalParams::getAntialiasPrinting() {
GBool f;
@@ -2521,6 +2531,7 @@
return f;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::getStrokeAdjust() {
GBool f;
@@ -2583,6 +2594,7 @@
unlockGlobalParams;
return thresh;
}
+#endif
double GlobalParams::getMinLineWidth() {
double w;
@@ -2602,6 +2614,7 @@
return draw;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::getMapNumericCharNames() {
GBool map;
@@ -2619,6 +2632,7 @@
unlockGlobalParams;
return map;
}
+#endif
GList *GlobalParams::getKeyBinding(int code, int mods, int context) {
KeyBinding *binding;
@@ -2646,6 +2660,7 @@
return cmds;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::getPrintCommands() {
GBool p;
@@ -2731,6 +2746,7 @@
UnicodeMap *GlobalParams::getTextEncoding() {
return getUnicodeMap2(textEncoding);
}
+#endif
//------------------------------------------------------------------------
// functions to set parameters
@@ -2809,6 +2825,7 @@
unlockGlobalParams;
}
+#if !POPPLER_GLOBAL
void GlobalParams::setPSExpandSmaller(GBool expand) {
lockGlobalParams;
psExpandSmaller = expand;
@@ -2826,6 +2843,7 @@
psCenter = center;
unlockGlobalParams;
}
+#endif
void GlobalParams::setPSDuplex(GBool duplex) {
lockGlobalParams;
@@ -2833,6 +2851,7 @@
unlockGlobalParams;
}
+#if !POPPLER_GLOBAL
void GlobalParams::setPSLevel(PSLevel level) {
lockGlobalParams;
psLevel = level;
@@ -2862,6 +2881,7 @@
psEmbedCIDTrueType = embed;
unlockGlobalParams;
}
+#endif
void GlobalParams::setPSFontPassthrough(GBool passthrough) {
lockGlobalParams;
@@ -2869,6 +2889,7 @@
unlockGlobalParams;
}
+#if !POPPLER_GLOBAL
void GlobalParams::setPSPreload(GBool preload) {
lockGlobalParams;
psPreload = preload;
@@ -2921,6 +2942,7 @@
textKeepTinyChars = keep;
unlockGlobalParams;
}
+#endif
void GlobalParams::setInitialZoom(char *s) {
lockGlobalParams;
@@ -2944,6 +2966,7 @@
return ok;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::setEnableFreeType(char *s) {
GBool ok;
@@ -3091,3 +3114,4 @@
}
#endif // ENABLE_PLUGINS
+#endif
Index: xpdf-3.03/xpdf/GlobalParams.h
===================================================================
--- xpdf-3.03.orig/xpdf/GlobalParams.h 2012-02-08 16:42:24.000000000 +0100
+++ xpdf-3.03/xpdf/GlobalParams.h 2012-02-08 21:28:37.000000000 +0100
@@ -6,24 +6,20 @@
//
//========================================================================
-#ifndef GLOBALPARAMS_H
-#define GLOBALPARAMS_H
+#ifndef XPDF_GLOBALPARAMS_H
+#define XPDF_GLOBALPARAMS_H
-#include <aconf.h>
+// poppler and xpdf have incompatible GlobalParams implementations
+#include <poppler/GlobalParams.h>
+typedef GlobalParams poppler_GlobalParams;
+class XpdfGlobalParams;
+#define POPPLER_GLOBAL 1
+#define GlobalParams XpdfGlobalParams
+#define globalParams xpdf_globalParams
-#ifdef USE_GCC_PRAGMAS
-#pragma interface
-#endif
-
-#include <stdio.h>
-#include "gtypes.h"
-#include "CharTypes.h"
#include "config.h"
-#if MULTITHREADED
-#include "GMutex.h"
-#endif
-
+#if !POPPLER_GLOBAL
class GString;
class GList;
class GHash;
@@ -36,8 +32,9 @@
class CMapCache;
struct XpdfSecurityHandler;
class GlobalParams;
-class SysFontList;
class Stream;
+#endif
+class SysFontList;
extern FILE *openFile(const char *path, const char *mode);
@@ -73,6 +70,7 @@
//------------------------------------------------------------------------
+#if !POPPLER_GLOBAL
enum PSLevel {
psLevel1,
psLevel1Sep,
@@ -98,6 +96,7 @@
screenClustered,
screenStochasticClustered
};
+#endif
//------------------------------------------------------------------------
@@ -172,7 +171,11 @@
//------------------------------------------------------------------------
-class GlobalParams {
+class GlobalParams
+#if POPPLER_GLOBAL
+: public poppler_GlobalParams
+#endif
+{
public:
// Initialize the global parameters by attempting to read a config
@@ -181,13 +184,16 @@
~GlobalParams();
+#if !POPPLER_GLOBAL
void setBaseDir(char *dir);
+#endif
void setupBaseFonts(char *dir);
void parseLine(char *buf, GString *fileName, int line);
//----- accessors
+#if !POPPLER_GLOBAL
CharCode getMacRomanCharCode(char *charName);
GString *getBaseDir();
@@ -197,6 +203,7 @@
FILE *findCMapFile(GString *collection, GString *cMapName);
FILE *findToUnicodeFile(GString *name);
GString *findFontFile(GString *fontName, char **throwaway);
+#endif
GString *findSystemFontFile(GString *fontName, SysFontType *type,
int *fontNum);
GString *findCCFontFile(GString *collection);
@@ -206,10 +213,12 @@
void getPSImageableArea(int *llx, int *lly, int *urx, int *ury);
GBool getPSDuplex();
GBool getPSCrop();
+#if !POPPLER_GLOBAL
GBool getPSExpandSmaller();
GBool getPSShrinkLarger();
GBool getPSCenter();
PSLevel getPSLevel();
+#endif
GString *getPSResidentFont(GString *fontName);
GList *getPSResidentFonts();
PSFontParam16 *getPSResidentFont16(GString *fontName, int wMode);
@@ -219,20 +228,25 @@
GBool getPSEmbedCIDPostScript();
GBool getPSEmbedCIDTrueType();
GBool getPSFontPassthrough();
+#if !POPPLER_GLOBAL
GBool getPSPreload();
GBool getPSOPI();
GBool getPSASCIIHex();
+#endif
GBool getPSUncompressPreloadedImages();
double getPSRasterResolution();
GBool getPSRasterMono();
GBool getPSAlwaysRasterize();
+#if !POPPLER_GLOBAL
GString *getTextEncodingName();
EndOfLineKind getTextEOL();
GBool getTextPageBreaks();
GBool getTextKeepTinyChars();
+#endif
GString *getInitialZoom();
GBool getContinuousView();
GBool getEnableT1lib();
+#if !POPPLER_GLOBAL
GBool getEnableFreeType();
GBool getDisableFreeTypeHinting();
GBool getAntialias();
@@ -245,12 +259,17 @@
double getScreenGamma();
double getScreenBlackThreshold();
double getScreenWhiteThreshold();
+#else
+ GBool getDisableFreeTypeHinting();
+ GBool getAntialiasPrinting();
+#endif
double getMinLineWidth();
GBool getDrawAnnotations();
GBool getOverprintPreview() { return overprintPreview; }
GString *getLaunchCommand() { return launchCommand; }
GString *getURLCommand() { return urlCommand; }
GString *getMovieCommand() { return movieCommand; }
+#if !POPPLER_GLOBAL
GBool getMapNumericCharNames();
GBool getMapUnknownCharNames();
GList *getKeyBinding(int code, int mods, int context);
@@ -262,6 +281,9 @@
UnicodeMap *getUnicodeMap(GString *encodingName);
CMap *getCMap(GString *collection, GString *cMapName, Stream *stream);
UnicodeMap *getTextEncoding();
+#else
+ GList *getKeyBinding(int code, int mods, int context);
+#endif
//----- functions to set parameters
@@ -273,6 +295,7 @@
void setPSImageableArea(int llx, int lly, int urx, int ury);
void setPSDuplex(GBool duplex);
void setPSCrop(GBool crop);
+#if !POPPLER_GLOBAL
void setPSExpandSmaller(GBool expand);
void setPSShrinkLarger(GBool shrink);
void setPSCenter(GBool center);
@@ -289,9 +312,13 @@
GBool setTextEOL(char *s);
void setTextPageBreaks(GBool pageBreaks);
void setTextKeepTinyChars(GBool keep);
+#else
+ void setPSFontPassthrough(GBool passthrough);
+#endif
void setInitialZoom(char *s);
void setContinuousView(GBool cont);
GBool setEnableT1lib(char *s);
+#if !POPPLER_GLOBAL
GBool setEnableFreeType(char *s);
GBool setAntialias(char *s);
GBool setVectorAntialias(char *s);
@@ -310,6 +337,7 @@
void addSecurityHandler(XpdfSecurityHandler *handler);
XpdfSecurityHandler *getSecurityHandler(char *name);
+#endif
private:
@@ -344,13 +372,14 @@
GList *tokens, GString *fileName, int line);
void parseCommand(const char *cmdName, GString **val,
GList *tokens, GString *fileName, int line);
- void parseYesNo(const char *cmdName, GBool *flag,
- GList *tokens, GString *fileName, int line);
+ char *parseYesNo(const char *cmdName, GBool *flag,
+ GList *tokens, GString *fileName, int line);
GBool parseYesNo2(char *token, GBool *flag);
- void parseInteger(const char *cmdName, int *val,
- GList *tokens, GString *fileName, int line);
- void parseFloat(const char *cmdName, double *val,
- GList *tokens, GString *fileName, int line);
+ GBool parseInteger(const char *cmdName, int *val,
+ GList *tokens, GString *fileName, int line);
+ GBool parseFloat(const char *cmdName, double *val,
+ GList *tokens, GString *fileName, int line);
+#if !POPPLER_GLOBAL
UnicodeMap *getUnicodeMap2(GString *encodingName);
#ifdef ENABLE_PLUGINS
GBool loadPlugin(char *type, char *name);
@@ -378,6 +407,7 @@
GHash *cMapDirs; // list of CMap dirs, indexed by collection
// name [GList[GString]]
GList *toUnicodeDirs; // list of ToUnicode CMap dirs [GString]
+#endif
GHash *fontFiles; // font files: font name mapped to path
// [GString]
GList *fontDirs; // list of font dirs [GString]
@@ -392,11 +422,15 @@
psImageableURX,
psImageableURY;
GBool psCrop; // crop PS output to CropBox
+#if !POPPLER_GLOBAL
GBool psExpandSmaller; // expand smaller pages to fill paper
GBool psShrinkLarger; // shrink larger pages to fit paper
GBool psCenter; // center pages on the paper
GBool psDuplex; // enable duplexing in PostScript?
PSLevel psLevel; // PostScript level to generate
+#else
+ GBool psDuplex; // enable duplexing in PostScript?
+#endif
GHash *psResidentFonts; // 8-bit fonts resident in printer:
// PDF font name mapped to PS font name
// [GString]
@@ -411,25 +445,30 @@
GBool psEmbedCIDPostScript; // embed CID PostScript fonts?
GBool psEmbedCIDTrueType; // embed CID TrueType fonts?
GBool psFontPassthrough; // pass all fonts through as-is?
+#if !POPPLER_GLOBAL
GBool psPreload; // preload PostScript images and forms into
// memory
GBool psOPI; // generate PostScript OPI comments?
GBool psASCIIHex; // use ASCIIHex instead of ASCII85?
+#endif
GBool psUncompressPreloadedImages; // uncompress all preloaded images
double psRasterResolution; // PostScript rasterization resolution (dpi)
GBool psRasterMono; // true to do PostScript rasterization
// in monochrome (gray); false to do it
// in color (RGB/CMYK)
GBool psAlwaysRasterize; // force PostScript rasterization
+#if !POPPLER_GLOBAL
GString *textEncoding; // encoding (unicodeMap) to use for text
// output
EndOfLineKind textEOL; // type of EOL marker to use for text
// output
GBool textPageBreaks; // insert end-of-page markers?
GBool textKeepTinyChars; // keep all characters in text output
+#endif
GString *initialZoom; // initial zoom level
GBool continuousView; // continuous view mode
GBool enableT1lib; // t1lib enable flag
+#if !POPPLER_GLOBAL
GBool enableFreeType; // FreeType enable flag
GBool disableFreeTypeHinting; // FreeType hinting disable flag
GBool antialias; // font anti-aliasing enable flag
@@ -442,6 +481,10 @@
double screenGamma; // screen gamma correction
double screenBlackThreshold; // screen black clamping threshold
double screenWhiteThreshold; // screen white clamping threshold
+#else
+ GBool disableFreeTypeHinting; // FreeType hinting disable flag
+ GBool antialiasPrinting; // allow anti-aliasing when printing
+#endif
double minLineWidth; // minimum line width
GBool drawAnnotations; // draw annotations or not
GBool overprintPreview; // enable overprint preview
@@ -451,6 +494,7 @@
GBool mapNumericCharNames; // map numeric char names (from font subsets)?
GBool mapUnknownCharNames; // map unknown char names?
GList *keyBindings; // key & mouse button bindings [KeyBinding]
+#if !POPPLER_GLOBAL
GBool printCommands; // print the drawing commands
GBool errQuiet; // suppress error messages?
@@ -464,11 +508,16 @@
GList *securityHandlers; // list of loaded security handlers
// [XpdfSecurityHandler]
#endif
+#endif
#if MULTITHREADED
+#if !POPPLER_GLOBAL
GMutex mutex;
GMutex unicodeMapCacheMutex;
GMutex cMapCacheMutex;
+#else
+ GMutex xpdf_mutex;
+#endif
#endif
};
============================================================
Message sent on
to Wolfram Gloger <bugzilla1@malloc.de>:
Bug#658264.
(Wed, 08 Feb 2012 21:00:05 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <michael.s.gilbert@gmail.com>:
Bug#658264; Package xpdf.
(Thu, 09 Feb 2012 16:39:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Wolfram Gloger <wg@malloc.de>:
Extra info received and forwarded to list. Copy sent to Michael Gilbert <michael.s.gilbert@gmail.com>.
(Thu, 09 Feb 2012 16:39:03 GMT) (full text, mbox, link).
Message #49 received at 658264@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
And here is the corresponding patch for stable/squeeze. Luckily it is a bit simpler. Regards, Wolfram.
[xpdf-3.0.2-fix-globalparams-clash.patch (text/x-diff, inline)]
description: fix type clash GlobalParam xpdf vs. poppler
author: Wolfram Gloger <bugzilla1@malloc.de>
debian-bug: http://bugs.debian.org/658264
Index: xpdf-3.02/xpdf/GlobalParams.cc
===================================================================
--- xpdf-3.02.orig/xpdf/GlobalParams.cc 2012-02-09 14:25:22.000000000 +0100
+++ xpdf-3.02/xpdf/GlobalParams.cc 2012-02-09 17:20:35.000000000 +0100
@@ -48,19 +48,11 @@
#endif
#if MULTITHREADED
-# define lockGlobalParams gLockMutex(&mutex)
-# define lockUnicodeMapCache gLockMutex(&unicodeMapCacheMutex)
-# define lockCMapCache gLockMutex(&cMapCacheMutex)
-# define unlockGlobalParams gUnlockMutex(&mutex)
-# define unlockUnicodeMapCache gUnlockMutex(&unicodeMapCacheMutex)
-# define unlockCMapCache gUnlockMutex(&cMapCacheMutex)
+# define lockGlobalParams gLockMutex(&xpdf_mutex)
+# define unlockGlobalParams gUnlockMutex(&xpdf_mutex)
#else
# define lockGlobalParams
-# define lockUnicodeMapCache
-# define lockCMapCache
# define unlockGlobalParams
-# define unlockUnicodeMapCache
-# define unlockCMapCache
#endif
#include "NameToUnicodeTable.h"
@@ -601,20 +593,26 @@
// parsing
//------------------------------------------------------------------------
-GlobalParams::GlobalParams(char *cfgFileName) {
- UnicodeMap *map;
+GlobalParams::GlobalParams(char *cfgFileName)
+#if POPPLER_GLOBAL
+: poppler_GlobalParams()
+#endif
+{
GString *fileName;
FILE *f;
- int i;
+
+#if POPPLER_GLOBAL
+#undef globalParams
+ globalParams = this;
+#endif
#if MULTITHREADED
- gInitMutex(&mutex);
- gInitMutex(&unicodeMapCacheMutex);
- gInitMutex(&cMapCacheMutex);
+ gInitMutex(&xpdf_mutex);
#endif
initBuiltinFontTables();
+#if !POPPLER_GLOBAL
// scan the encoding in reverse because we want the lowest-numbered
// index for each char name ('space' is encoded twice)
macRomanReverseMap = new NameToCharCode();
@@ -637,6 +635,7 @@
unicodeMaps = new GHash(gTrue);
cMapDirs = new GHash(gTrue);
toUnicodeDirs = new GList();
+#endif
displayFonts = new GHash();
displayCIDFonts = new GHash();
displayNamedCIDFonts = new GHash();
@@ -662,11 +661,6 @@
psImageableURX = psPaperWidth;
psImageableURY = psPaperHeight;
psCrop = gTrue;
- psExpandSmaller = gFalse;
- psShrinkLarger = gTrue;
- psCenter = gTrue;
- psDuplex = gFalse;
- psLevel = psLevel2;
psFile = NULL;
psFonts = new GHash();
psNamedFonts16 = new GList();
@@ -675,6 +669,7 @@
psEmbedTrueType = gTrue;
psEmbedCIDPostScript = gTrue;
psEmbedCIDTrueType = gTrue;
+#if !POPPLER_GLOBAL
psPreload = gFalse;
psOPI = gFalse;
psASCIIHex = gFalse;
@@ -688,10 +683,12 @@
#endif
textPageBreaks = gTrue;
textKeepTinyChars = gFalse;
+#endif
fontDirs = new GList();
initialZoom = new GString("125");
continuousView = gFalse;
enableT1lib = gTrue;
+#if !POPPLER_GLOBAL
enableFreeType = gTrue;
antialias = gTrue;
vectorAntialias = gTrue;
@@ -702,8 +699,10 @@
screenGamma = 1.0;
screenBlackThreshold = 0.0;
screenWhiteThreshold = 1.0;
+#endif
urlCommand = NULL;
movieCommand = NULL;
+#if !POPPLER_GLOBAL
mapNumericCharNames = gTrue;
mapUnknownCharNames = gFalse;
createDefaultKeyBindings();
@@ -747,6 +746,9 @@
residentUnicodeMaps->add(map->getEncodingName(), map);
map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
residentUnicodeMaps->add(map->getEncodingName(), map);
+#else
+ createDefaultKeyBindings();
+#endif
// look for a user config file, then a system-wide config file
f = NULL;
@@ -928,6 +930,9 @@
GString *cmd, *incFile;
char *p1, *p2;
FILE *f2;
+ GBool pBool;
+ int pInt;
+ double pDouble;
// break the line into tokens
tokens = new GList();
@@ -1009,12 +1014,15 @@
} else if (!cmd->cmp("psCrop")) {
parseYesNo("psCrop", &psCrop, tokens, fileName, line);
} else if (!cmd->cmp("psExpandSmaller")) {
- parseYesNo("psExpandSmaller", &psExpandSmaller,
- tokens, fileName, line);
+ if (parseYesNo("psExpandSmaller", &pBool,
+ tokens, fileName, line))
+ setPSExpandSmaller(pBool);
} else if (!cmd->cmp("psShrinkLarger")) {
- parseYesNo("psShrinkLarger", &psShrinkLarger, tokens, fileName, line);
+ if (parseYesNo("psShrinkLarger", &pBool, tokens, fileName, line))
+ setPSShrinkLarger(pBool);
} else if (!cmd->cmp("psCenter")) {
- parseYesNo("psCenter", &psCenter, tokens, fileName, line);
+ if (parseYesNo("psCenter", &pBool, tokens, fileName, line))
+ setPSCenter(pBool);
} else if (!cmd->cmp("psDuplex")) {
parseYesNo("psDuplex", &psDuplex, tokens, fileName, line);
} else if (!cmd->cmp("psLevel")) {
@@ -1031,21 +1039,25 @@
parseYesNo("psEmbedCIDTrueType", &psEmbedCIDTrueType,
tokens, fileName, line);
} else if (!cmd->cmp("psPreload")) {
- parseYesNo("psPreload", &psPreload, tokens, fileName, line);
+ if (parseYesNo("psPreload", &pBool, tokens, fileName, line))
+ setPSPreload(pBool);
} else if (!cmd->cmp("psOPI")) {
- parseYesNo("psOPI", &psOPI, tokens, fileName, line);
+ if (parseYesNo("psOPI", &pBool, tokens, fileName, line))
+ setPSOPI(pBool);
} else if (!cmd->cmp("psASCIIHex")) {
- parseYesNo("psASCIIHex", &psASCIIHex, tokens, fileName, line);
+ if (parseYesNo("psASCIIHex", &pBool, tokens, fileName, line))
+ setPSASCIIHex(pBool);
} else if (!cmd->cmp("textEncoding")) {
parseTextEncoding(tokens, fileName, line);
} else if (!cmd->cmp("textEOL")) {
parseTextEOL(tokens, fileName, line);
} else if (!cmd->cmp("textPageBreaks")) {
- parseYesNo("textPageBreaks", &textPageBreaks,
- tokens, fileName, line);
+ if (parseYesNo("textPageBreaks", &pBool, tokens, fileName, line))
+ setTextPageBreaks(pBool);
} else if (!cmd->cmp("textKeepTinyChars")) {
- parseYesNo("textKeepTinyChars", &textKeepTinyChars,
- tokens, fileName, line);
+ if (parseYesNo("textKeepTinyChars", &pBool,
+ tokens, fileName, line))
+ setTextKeepTinyChars(pBool);
} else if (!cmd->cmp("fontDir")) {
parseFontDir(tokens, fileName, line);
} else if (!cmd->cmp("initialZoom")) {
@@ -1055,30 +1067,40 @@
} else if (!cmd->cmp("enableT1lib")) {
parseYesNo("enableT1lib", &enableT1lib, tokens, fileName, line);
} else if (!cmd->cmp("enableFreeType")) {
- parseYesNo("enableFreeType", &enableFreeType, tokens, fileName, line);
+ char *t = parseYesNo("enableFreeType", &pBool, tokens, fileName, line);
+ if (t)
+ setEnableFreeType(t);
} else if (!cmd->cmp("antialias")) {
- parseYesNo("antialias", &antialias, tokens, fileName, line);
+ char *t = parseYesNo("antialias", &pBool, tokens, fileName, line);
+ if (t)
+ setAntialias(t);
} else if (!cmd->cmp("vectorAntialias")) {
- parseYesNo("vectorAntialias", &vectorAntialias,
- tokens, fileName, line);
+ char *t = parseYesNo("vectorAntialias", &pBool,
+ tokens, fileName, line);
+ if (t)
+ setVectorAntialias(t);
} else if (!cmd->cmp("strokeAdjust")) {
- parseYesNo("strokeAdjust", &strokeAdjust, tokens, fileName, line);
+ if (parseYesNo("strokeAdjust", &pBool, tokens, fileName, line))
+ setStrokeAdjust(pBool);
} else if (!cmd->cmp("screenType")) {
parseScreenType(tokens, fileName, line);
} else if (!cmd->cmp("screenSize")) {
- parseInteger("screenSize", &screenSize, tokens, fileName, line);
+ if (parseInteger("screenSize", &pInt, tokens, fileName, line))
+ setScreenSize(pInt);
} else if (!cmd->cmp("screenDotRadius")) {
- parseInteger("screenDotRadius", &screenDotRadius,
- tokens, fileName, line);
+ if (parseInteger("screenDotRadius", &pInt, tokens, fileName, line))
+ setScreenDotRadius(pInt);
} else if (!cmd->cmp("screenGamma")) {
- parseFloat("screenGamma", &screenGamma,
- tokens, fileName, line);
+ if (parseFloat("screenGamma", &pDouble, tokens, fileName, line))
+ setScreenGamma(pDouble);
} else if (!cmd->cmp("screenBlackThreshold")) {
- parseFloat("screenBlackThreshold", &screenBlackThreshold,
- tokens, fileName, line);
+ if (parseFloat("screenBlackThreshold", &pDouble,
+ tokens, fileName, line))
+ setScreenBlackThreshold(pDouble);
} else if (!cmd->cmp("screenWhiteThreshold")) {
- parseFloat("screenWhiteThreshold", &screenWhiteThreshold,
- tokens, fileName, line);
+ if (parseFloat("screenWhiteThreshold", &pDouble,
+ tokens, fileName, line))
+ setScreenWhiteThreshold(pDouble);
} else if (!cmd->cmp("urlCommand")) {
parseCommand("urlCommand", &urlCommand, tokens, fileName, line);
} else if (!cmd->cmp("movieCommand")) {
@@ -1094,9 +1116,11 @@
} else if (!cmd->cmp("unbind")) {
parseUnbind(tokens, fileName, line);
} else if (!cmd->cmp("printCommands")) {
- parseYesNo("printCommands", &printCommands, tokens, fileName, line);
+ if (parseYesNo("printCommands", &pBool, tokens, fileName, line))
+ setPrintCommands(pBool);
} else if (!cmd->cmp("errQuiet")) {
- parseYesNo("errQuiet", &errQuiet, tokens, fileName, line);
+ if (parseYesNo("errQuiet", &pBool, tokens, fileName, line))
+ setErrQuiet(pBool);
} else {
error(-1, "Unknown config file command '%s' (%s:%d)",
cmd->getCString(), fileName->getCString(), line);
@@ -1116,6 +1140,8 @@
deleteGList(tokens, GString);
}
+#if !POPPLER_GLOBAL
+
void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
int line) {
GString *name;
@@ -1230,6 +1256,22 @@
toUnicodeDirs->append(((GString *)tokens->get(1))->copy());
}
+#else // POPPLER_GLOBAL
+
+// provide dummys as unicode parsing is handled by poppler
+void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
+ int line) {}
+void GlobalParams::parseCIDToUnicode(GList *tokens, GString *fileName,
+ int line) {}
+void GlobalParams::parseUnicodeToUnicode(GList *tokens, GString *fileName,
+ int line) {}
+void GlobalParams::parseUnicodeMap(GList *tokens, GString *fileName,
+ int line) {}
+void GlobalParams::parseCMapDir(GList *tokens, GString *fileName, int line) {}
+void GlobalParams::parseToUnicodeDir(GList *tokens, GString *fileName,
+ int line) {}
+#endif
+
void GlobalParams::parseDisplayFont(GList *tokens, GHash *fontHash,
DisplayFontParamKind kind,
GString *fileName, int line) {
@@ -1315,17 +1357,17 @@
}
tok = (GString *)tokens->get(1);
if (!tok->cmp("level1")) {
- psLevel = psLevel1;
+ setPSLevel(psLevel1);
} else if (!tok->cmp("level1sep")) {
- psLevel = psLevel1Sep;
+ setPSLevel(psLevel1Sep);
} else if (!tok->cmp("level2")) {
- psLevel = psLevel2;
+ setPSLevel(psLevel2);
} else if (!tok->cmp("level2sep")) {
- psLevel = psLevel2Sep;
+ setPSLevel(psLevel2Sep);
} else if (!tok->cmp("level3")) {
- psLevel = psLevel3;
+ setPSLevel(psLevel3);
} else if (!tok->cmp("level3Sep")) {
- psLevel = psLevel3Sep;
+ setPSLevel(psLevel3Sep);
} else {
error(-1, "Bad 'psLevel' config file command (%s:%d)",
fileName->getCString(), line);
@@ -1392,8 +1434,7 @@
fileName->getCString(), line);
return;
}
- delete textEncoding;
- textEncoding = ((GString *)tokens->get(1))->copy();
+ setTextEncoding(((GString *)tokens->get(1))->getCString());
}
void GlobalParams::parseTextEOL(GList *tokens, GString *fileName, int line) {
@@ -1405,13 +1446,7 @@
return;
}
tok = (GString *)tokens->get(1);
- if (!tok->cmp("unix")) {
- textEOL = eolUnix;
- } else if (!tok->cmp("dos")) {
- textEOL = eolDOS;
- } else if (!tok->cmp("mac")) {
- textEOL = eolMac;
- } else {
+ if (!setTextEOL(tok->getCString())) {
error(-1, "Bad 'textEOL' config file command (%s:%d)",
fileName->getCString(), line);
}
@@ -1448,11 +1483,11 @@
}
tok = (GString *)tokens->get(1);
if (!tok->cmp("dispersed")) {
- screenType = screenDispersed;
+ setScreenType(screenDispersed);
} else if (!tok->cmp("clustered")) {
- screenType = screenClustered;
+ setScreenType(screenClustered);
} else if (!tok->cmp("stochasticClustered")) {
- screenType = screenStochasticClustered;
+ setScreenType(screenStochasticClustered);
} else {
error(-1, "Bad 'screenType' config file command (%s:%d)",
fileName->getCString(), line);
@@ -1658,20 +1693,22 @@
*val = ((GString *)tokens->get(1))->copy();
}
-void GlobalParams::parseYesNo(char *cmdName, GBool *flag,
+char *GlobalParams::parseYesNo(char *cmdName, GBool *flag,
GList *tokens, GString *fileName, int line) {
GString *tok;
if (tokens->getLength() != 2) {
error(-1, "Bad '%s' config file command (%s:%d)",
cmdName, fileName->getCString(), line);
- return;
+ return NULL;
}
tok = (GString *)tokens->get(1);
if (!parseYesNo2(tok->getCString(), flag)) {
error(-1, "Bad '%s' config file command (%s:%d)",
cmdName, fileName->getCString(), line);
+ return NULL;
}
+ return tok->getCString();
}
GBool GlobalParams::parseYesNo2(char *token, GBool *flag) {
@@ -1685,7 +1722,7 @@
return gTrue;
}
-void GlobalParams::parseInteger(char *cmdName, int *val,
+GBool GlobalParams::parseInteger(char *cmdName, int *val,
GList *tokens, GString *fileName, int line) {
GString *tok;
int i;
@@ -1693,13 +1730,13 @@
if (tokens->getLength() != 2) {
error(-1, "Bad '%s' config file command (%s:%d)",
cmdName, fileName->getCString(), line);
- return;
+ return gFalse;
}
tok = (GString *)tokens->get(1);
if (tok->getLength() == 0) {
error(-1, "Bad '%s' config file command (%s:%d)",
cmdName, fileName->getCString(), line);
- return;
+ return gFalse;
}
if (tok->getChar(0) == '-') {
i = 1;
@@ -1710,13 +1747,14 @@
if (tok->getChar(i) < '0' || tok->getChar(i) > '9') {
error(-1, "Bad '%s' config file command (%s:%d)",
cmdName, fileName->getCString(), line);
- return;
+ return gFalse;
}
}
*val = atoi(tok->getCString());
+ return gTrue;
}
-void GlobalParams::parseFloat(char *cmdName, double *val,
+GBool GlobalParams::parseFloat(char *cmdName, double *val,
GList *tokens, GString *fileName, int line) {
GString *tok;
int i;
@@ -1724,13 +1762,13 @@
if (tokens->getLength() != 2) {
error(-1, "Bad '%s' config file command (%s:%d)",
cmdName, fileName->getCString(), line);
- return;
+ return gFalse;
}
tok = (GString *)tokens->get(1);
if (tok->getLength() == 0) {
error(-1, "Bad '%s' config file command (%s:%d)",
cmdName, fileName->getCString(), line);
- return;
+ return gFalse;
}
if (tok->getChar(0) == '-') {
i = 1;
@@ -1742,13 +1780,15 @@
tok->getChar(i) == '.')) {
error(-1, "Bad '%s' config file command (%s:%d)",
cmdName, fileName->getCString(), line);
- return;
+ return gFalse;
}
}
*val = atof(tok->getCString());
+ return gTrue;
}
GlobalParams::~GlobalParams() {
+#if !POPPLER_GLOBAL
GHashIter *iter;
GString *key;
GList *list;
@@ -1764,6 +1804,9 @@
deleteGHash(residentUnicodeMaps, UnicodeMap);
deleteGHash(unicodeMaps, GString);
deleteGList(toUnicodeDirs, GString);
+#else
+ freeBuiltinFontTables();
+#endif
deleteGHash(displayFonts, DisplayFontParam);
deleteGHash(displayCIDFonts, DisplayFontParam);
deleteGHash(displayNamedCIDFonts, DisplayFontParam);
@@ -1778,7 +1821,6 @@
deleteGHash(psFonts, PSFontParam);
deleteGList(psNamedFonts16, PSFontParam);
deleteGList(psFonts16, PSFontParam);
- delete textEncoding;
deleteGList(fontDirs, GString);
delete initialZoom;
if (urlCommand) {
@@ -1789,6 +1831,7 @@
}
deleteGList(keyBindings, KeyBinding);
+#if !POPPLER_GLOBAL
cMapDirs->startIter(&iter);
while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
deleteGList(list, GString);
@@ -1804,21 +1847,15 @@
delete securityHandlers;
deleteGList(plugins, Plugin);
#endif
+#endif
#if MULTITHREADED
- gDestroyMutex(&mutex);
- gDestroyMutex(&unicodeMapCacheMutex);
- gDestroyMutex(&cMapCacheMutex);
+ gDestroyMutex(&xpdf_mutex);
#endif
}
//------------------------------------------------------------------------
-void GlobalParams::setBaseDir(char *dir) {
- delete baseDir;
- baseDir = new GString(dir);
-}
-
void GlobalParams::setupBaseFonts(char *dir) {
GString *fontName;
GString *fileName;
@@ -1917,7 +1954,7 @@
}
dfp = new DisplayFontParam(fontName, kind);
dfp->t1.fileName = fileName;
- globalParams->addDisplayFont(dfp);
+ addDisplayFont(dfp);
}
#ifdef WIN32
@@ -1931,6 +1968,7 @@
// accessors
//------------------------------------------------------------------------
+#if !POPPLER_GLOBAL
CharCode GlobalParams::getMacRomanCharCode(char *charName) {
// no need to lock - macRomanReverseMap is constant
return macRomanReverseMap->lookup(charName);
@@ -2021,6 +2059,7 @@
unlockGlobalParams;
return NULL;
}
+#endif
DisplayFontParam *GlobalParams::getDisplayFont(GString *fontName) {
DisplayFontParam *dfp;
@@ -2036,6 +2075,7 @@
return dfp;
}
+#if !POPPLER_GLOBAL
DisplayFontParam *GlobalParams::getDisplayCIDFont(GString *fontName,
GString *collection) {
DisplayFontParam *dfp;
@@ -2048,6 +2088,7 @@
unlockGlobalParams;
return dfp;
}
+#endif
GString *GlobalParams::getPSFile() {
GString *s;
@@ -2094,6 +2135,7 @@
return f;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::getPSExpandSmaller() {
GBool f;
@@ -2120,6 +2162,7 @@
unlockGlobalParams;
return f;
}
+#endif
GBool GlobalParams::getPSDuplex() {
GBool d;
@@ -2130,6 +2173,7 @@
return d;
}
+#if !POPPLER_GLOBAL
PSLevel GlobalParams::getPSLevel() {
PSLevel level;
@@ -2138,6 +2182,7 @@
unlockGlobalParams;
return level;
}
+#endif
PSFontParam *GlobalParams::getPSFont(GString *fontName) {
PSFontParam *p;
@@ -2215,6 +2260,7 @@
return e;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::getPSPreload() {
GBool preload;
@@ -2301,6 +2347,7 @@
unlockGlobalParams;
return NULL;
}
+#endif
GString *GlobalParams::getInitialZoom() {
GString *s;
@@ -2329,6 +2376,7 @@
return f;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::getEnableFreeType() {
GBool f;
@@ -2437,6 +2485,7 @@
unlockGlobalParams;
return map;
}
+#endif
GList *GlobalParams::getKeyBinding(int code, int mods, int context) {
KeyBinding *binding;
@@ -2464,6 +2513,7 @@
return cmds;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::getPrintCommands() {
GBool p;
@@ -2549,6 +2599,7 @@
UnicodeMap *GlobalParams::getTextEncoding() {
return getUnicodeMap2(textEncoding);
}
+#endif
//------------------------------------------------------------------------
// functions to set parameters
@@ -2632,6 +2683,7 @@
unlockGlobalParams;
}
+#if !POPPLER_GLOBAL
void GlobalParams::setPSExpandSmaller(GBool expand) {
lockGlobalParams;
psExpandSmaller = expand;
@@ -2649,6 +2701,7 @@
psCenter = center;
unlockGlobalParams;
}
+#endif
void GlobalParams::setPSDuplex(GBool duplex) {
lockGlobalParams;
@@ -2656,6 +2709,7 @@
unlockGlobalParams;
}
+#if !POPPLER_GLOBAL
void GlobalParams::setPSLevel(PSLevel level) {
lockGlobalParams;
psLevel = level;
@@ -2738,6 +2792,7 @@
textKeepTinyChars = keep;
unlockGlobalParams;
}
+#endif
void GlobalParams::setInitialZoom(char *s) {
lockGlobalParams;
@@ -2761,6 +2816,7 @@
return ok;
}
+#if !POPPLER_GLOBAL
GBool GlobalParams::setEnableFreeType(char *s) {
GBool ok;
@@ -2908,3 +2964,4 @@
}
#endif // ENABLE_PLUGINS
+#endif
Index: xpdf-3.02/xpdf/GlobalParams.h
===================================================================
--- xpdf-3.02.orig/xpdf/GlobalParams.h 2012-02-09 14:25:22.000000000 +0100
+++ xpdf-3.02/xpdf/GlobalParams.h 2012-02-09 16:33:57.000000000 +0100
@@ -6,24 +6,20 @@
//
//========================================================================
-#ifndef GLOBALPARAMS_H
-#define GLOBALPARAMS_H
+#ifndef XPDF_GLOBALPARAMS_H
+#define XPDF_GLOBALPARAMS_H
-#include <aconf.h>
+// poppler and xpdf have incompatible GlobalParams implementations
+#include <poppler/GlobalParams.h>
+typedef GlobalParams poppler_GlobalParams;
+class XpdfGlobalParams;
+#define POPPLER_GLOBAL 1
+#define GlobalParams XpdfGlobalParams
+#define globalParams xpdf_globalParams
-#ifdef USE_GCC_PRAGMAS
-#pragma interface
-#endif
-
-#include <stdio.h>
-#include "gtypes.h"
-#include "CharTypes.h"
#include "config.h"
-#if MULTITHREADED
-#include "GMutex.h"
-#endif
-
+#if !POPPLER_GLOBAL
class GString;
class GList;
class GHash;
@@ -40,12 +36,14 @@
#ifdef WIN32
class WinFontList;
#endif
+#endif
//------------------------------------------------------------------------
// The global parameters object.
extern GlobalParams *globalParams;
+#if !POPPLER_GLOBAL
//------------------------------------------------------------------------
enum DisplayFontParamKind {
@@ -122,6 +120,7 @@
screenClustered,
screenStochasticClustered
};
+#endif
//------------------------------------------------------------------------
@@ -191,7 +190,11 @@
//------------------------------------------------------------------------
-class GlobalParams {
+class GlobalParams
+#if POPPLER_GLOBAL
+: public poppler_GlobalParams
+#endif
+{
public:
// Initialize the global parameters by attempting to read a config
@@ -200,13 +203,16 @@
~GlobalParams();
+#if !POPPLER_GLOBAL
void setBaseDir(char *dir);
+#endif
void setupBaseFonts(char *dir);
void parseLine(char *buf, GString *fileName, int line);
//----- accessors
+#if !POPPLER_GLOBAL
CharCode getMacRomanCharCode(char *charName);
GString *getBaseDir();
@@ -215,6 +221,7 @@
FILE *getUnicodeMapFile(GString *encodingName);
FILE *findCMapFile(GString *collection, GString *cMapName);
FILE *findToUnicodeFile(GString *name);
+#endif
DisplayFontParam *getDisplayFont(GString *fontName);
DisplayFontParam *getDisplayCIDFont(GString *fontName, GString *collection);
GString *getPSFile();
@@ -223,16 +230,19 @@
void getPSImageableArea(int *llx, int *lly, int *urx, int *ury);
GBool getPSDuplex();
GBool getPSCrop();
+#if !POPPLER_GLOBAL
GBool getPSExpandSmaller();
GBool getPSShrinkLarger();
GBool getPSCenter();
PSLevel getPSLevel();
+#endif
PSFontParam *getPSFont(GString *fontName);
PSFontParam *getPSFont16(GString *fontName, GString *collection, int wMode);
GBool getPSEmbedType1();
GBool getPSEmbedTrueType();
GBool getPSEmbedCIDPostScript();
GBool getPSEmbedCIDTrueType();
+#if !POPPLER_GLOBAL
GBool getPSPreload();
GBool getPSOPI();
GBool getPSASCIIHex();
@@ -241,9 +251,11 @@
GBool getTextPageBreaks();
GBool getTextKeepTinyChars();
GString *findFontFile(GString *fontName, char **exts);
+#endif
GString *getInitialZoom();
GBool getContinuousView();
GBool getEnableT1lib();
+#if !POPPLER_GLOBAL
GBool getEnableFreeType();
GBool getAntialias();
GBool getVectorAntialias();
@@ -254,8 +266,10 @@
double getScreenGamma();
double getScreenBlackThreshold();
double getScreenWhiteThreshold();
+#endif
GString *getURLCommand() { return urlCommand; }
GString *getMovieCommand() { return movieCommand; }
+#if !POPPLER_GLOBAL
GBool getMapNumericCharNames();
GBool getMapUnknownCharNames();
GList *getKeyBinding(int code, int mods, int context);
@@ -267,6 +281,9 @@
UnicodeMap *getUnicodeMap(GString *encodingName);
CMap *getCMap(GString *collection, GString *cMapName, Stream *stream);
UnicodeMap *getTextEncoding();
+#else
+ GList *getKeyBinding(int code, int mods, int context);
+#endif
//----- functions to set parameters
@@ -278,6 +295,7 @@
void setPSImageableArea(int llx, int lly, int urx, int ury);
void setPSDuplex(GBool duplex);
void setPSCrop(GBool crop);
+#if !POPPLER_GLOBAL
void setPSExpandSmaller(GBool expand);
void setPSShrinkLarger(GBool shrink);
void setPSCenter(GBool center);
@@ -293,9 +311,13 @@
GBool setTextEOL(char *s);
void setTextPageBreaks(GBool pageBreaks);
void setTextKeepTinyChars(GBool keep);
+#else
+ void setPSFontPassthrough(GBool passthrough);
+#endif
void setInitialZoom(char *s);
void setContinuousView(GBool cont);
GBool setEnableT1lib(char *s);
+#if !POPPLER_GLOBAL
GBool setEnableFreeType(char *s);
GBool setAntialias(char *s);
GBool setVectorAntialias(char *s);
@@ -314,6 +336,7 @@
void addSecurityHandler(XpdfSecurityHandler *handler);
XpdfSecurityHandler *getSecurityHandler(char *name);
+#endif
private:
@@ -348,13 +371,14 @@
GList *tokens, GString *fileName, int line);
void parseCommand(char *cmdName, GString **val,
GList *tokens, GString *fileName, int line);
- void parseYesNo(char *cmdName, GBool *flag,
- GList *tokens, GString *fileName, int line);
+ char *parseYesNo(char *cmdName, GBool *flag,
+ GList *tokens, GString *fileName, int line);
GBool parseYesNo2(char *token, GBool *flag);
- void parseInteger(char *cmdName, int *val,
- GList *tokens, GString *fileName, int line);
- void parseFloat(char *cmdName, double *val,
- GList *tokens, GString *fileName, int line);
+ GBool parseInteger(char *cmdName, int *val,
+ GList *tokens, GString *fileName, int line);
+ GBool parseFloat(char *cmdName, double *val,
+ GList *tokens, GString *fileName, int line);
+#if !POPPLER_GLOBAL
UnicodeMap *getUnicodeMap2(GString *encodingName);
#ifdef ENABLE_PLUGINS
GBool loadPlugin(char *type, char *name);
@@ -382,6 +406,7 @@
GHash *cMapDirs; // list of CMap dirs, indexed by collection
// name [GList[GString]]
GList *toUnicodeDirs; // list of ToUnicode CMap dirs [GString]
+#endif
GHash *displayFonts; // display font info, indexed by font name
// [DisplayFontParam]
#ifdef WIN32
@@ -399,11 +424,15 @@
psImageableURX,
psImageableURY;
GBool psCrop; // crop PS output to CropBox
+#if !POPPLER_GLOBAL
GBool psExpandSmaller; // expand smaller pages to fill paper
GBool psShrinkLarger; // shrink larger pages to fit paper
GBool psCenter; // center pages on the paper
GBool psDuplex; // enable duplexing in PostScript?
PSLevel psLevel; // PostScript level to generate
+#else
+ GBool psDuplex; // enable duplexing in PostScript?
+#endif
GHash *psFonts; // PostScript font info, indexed by PDF
// font name [PSFontParam]
GList *psNamedFonts16; // named 16-bit fonts [PSFontParam]
@@ -412,6 +441,7 @@
GBool psEmbedTrueType; // embed TrueType fonts?
GBool psEmbedCIDPostScript; // embed CID PostScript fonts?
GBool psEmbedCIDTrueType; // embed CID TrueType fonts?
+#if !POPPLER_GLOBAL
GBool psPreload; // preload PostScript images and forms into
// memory
GBool psOPI; // generate PostScript OPI comments?
@@ -422,10 +452,12 @@
// output
GBool textPageBreaks; // insert end-of-page markers?
GBool textKeepTinyChars; // keep all characters in text output
+#endif
GList *fontDirs; // list of font dirs [GString]
GString *initialZoom; // initial zoom level
GBool continuousView; // continuous view mode
GBool enableT1lib; // t1lib enable flag
+#if !POPPLER_GLOBAL
GBool enableFreeType; // FreeType enable flag
GBool antialias; // font anti-aliasing enable flag
GBool vectorAntialias; // vector anti-aliasing enable flag
@@ -436,11 +468,13 @@
double screenGamma; // screen gamma correction
double screenBlackThreshold; // screen black clamping threshold
double screenWhiteThreshold; // screen white clamping threshold
+#endif
GString *urlCommand; // command executed for URL links
GString *movieCommand; // command executed for movie annotations
GBool mapNumericCharNames; // map numeric char names (from font subsets)?
GBool mapUnknownCharNames; // map unknown char names?
GList *keyBindings; // key & mouse button bindings [KeyBinding]
+#if !POPPLER_GLOBAL
GBool printCommands; // print the drawing commands
GBool errQuiet; // suppress error messages?
@@ -454,11 +488,16 @@
GList *securityHandlers; // list of loaded security handlers
// [XpdfSecurityHandler]
#endif
+#endif
#if MULTITHREADED
+#if !POPPLER_GLOBAL
GMutex mutex;
GMutex unicodeMapCacheMutex;
GMutex cMapCacheMutex;
+#else
+ GMutex xpdf_mutex;
+#endif
#endif
};
Message sent on
to Wolfram Gloger <bugzilla1@malloc.de>:
Bug#658264.
(Thu, 09 Feb 2012 16:39:07 GMT) (full text, mbox, link).
Merged 658264 662882
Request was from Michael Gilbert <michael.s.gilbert@gmail.com>
to control@bugs.debian.org.
(Tue, 20 Mar 2012 02:27:04 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <michael.s.gilbert@gmail.com>:
Bug#658264; Package xpdf.
(Sat, 02 Jun 2012 08:09:03 GMT) (full text, mbox, link).
Acknowledgement sent
to halfdog <me@halfdog.net>:
Extra info received and forwarded to list. Copy sent to Michael Gilbert <michael.s.gilbert@gmail.com>.
(Sat, 02 Jun 2012 08:09:04 GMT) (full text, mbox, link).
Message #59 received at 658264@bugs.debian.org (full text, mbox, reply):
Just out of interest: Is this really a namespace conflict? As I understand the code, xpdf and libpoppler should want to use an object of same class from the same namespace, but due to some reason, the class code was duplicated to xpdf. I'm not c++ expert, but perhaps this was to make linking of xpdf simpler. I did a short analysis before reading this bug report by myself ( http://www.halfdog.net/Security/2012/XpdfCrashAnalysisUbuntuPrecise/ ). So from my opinion, with the patch attached, this will fix the problem only for some combination of xpdf/poppler versions and will make problem reappear in future. Could someone confirm that? -- http://www.halfdog.net/ PGP: 156A AE98 B91F 0114 FE88 2BD8 C459 9386 feed a bee
Information forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <mgilbert@debian.org>:
Bug#658264; Package xpdf.
(Fri, 10 Aug 2012 16:51:03 GMT) (full text, mbox, link).
Acknowledgement sent
to David Madore <david+bugs@madore.org>:
Extra info received and forwarded to list. Copy sent to Michael Gilbert <mgilbert@debian.org>.
(Fri, 10 Aug 2012 16:51:03 GMT) (full text, mbox, link).
Message #64 received at 658264@bugs.debian.org (full text, mbox, reply):
Just to confirm that Wolfram's patch works beautifully for me, and
fixes the utter brokenness of xpdf on Ubuntu Precise as well as its
not-so-obvious brokenness on Debian Wheezy. So, many thanks to him
for figuring this one out and fixing it!
Is there any hope of this fix entering Debian Wheezy before it
completely freezes? To reiterate what has been said earlier in the
thread, accessing uninitialized memory has potential security issues,
so this should be treated as more than a simple bugfix. (Also, if
Debian fixes this and Ubuntu copies the fix, a huge number of users
will thank you: see Ubuntu bug 943195.)
In the meantime, if it's of use to anyone, I built some packages of
xpdf ("3.03-10.dmadore") with this fix (as well as that of bug #671765
which is needed to compile on Ubuntu): they are in <URL:
ftp://quatramaran.ens.fr/pub/madore/misc/xpdf-bug658264/
> (compiled versions for i386 and amd64 were done on Debian Wheezy).
--
David A. Madore
( http://www.madore.org/~david/ )
Information forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <mgilbert@debian.org>:
Bug#658264; Package xpdf.
(Fri, 05 Oct 2012 01:15:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Jens Stimpfle <debian@jstimpfle.de>:
Extra info received and forwarded to list. Copy sent to Michael Gilbert <mgilbert@debian.org>.
(Fri, 05 Oct 2012 01:15:03 GMT) (full text, mbox, link).
Message #69 received at 658264@bugs.debian.org (full text, mbox, reply):
severity 658264 grave thanks Fri, 10 Aug 2012 18:38:38 +0200, David Madore <david+bugs@madore.org>: > Is there any hope of this fix entering Debian Wheezy before it > completely freezes? To reiterate what has been said earlier in the > thread, accessing uninitialized memory has potential security issues, > so this should be treated as more than a simple bugfix. We haven't heard of Michael for some time, and the xpdf package hasn't notably changed in the last 6 months, so we could assume the maintainer has no interest in getting the package to a sane state? To reiterate again, the current wheezy xpdf package is in a terribly defunct state, possibly imposing severe security problems and should under no circumstances be included into the stable release. Here are other related bugs: #622877 #640515 #606885 #628591 #662882 https://bugs.launchpad.net/ubuntu/+source/xpdf/+bug/669211 (see comment 47) Having read all that I am at a loss understanding how those bugs' severities could be lowered to not being RC. So, sorry for being so impolite to have bug control requests included (dunno if it works, at all). At my workplace, we have rebuilt the lenny xpdf package for wheezy. And we think, for Debian, too, it would be better to revert to the old version (upstream is close to dead anyway). Poppler might be out of reach. -- Have a nice day Jens Stimpfle
Severity set to 'grave' from 'important'
Request was from Jens Stimpfle <debian@jstimpfle.de>
to control@bugs.debian.org.
(Fri, 05 Oct 2012 01:15:05 GMT) (full text, mbox, link).
Marked as found in versions xpdf/3.03-10.
Request was from Jens Stimpfle <debian@jstimpfle.de>
to control@bugs.debian.org.
(Fri, 05 Oct 2012 13:57:12 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org:
Bug#658264; Package xpdf.
(Sun, 07 Oct 2012 19:33:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Michael Gilbert <mgilbert@debian.org>:
Extra info received and forwarded to list.
(Sun, 07 Oct 2012 19:33:03 GMT) (full text, mbox, link).
Message #78 received at 658264@bugs.debian.org (full text, mbox, reply):
control: severity -1 important On Thu, Oct 4, 2012 at 8:37 PM, Jens Stimpfle wrote: > To reiterate again, the current wheezy xpdf package is in a terribly > defunct state, possibly imposing severe security problems and should > under no circumstances be included into the stable release. No it isn't. Bugs remain, but that is the case for every package in every release. > Here are other related bugs: > > #622877 > #640515 > #606885 Not major i.e. release-critiical issues. > #628591 That's been done for a long long time. It's an incompatibility with an old expat. > #662882 > https://bugs.launchpad.net/ubuntu/+source/xpdf/+bug/669211 (see comment 47) Those are this bug, and Ubuntu developers are responsible for their system preferring poppler's globalparams and pretty much breaking everything. They need to find their own solution, and they did for 12.10. Saying there are potential security issues without evidence is blowing the problem out of proportion. If there is real evidence that there is a problem, I will certainly look at it, but guesses are not sufficient. Also, the patch attached to this report is far too large. Any patch should address the known problems specifically, rather than just copying popper's globalparams. In the future, please do not override maintainer severities without a good reason. No one likes bts ping pong. Best wishes, Mike
Severity set to 'important' from 'grave'
Request was from Michael Gilbert <mgilbert@debian.org>
to 658264-submit@bugs.debian.org.
(Sun, 07 Oct 2012 19:33:03 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <mgilbert@debian.org>:
Bug#658264; Package xpdf.
(Mon, 15 Oct 2012 01:21:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Jens Stimpfle <debian@jstimpfle.de>:
Extra info received and forwarded to list. Copy sent to Michael Gilbert <mgilbert@debian.org>.
(Mon, 15 Oct 2012 01:21:06 GMT) (full text, mbox, link).
Message #85 received at 658264@bugs.debian.org (full text, mbox, reply):
On Sun, Oct 07, 2012 at 03:30:08PM -0400, Michael Gilbert wrote: > > #622877 > > #640515 > > #606885 > > Not major i.e. release-critiical issues. I didn't claim /those/ where release-critical issues. Apart from that, broken printing (landscape), quiet aborts for password-protected PDF and apparently random segfaults are bugs which disqualify xpdf for production use, like computer pools. > Those are this bug, and Ubuntu developers are responsible for their > system preferring poppler's globalparams and pretty much breaking > everything. They need to find their own solution, and they did for > 12.10. I listed this example because the actual problem is explained there. > Saying there are potential security issues without evidence is blowing > the problem out of proportion. If there is real evidence that there > is a problem, I will certainly look at it, but guesses are not > sufficient. It /is/ a problem to have a package which builds (by chance) an invalid binary (passing wrong struct to library functions, luckily a bigger one!). I and many others consider this definitely a security problem. There may be no security problem with the current Debian release as I write this (I don't know), but one may appear at any time, for example with any poppler upgrade, even for unchanged xpdf, and the new poppler package being perfectly valid. After passing a wrong struct to a function, the behaviour is undefined. Additionally, when the struct is not all zeroes (it isn't), the real-world chance of real-world nasty behaviour goes significantly up and malicious abuse is generally real-world possible. > Also, the patch attached to this report is far too large. Agreed. And it really fix the code-duplication problem. > Any patch > should address the known problems specifically Disagreed. There is /no/ fixing of specific bugs related to the GlobalParams problem. They all exist only because the Debian xpdf package links poppler (and breaks the build). Which can't be done correctly without a /huge/ amount of work, because poppler has moved too far from its origins. Here's my patch: Change the xpdf package so it doesn't try to link poppler anymore. Please do us the favor. The lenny version worked just fine. And really, it's a threat to keep an invalid build. I also wouldn't mind helping getting a poppler-less xpdf package in good shape for wheezy. -- Have a nice day Jens Stimpfle
Information forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <mgilbert@debian.org>:
Bug#658264; Package xpdf.
(Mon, 19 Nov 2012 16:30:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Wolfram Gloger <bugzilla1@malloc.de>:
Extra info received and forwarded to list. Copy sent to Michael Gilbert <mgilbert@debian.org>.
(Mon, 19 Nov 2012 16:30:03 GMT) (full text, mbox, link).
Message #90 received at 658264@bugs.debian.org (full text, mbox, reply):
Michael Gilbert <mgilbert@debian.org> writes: >> #662882 >> https://bugs.launchpad.net/ubuntu/+source/xpdf/+bug/669211 (see comment 47) > > Those are this bug, and Ubuntu developers are responsible for their > system preferring poppler's globalparams and pretty much breaking > everything. They need to find their own solution, and they did for > 12.10. I don't follow the Ubuntu packages closely, but due to the undefined nature of the bug, I'm 100% sure that the reports that this is _unfixed_ even in 12.10 https://bugs.launchpad.net/ubuntu/+source/xpdf/+bug/943195 are real. > Saying there are potential security issues without evidence is blowing > the problem out of proportion. If there is real evidence that there > is a problem, I will certainly look at it, but guesses are not > sufficient. So analysing and verifying that there is an _undefined behaviour_ type bug here is no such evidence for you? > Also, the patch attached to this report is far too large. Any patch > should address the known problems specifically, rather than just > copying popper's globalparams. You didn't really look at the patch in much detail, did you? It is _not_ copying libpoppler's GlobalParams. It is _deriving from_ libpoppler's GlobalParams as defined in /usr/include/poppler/GlobalParams.h. Therefore, unless libpoppler's major version is bumped, it will only use its public ABI and hence continue to work even if libpoppler is upgraded. (As to Jens Stimpfle's suggestion of reverting to a poppler-less xpdf Version, yes that would be possible, but would lose all the Debian-specific work libpoppler has done. It depends on how much you value that. Personally, I am generally opposed to removing functionality which others have added.) "Far too large": there are maybe 15-20 lines of functional changes in this patch, mainly changing function signatures for error propagation. The rest is _purely mechanical_. The C++ compiler and valgrind are your friends here. All I can say from 20+ years of C/C++ experience is that this patch is a definitive fix for this grave bug. I am severely disappointed by your handling of this issue, and if the quality of your comments doesn't improve noticeably -- sorry, I have nothing more to say. Regards, Wolfram.
Information forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <mgilbert@debian.org>:
Bug#658264; Package xpdf.
(Sun, 16 Dec 2012 14:21:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Francis Russell <francis+dbts@unchartedbackwaters.co.uk>:
Extra info received and forwarded to list. Copy sent to Michael Gilbert <mgilbert@debian.org>.
(Sun, 16 Dec 2012 14:21:06 GMT) (full text, mbox, link).
Message #95 received at 658264@bugs.debian.org (full text, mbox, reply):
As someone who's been watching this bug for a while, I feel the need to interject to defend the Debian maintainers before they're alienated. Given how trivial a poppler-less xpdf package would be to create, the Debian maintainers probably have good reason not to package one. I'm guessing this is due to the fact that poppler/xpdf has had more than its fair share of security issues, and justifying a second copy of that code in Debian, and having to take responsibility for applying any security fixes to that code is too much work to justify for a single package, versus a library. As for the patch, yes it contains very few functional changes, but being too large by itself *is* enough to reject. The diff is extremely unlikely to apply cleanly to new versions of xpdf making it hard to port but even more problematically, it'll need to be updated each poppler release, and these tend to change the API a lot. What happens when functionality not present in the current version of poppler finally propagates in from xpdf, and configuration variables and methods are duplicated in the xpdf-specific global parameters class (e.g. enableT1lib)? xpdf and poppler will end up working with independent copies of the configuration variables and accessor methods. This is the fragile base class problem. This problem isn't an ABI issue, it's a software engineering dysfunction issue. Even forking xpdf and having that fork target poppler, as has been done/attempted before[1,2] is potentially problematic. In any normal development situation packages using libraries will only depend on functionality present in the libraries it uses at the time of release. Xpdf using poppler is the opposite. New releases of xpdf introduce functionality that the viewer depends on. Any version of xpdf using poppler will have to interact with versions of poppler that haven't yet incorporated this functionality. My point is that this problem is non-trivial to solve, and the Debian maintainers are already going above and beyond in producing a package that uses poppler. As far as I can see, the only people in a position to correctly maintain an xpdf version that works correctly with poppler is the poppler devs themselves. They care enough about the xpdf code base to fork it, perhaps they'll appreciate that trying to support packaging both xpdf and their code is hurting the former. Maybe this could be placed in a politely worded e-mail from a Debian maintainer. Lastly, despite the issues mentioned above I've also created a stripped down xpdf which doesn't replicate/extend the GlobalParams class. It stores xpdf-specific configuration variables in a new class, and only sets configuration variables from the parsed config file that can be accessed via the methods poppler's GlobalParams exposes [3]. This is primarily just so I can get a working version of xpdf on Ubunutu (and hence uses poppler 0.20) but I thought I might as well mention it. Francis [1] https://github.com/rbrito/xpdf-poppler [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=351279 [3] https://github.com/FrancisRussell/xpdf-lite
Information forwarded
to debian-bugs-dist@lists.debian.org, Michael Gilbert <mgilbert@debian.org>:
Bug#658264; Package xpdf.
(Sat, 16 Mar 2013 09:39:04 GMT) (full text, mbox, link).
Acknowledgement sent
to David Kastrup <dak@gnu.org>:
Extra info received and forwarded to list. Copy sent to Michael Gilbert <mgilbert@debian.org>.
(Sat, 16 Mar 2013 09:39:04 GMT) (full text, mbox, link).
Message #100 received at 658264@bugs.debian.org (full text, mbox, reply):
In order to avoid possible security problems due to separately maintained libpoppler and xpdf libraries, the approach chosen by Debian is to fantasize about the APIs not having seriously diverged and deliver a crashing binary. A proposed patch that would cater for the diverged APIs is rejected because of its size, the size being proportional to and catered to the difference in APIs. Dealing with a less than optimal situation by choosing to deal with an nicer imaginary situation instead and calling "Somebody Else's Problem" (TM) on the results of this discrepancy is not just ridiculous but rather lunatic. A really sad state of affairs. -- David Kastrup
Reply sent
to Michael Gilbert <mgilbert@debian.org>:
You have taken responsibility.
(Mon, 20 Jan 2014 04:21:05 GMT) (full text, mbox, link).
Notification sent
to Wolfram Gloger <bugzilla1@malloc.de>:
Bug acknowledged by developer.
(Mon, 20 Jan 2014 04:21:05 GMT) (full text, mbox, link).
Message #105 received at 658264-close@bugs.debian.org (full text, mbox, reply):
Source: xpdf
Source-Version: 3.03-12
We believe that the bug you reported is fixed in the latest version of
xpdf, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 658264@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Michael Gilbert <mgilbert@debian.org> (supplier of updated xpdf package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Mon, 20 Jan 2014 02:54:13 +0000
Source: xpdf
Binary: xpdf
Architecture: source amd64
Version: 3.03-12
Distribution: experimental
Urgency: low
Maintainer: Michael Gilbert <mgilbert@debian.org>
Changed-By: Michael Gilbert <mgilbert@debian.org>
Description:
xpdf - Portable Document Format (PDF) reader
Closes: 658264 679896 719224 725514 727070 728283
Changes:
xpdf (3.03-12) experimental; urgency=low
.
* Fix vcs-git url (closes: #728283).
* Support poppler 0.20 (closes: #679896).
* Support poppler 0.22 (closes: #719224).
* Drop binutils-gold conflict (closes: #725514).
* Separate xpdf-specific global parameters (closes: #658264, #727070).
- Thanks to Dmitry Shachnev!
Checksums-Sha1:
0d1d32adf3238f1dfe10498ff14ed06d3b48bdf0 2553 xpdf_3.03-12.dsc
6b7a377ebf861a02da7eeff7e1b369f32901bd03 36296 xpdf_3.03-12.debian.tar.xz
efa806481a96ee47d252703a58c606746c07c912 152570 xpdf_3.03-12_amd64.deb
Checksums-Sha256:
51f685eb602667c7f16ac9ba20b1edee72c96ad621e60b6665983de1c2acef85 2553 xpdf_3.03-12.dsc
41d570a3968229df381352855e9e16b879a983dae0efae80da04a857efeb45cb 36296 xpdf_3.03-12.debian.tar.xz
75454ccbac7831ef4e62c180079b2a33a56f205e265e26e41a1862393bf77a41 152570 xpdf_3.03-12_amd64.deb
Files:
0e020ca8e8dce6a356c85c0a45748741 2553 text optional xpdf_3.03-12.dsc
e2e8c171ef130c1aa4db87860b5f8aa3 36296 text optional xpdf_3.03-12.debian.tar.xz
da6d207db0639ee1734aada14b22dc5a 152570 text optional xpdf_3.03-12_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQQcBAEBCgAGBQJS3KKxAAoJELjWss0C1vRzMzQf/1+3AoRghBaRO47ASZOwuR5/
aUBQDItd901vE2IRnu/tPlhZIoGT7Pl+dBBLjH1X7mfKtjDGNFjwKwURGRlJlEr5
G1Pybx3eYchFCbZu++m2qhK2c58nZ6UGYY8yLmpQj5FfCqVcbPaZSY2xroyrxZ9q
NPLRwvODpFFpVWQ3QcVHsA8qiMaRz4BSPSGq5Wa4MCTXB2XeBtZNxCqeB8kyiENF
xsPYZkgXK+xlUS3ZwN0VkIDcEtT3jnR9fYxm8+lDCtoWPUbFFmH1TcLnrz+F8k6M
GVz0rnXa/5TvAK3+NHBpZx/Q/dkUOXoOohbI5RioWYowgyjhBFykCl/olwuH2zOq
De6VtVO8Nqqm9WN5iKvzCfy7u+2PKnBXb2MgIhFciuAiORa63fULkReDBBXyznB3
ka7uNJg02+cbgMErBgaELUn2aNvIJlbrWVzUw7uxs0wkmh+xOsK2jHtb+6HYXh3n
nv7+FgVVqNVrwj8mppyIwgpTfPrnTfaWGqkkIByRqtGI6GmtAckRHEK5C1cEhX5G
J5eMAC7LCr1iRVT6ildssgWp5AVI5BUs0My2qoUkRqMBTJ4BfCTBJGYqJmgIOb6s
R/mzhcsNg0HnNw2R8agLtUZhxF9p5WplwuUaqHxRltIunlPI4ifF7FP9HKHK5rOS
Qe/nOZeIU9B+XHQ1ZfCjjNDP7AmwU2UU2aaiQCdHsz9Lui1xjkXenkQEQh110LYV
GwTlKttDrZQkkj6ZStP0crHsZPtKtWXXoCRc/2qz/hVCp5zNFBDbLhYpU/VBWt7c
SvpebTxjYVvHWdISjgrlFXoAzRJkkYk32J6MeLQh/NFvFzNPxrWgW2B9N9MLX4DW
7w5TSblD+IP+fuXdVNLMvgFj+u0Kzy9tMP84Wd+zqORInLm+yXU0ur8VfANW4bw4
p2Ih1Xr8RFR4YE0/mMs4jmJ86A7bClqeWZ1u5SZzO+GJa0VacZat3pkbZ3Joyf0g
Yv2qnf2MzdE1LB/v7DGdFvxZclMQ/jppaJOFZm9+vDjqdDkg0Ri80of4nuUyh3wK
VFaH108idU0w35nVhSx4m6kBWamPHQC+sw6I/iMZSdqmtLwFg6cnM90L8mFaNX4m
9hLgmHXl7iv2cE2kUzMF9WkmOCqRP2GCzvC1h5oxs7M1VtiZbVvlcWhb6aC+QqqS
VERujBQuY+Iikahtl65QhmVgeqsEGxo4wfA8XNFQe6HNt41xOrExigGlyOaz4CAv
DoHP2lLUDh31LVRC2uy/BsQcGmqZNny6PLn+1N/XZzd4aIaSmIfYlX/wmkBjPJqQ
hU8VPUcnSEbzT+ib6A3s25RpnSBv8yECty5xiifH++oEWzuUdm/T6idMTlfPd9o=
=9W4g
-----END PGP SIGNATURE-----
Reply sent
to Michael Gilbert <mgilbert@debian.org>:
You have taken responsibility.
(Mon, 20 Jan 2014 04:21:05 GMT) (full text, mbox, link).
Notification sent
to Jens Stimpfle <debian@jstimpfle.de>:
Bug acknowledged by developer.
(Mon, 20 Jan 2014 04:21:05 GMT) (full text, mbox, link).
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Wed, 26 Feb 2014 07:32:48 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.