You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, with the Termux build the second printf stops after printing the literal %. The fact that it doesn't at least print the remaining \n makes the following line a comment, hence produces glitched files. (While the printf seems to always fail, not all glitched files makes pdfinfo spit errors.)
The pdftocairo trials are for reference. The job is done by cairo instead and it works fine with both builds:
prior to Android P (i.e. AOSP master), Android's printf didn't accept invalid UTF8 sequences in the format string, and so can't be used to print arbitrary bytes like this. you'd need to use %c%c%c%c -- as your other example does -- or (hilariously) %s (because only the format string is checked). this is from BSD code, so it's not just Android that has/had this limitation, so you may be able to get upstream to switch to the same %c%c%c%c workaround as your other example.
@enh That was what I have guessed thought it would be trickier (that it would be a bug that kicks in only in some occasions instead of a limitation). Can confirm everything you said with a simple program:
I happened to discover that
pdfunite
produces glitched pdf files and thought that it was an upstream poppler issue:https://bugs.freedesktop.org/show_bug.cgi?id=103873
But turns out the glitches are triggered by a
printf
that ONLY does not properly run on the Termux build:(https://cgit.freedesktop.org/poppler/poppler/tree/poppler/PDFDoc.cc)
As you can see, with the Termux build the second
printf
stops after printing the literal%
. The fact that it doesn't at least print the remaining\n
makes the following line a comment, hence produces glitched files. (While theprintf
seems to always fail, not all glitched files makespdfinfo
spit errors.)The
pdftocairo
trials are for reference. The job is done by cairo instead and it works fine with both builds:(https://cgit.freedesktop.org/cairo/tree/src/cairo-pdf-surface.c)
So, has anyone got any idea on why the printf hiccups?
The text was updated successfully, but these errors were encountered: