Summary: | Regression: seg faults staring with 1bc2a56f913ff1fa3f7af06000a4c6dd5c948afd | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Marcos H. Woehrmann <marcos.woehrmann> |
Component: | Regression | Assignee: | Ray Johnston <ray.johnston> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | robin.watts |
Priority: | P2 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | All | ||
Customer: | Word Size: | --- |
Description
Marcos H. Woehrmann
2013-01-14 08:20:11 UTC
Here's output from gdb: (gdb) run -dBATCH -dNOPAUSE -sOutputFile=test.psd -dMaxBitmap=10000 -sDEVICE=psdcmyk -dNumRenderingThreads=4 -r300 -sDEFAULTPAPERSIZE=letter /home/marcos/cluster/tests_private/comparefiles/Bug689422.pdf Starting program: /home/marcos/artifex/ghostpdl/gs/debugbin/gs -dBATCH -dNOPAUSE -sOutputFile=test.psd -dMaxBitmap=10000 -sDEVICE=psdcmyk -dNumRenderingThreads=4 -r300 -sDEFAULTPAPERSIZE=letter /home/marcos/cluster/tests_private/comparefiles/Bug689422.pdf [Thread debugging using libthread_db enabled] GPL Ghostscript GIT PRERELEASE 9.07 (2012-07-31) Copyright (C) 2012 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. [New Thread 0x7ffff208d700 (LWP 13287)] [Thread 0x7ffff208d700 (LWP 13287) exited] Processing pages 1 through 1. Page 1 [New Thread 0x7ffff208d700 (LWP 13288)] [Thread 0x7ffff208d700 (LWP 13288) exited] [New Thread 0x7ffff208d700 (LWP 13289)] [Thread 0x7ffff208d700 (LWP 13289) exited] [New Thread 0x7ffff208d700 (LWP 13290)] [Thread 0x7ffff208d700 (LWP 13290) exited] [New Thread 0x7ffff208d700 (LWP 13291)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff208d700 (LWP 13291)] 0x000000000052fce3 in gx_pattern_size_estimate (pinst=0x1931d5ae, has_tags=0) at ./base/gxpcmap.c:219 219 gx_device *tdev = pinst->saved->device; (gdb) where #0 0x000000000052fce3 in gx_pattern_size_estimate (pinst=0x1931d5ae, has_tags=0) at ./base/gxpcmap.c:219 #1 0x0000000000532c8a in gx_pattern_load (pdc=0x7ffff208a4d0, pis=0x7ffff2087310, dev=0x1b3e008, select=gs_color_select_texture) at ./base/gxpcmap.c:1310 #2 0x0000000000527988 in gx_dc_pattern_load (pdevc=0x7ffff208a4d0, pis=0x7ffff2087310, dev=0x1b3e008, select=gs_color_select_texture) at ./base/gsptype1.c:1259 #3 0x00000000006e5875 in clist_playback_band (playback_action=playback_action_render, cdev=0x1b340a8, s=0x7ffff208bf30, target=0x1b3e008, x0=0, y0=0, mem=0x1b8d590) at ./base/gxclrast.c:1789 #4 0x00000000006ee213 in clist_playback_file_bands (action=playback_action_render, crdev=0x1b340a8, page_info=0x7ffff208c7c8, target=0x1b381e8, band_first=0, band_last=0, x0=0, y0=0) at ./base/gxclread.c:856 #5 0x00000000006eddbc in clist_render_rectangle (cldev=0x1b340a8, prect=0x7ffff208cdb0, bdev=0x1b381e8, render_plane=0x0, clear=1) at ./base/gxclread.c:784 #6 0x000000000070dc59 in clist_render_thread (data=0x18e5800) at ./base/gxclthrd.c:407 #7 0x00000000007147dd in gp_thread_begin_wrapper (thread_data=0x1bb0a10) at ./base/gp_psync.c:223 #8 0x00007ffff64a39ca in start_thread (arg=<value optimized out>) at pthread_create.c:300 #9 0x00007ffff54d421d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112 #10 0x0000000000000000 in ?? () (gdb) This was due to the pdf14 device changing num_components during clist playback when it had not changed during writing the clist. When a pattern tried to load it failed the check that the depth of the pattern matched the depth of the device. This was traced to picking the pdf14cmyk device during rendering instead of the pdf14CMYKspot device because the thread's max_components was set to 4, not 14 (as during clist writing). Fix the MaxSeparations in gsdparam to return max_components instead of num_components, then fix devn_get_params to pass the PageSpotColors param and the setting of num_components in devn_put_params to ignore max_separations since that doesn't make sense. BTW, the reason that the 1bc2a56 patch caused the regression is that the ndev had its color_info set by the put_device_params and the max_separations was set to 4. When the original 'cdev->target' was used as the target device, the color_info.max_components was at 14, the value set by the parser, so that the pdf14 logic picked the correct prototype instance (pdf14CMYKspot). The above was committed in commit 37e07e95a5588c2feaba60bbf506a7a9e433a43c Testing of some of the problem files that previously failed worked. We will see with the next NumRenderingThreads regression run. |