| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
A character array was accessed incorrectly and we now include a
complete dump of downloaded fonts with the font debugging option '='.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At various places in the code, we test for parameters from a
param_list by using:
if (!strncmp(param, "ParamValue", strlen("ParamValue"))
This is bad, because as well as matching "ParamValue" and
"ParamValue=", it will also match "ParamValueSomething".
Also, at various places in the code, we don't call strlen
(understandably, cos that's a runtime function call to retrieve
a constant value), and just wire in the constant value. But
in at least 1 location, we've got the constant value wrong.
Accordingly, move to using an 'argis' macro that tests correctly
and calculates the length at compile time.
|
|
|
|
|
|
|
| |
Only stop passing params to languages on an error, not on
a non-zero return code.
This was causing arguments not to make it to SO for processing.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main code issue with this bug was that the banner printed on startup is
printed from Postscript, and Postscript's cvs operator doesn't allow for
dictating the number of digits it outputs so the number 00 will always end up as
the string "0", or 01 as "1". So our 10.01.0 version would be printed as
"10.1.0".
To address this, as a ".revisionstring" entry to systemdict, created during
startup, the string is created in C, so we control the format.
The remaining issues need to be address as part of the release process.
|
|
|
|
| |
This is seen when we exit an instance with an error.
|
|
|
|
|
| |
Missing fonts is a fatal error, and we were ignoring the error from
pcl_do_resets() due to "missing" fonts (i.e. non-romfs configs not supported).
|
|
|
|
|
| |
I missed a rename of gp_wutf8.c to gp_utf8.c in one of the many
makefiles.
|
|
|
|
|
|
| |
Promote previously windows specific functions to be
generically available (and give them names that
reflect that).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This started as a customer request, where the customer wanted to
store a file in the ROM file system with a bunch of command line
parameters in it, and then use the @file syntax to run that file
and setup the interpreter. In essence a 'canned' setup stored in
the ROM file system.
That didn't work, at all, because of a dichotomy in the logic of
argument processing. The code used 'lib_file_open' in order to find
the file using the search path which, on Ghostscript, includes all
the iodevices, Rom file system, RAM file system etc.
That function returns a stream which the calling function 'lib_fopen'
would then reach inside and pull out the pointer to the underlying
gp__file *, and return, because the argument processing was written
to use a gp_file *, not a stream *.
But.... For the ROM file system, what we store in the 'file' member
of the stream is not a gp_file *, its a 'node' *. Trying to use that
as a gp_file * rapidly leads to a seg fault.
So this commit reworks the argument processing to use a stream *
instead of a gp_file *. In reality there is no real difference to the
logic we simply use a different call. There are a lot of fiddly
references to change unfortunately.
There are some consequences; we need to pass stream * around instead of
gp_file *, and in particular the 'encoding' functions, which are
OS-specific need to use a stream *. This isn't a problem for the
interpreters and graphics library, but mkromfs *also* uses those
OS-specific files, and it does not have the stream library available.
Rather than trying to include it, we note that we don't actually need
to use these functions for mkromfs and we do the same hackery as for
other missing functionality; we define a stub function that does nothing
but will permit the compile to complete.
|
|
|
|
|
|
|
| |
Spots ascii/utf8/utf16 and feeds to PCL interpreter.
May need further tweaking with both text file spotting and
font selection, but it's a decent start.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Originally, the FAPI code held a buffer of the full font data, for the duration
of the life of the font object.
Given that the entire font set is memory resident, three times over, for the
life of the interpreter(s), that ends up holding quite a lot of memory.
This changes it so it uses the font data read directly from the romfs (rather
than read into a persistent memory buffer). To maintain performance, we now
store the PCL fonts uncompressed in the romfs. This grows the binary from
25Mb to 29Mb.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The text extraction (and pdfwrite family) expect that decode_glyph
should always return pairs of bytes (an assumption that Unicode code
points are 2 bytes), and the return value from the routine should be
the number of bytes required to hold the value.
The PCL decode_glyph routine however was simply returning 1, which
caused the text extraction code some difficulty since it wasn't
expecting that.
This commit firstly alters the text extraction code to cope 'better'
with a decode_glyph routine which returns an odd value (basically
ignore it and fall back to using the character code).
We also alter the pl_decode_glyph routine to return 2 instead of 1,
so that it correctly tells the caller that it is returning 2 bytes.
Finally we make sure that the returned value is big-endian, because the
text extraction code assumes it will be.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In commit 90fa745b7 (Add gpdl support for SmartOffice integration),
I tweaked the way we found the PCL interpreter, so that instead of
relying on it being at a fixed point in the list of interpreters,
we hunted for it by name.
And then I used the wrong name.
Use the right name instead.
I am at a loss to understand why the normal cluster tests didn't
pick this up.
|
|
|
|
|
| |
No actual SmartOffice code here, just the framework for adding
the (private) "SO" interpreter.
|
|
|
|
|
| |
Postscript jobs require NOPAUSE in the dict, not just in the
main instance.
|
|
|
|
|
| |
Previously, I changed the wrong macro invocation, this puts that back, and
changes the correct instance to new macro.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Since we've already checked the font and macro ID types are string, coverity
spots that the type checks in the ID accessor macros are redundant.
So, add accessors for when we already know the ID is a string ID.
Secondly, tidy up macro naming, so it's not so easily confused with a variable
or constant value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In PDF, only symbolic Truetype fonts draw marks from the glyph at GID zero
(the TTF notdef). But the default TTF notdef is an empty rectangle, rather than
the Postscript style non-marking glyph.
The FAPI/Freetype incremental interface integration includes code to spot that
case, and return an empty glyph.
Since PDFs don't do incremental font definitions, the pdfi code simply passed
the TTF into FAPI, and onto Freetype as a complete font, so all the glyph
lookups were handled inside Freetype, not using the incremental interface.
Thus we lost the ability to do that "filtering".
Equally, we don't want to take the time to break down the font and "reassemble"
it as the Postscript interpreter is forced to do.
This implements a hybrid approach where we still pass the font data unchanged
into Freetype, but we still use the incremental interface, allowing that
notdef filtering to happen.
This commit affects a heuristic in freetype which autmatically enables
autohinting, meaning we'll no longer get autohinting in cases where we
previously did. That gives a perceived drop in quality at low resolutions.
Since autohinting can be enabled at the command line, it's not a serious
concern.
|
| |
|
|
|
|
| |
Don't let <i> decrement below zero.
|
|
|
|
|
|
|
|
|
|
| |
Ghostscript has "-dNODISPLAY" which is a shortcut option for:
"-sDEVICE=nullpage -dBATCH -dNOPAUSE"
add support for that to the "pl" layer, so other languages handle it, too.
Prompted by the fix for bug 705075.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This wasn't working, possibly due to device changes, more likely
due to insufficient testing when it was first written.
We fix it here, and change the way we handle post render color
conversion.
We were using ICC before in the case when we had a PostRenderProfile,
but not otherwise. If no PostRenderProfile is specifically set, we
now stash the device profile before we change our colormodel, and
use that as the target for our post render conversion.
This has required a new downscaler helper function to make an
icc link from a given profile.
This means that we now only really support contone operation (as
doing ICC conversions from pre-dithered results will not look
good). If we want to support dithered output, then we'll really
need to do the dithering as part of the conversion from contone
rendered RGB, as otherwise it'll look really bad.
|
|
|
|
|
|
|
|
| |
Because args.pv[1] is non-zero, and all the rest are zero,
pxSetHalftoneMethod won't access args.source, but Coverity can't
see this.
For clarity, we update the init of args to clear the whole lot.
|
|
|
|
| |
Certainly shouldn't hurt, and may genuinely be a bug.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the stack based halftone, we want to set the reference counting data to
zeros/NULLs - in this case, it is later copied into an actually reference
counted, heap allocated object.
Equivalent to 6849cc4774817a2afa2e6f4d77c1aa63e432352f in pdf/
Coverity 375605: Init ref counting entry for gs_halftone
For the stack based halftone, we want to set the reference counting data to
zeros/NULLs - in this case, it is later copied into an actually reference
counted, heap allocated object.
|
| |
|
|
|
|
|
| |
In the case where it matters, we wouldn't hit it without being initialised,
but Coverity can't know that, and the cost to initialise it is tiny.
|
| |
|
|
|
|
|
|
|
| |
A PCL stream that does not complete the macro operation, can lead
to memory leaks. This was spotted due to a problem where catting
files in on Windows was failing to treat them as binary files,
resulting in them being truncated at the first Ctrl-Z char.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running a windows memento, 32bit build of:
gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -dMaxBitmap=1000 -r300
-o gpcl6.out ../tests_private/pcl/pcl5cats/*.BIN
we'd see leaks from pl_bitmap_build_char. I could not reproduce
these when running individual files.
A desk-check of the code spotted that penum would not be freed if
a particular error path was taken. Fixing that (as here), removes
the leaks.
|
|
|
|
|
|
|
|
|
|
|
| |
pcl_impl_process_eof(): free pcli->pst.args.data before calling process_init().
Also removed pcl_parser_init_inline() macro and replaced with explicit code in
the single call site in pcl_process_init().
Fixes:
ghostpdl/mem-extract-bin/gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -dMaxBitmap=1000 -r300 -o gpcl6.out tests_private/customer_tests/bug693543.pcl
|
|
|
|
|
|
|
|
| |
We need to free char_data if we return e_Range.
Fixes 1 leaked block in:
ghostpdl/mem-extract-bin/gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -dMaxBitmap=1000 -r300 -o gpcl6.out tests_private/customer_tests/HUD_noescnew.pcl
|
|
|
|
|
|
|
|
| |
Added a call to pcl_pattern_free_pattern() with pcli->pcs.punsolid_pattern.
Fixes 114 leaked blocks with:
ghostpdl/mem-extract-bin/gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -dMaxBitmap=1000 -r300 -o gpcl6.out tests_private/customer_tests/bug689453.pcl
|
|
|
|
|
|
|
| |
Seen with:
gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -dMaxBitmap=1000 -r300
-o gpcl6.out ../tests_private/pcl/pcl5cfts/fts.2410
|
|
|
|
|
|
|
| |
See when running:
membin/gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -dMaxBitmap=1000 -r300
-o gpcl6.out /home/regression/cluster/tests_private/pcl/pcl5cfts/fts.1100
|
|
|
|
|
| |
We were not clearing the bi_pattern_array, which caused lots of
state to be retained.
|
|
|
|
|
|
|
|
| |
Added a call to gx_pattern_cache_free().
Fixes 3 Memento leaks (out of 116) in:
./ghostpdl/mem-extract-bin/gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -dMaxBitmap=1000 -r300 -o gpcl6.out tests_private/customer_tests/bug692970.pcl
|
|
|
|
|
|
|
|
|
| |
In pcl_impl_deallocate_interp_instance(), call pl_dict_release() with
&pcli->pcs.gl_patterns and &pcs.pcl_patterns.
Fixes Memento leak in:
./ghostpdl/mem-extract-bin/gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -dMaxBitmap=1000 -r300 -o gpcl6.out tests_private/customer_tests/bug690756.pcl
|
|
|
|
|
| |
Move a global to the pjl state. The global is initialised when
the pjl state is allocated, so the lifespans match.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gpcl6 --debug=epo-disable -sOutputFile=out%04d.tif -dTIFFDateTime=false
-dMaxBitmap=400000000 -sDEVICE=tiffsep1 -r72 -Z: -dNOPAUSE -dBATCH
-K2000000 -dClusterJob ../perf-testing-gpdl/pcl/j9_acrobat.pcl
was crashing. This is because pxBeginPage was putting a parameter into
the device which was causing it to close. The device was then not being
opened again before it was being used.
The fix is simply to make the code reopen the device after all the
put_paramming has completed.
|
|
|
|
|
|
|
|
|
| |
E.g. avoids Memento leak in:
./ghostpdl/mem-extract-bin/gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -o gpcl6.out ghostpdl/pcl/examples/fills.pcl
Also added added comments to encourage frgrnd_do_reset() and
pcl_free_default_objects() to be kept in step with each other.
|
|
|
|
|
|
|
|
|
| |
When a memento build of gpcl6 is run with no arguments, we can
see that memory leaks. Here we fix some of those.
Firstly, free the font directory.
Secondly, free the paper type table.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A memento build of pcl, run with no arguments shows significant
leakage. Part of this is due to a graphics state leaking from the
PCL interpreter.
This appears to be because of unexpected (to me at least!) behaviour
with gsave/grestore. If we make a graphics state, and then gsave,
we might reasonably expect grestore to leave us back in the newly
created state.
This is not the case; when grestore restores, if it would leave us
back at the 'topmost' gstate, it does an extra gsave. This is
believed to be to do with coping with Postscript files that have
more grestores than gsaves.
Accordingly, we work around it here by doing an extra gs_gsave at
the start, and an extra gs_restore_only at the end.
This solves at least some of the leaks.
|
|
|
|
|
| |
Means extending the pdf_detect_language() to check the first five (rather than
two) bytes in the input.
|
|
|
|
|
|
|
| |
Many Quality Logic tests were failing because the graphics state color
space and pattern color space did not match triggering an error in
the Artifex interpreter. We believe this did cause an error in
earlier HP models but now it does not, so the error has been removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
plmain.c should not be setting the PageSpotColors
value. This should be set by the individual
interpreters on a per page basis. This change
fixes a crash (Bug 704660) reduces the number of
closing and opening times of the device with pdfi
and pdfi renders more than 4 spots to the separation
devices just fine. Also for gpdl with HEAD, the subsequent
execution of a PS file following a PCL file
did not properly reset the PageSpotColors to -1
as is required for PS files, resulting in improper
output when going to a separation device. This commit
includes a fix for that. Tested with command line
gpdl -sDEVICE=psdcmyk -r72 -o ./myoutputs/pdl_input_%d.psd
./myinputs/owl.pcl ./myinputs/Ad_InDesign.ps
./myinputs/spots_multi_page.pdf ./myinputs/input.xps
./myinputs/deviceNImage.eps ./myinputs/DeviceN_20Colors.pdf
./myinputs/page_spots/Ad_InDesign.ps
to verify that the number of spots was getting properly
set with each interpreter and page (when applicable) change.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some devices within Ghostscript (currently the x11 devices,
uniprint and opvp/oprp) use non const static variables, so cannot
be run in multiple instances at a time.
We now maintain a core "count" of how many non-threadsafe devices are
being used at any time. This value can be atomically adjusted by calls
to gs_lib_ctx_nts_adjust.
Non threadsafe devices now call gx_init_non_threadsafe_device either
as or as part of their initialise_device proc. This function attempts
to increment the non-threadsafe count and fails to init if there is
already a non-threadsafe device running.
On success, the device finalize method is modified so that it will
decrement the count at the end.
The known non-threadsafe devices are updated to call this.
In order to have somewhere safe to store this count, we introduce
a gs_globals structure, shared between instances. Setting this up
without race conditions requires some new gp_ functions that can
make use of platform specific threading primitives. We have these
implemented for both windows and pthread based platforms. On other
platforms, we drop back to the old unsafe mechanism for counting
instances.
While we do this work, we take the opportunity to push the
gs_memory_t pointer used for non-threadsafe debug printing into thread
local storage.
This enables us to remove the remaining GS_THREADSAFE guarded
compilation from the source code. What is left is broadly down to
allowing debugging collection for statistics, and these are now
controlled by specific COLLECT_STATS_XXX defines. It is assumed
that anyone wanting to collect such stats is smart enough to not
try to do so while using Ghostscript in a multi-instance environment.
|