Bug 692143 - Regression: lockup with -dNumRenderingThreads=4
Summary: Regression: lockup with -dNumRenderingThreads=4
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: master
Hardware: PC Linux
: P1 normal
Assignee: Ray Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-11 19:38 UTC by Marcos H. Woehrmann
Modified: 2011-07-18 16:47 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
list.txt (173.82 KB, text/plain)
2011-05-09 16:26 UTC, Marcos H. Woehrmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2011-04-11 19:38:30 UTC
Many of the nightly regression files lock up Ghostscript head (r12382) when run with -dNumRenderingThreads=4.  Here is one such example:

  bin/gs -o test.pgm -sDEVICE=pgmraw -dNumRenderingThreads=4 -r300 ./IA3Z4768.pdf

This is a regression, it started with r11306, the icc_work branch merge.
Comment 1 Marcos H. Woehrmann 2011-04-11 19:40:19 UTC
Note: I tested this with 32 bit and 64 bit versions of Ghostscript, both fail.  Changing NumRenderingThreads to 2 or reducing the resolution to 200 dpi causes the file to be processed correctly.
Comment 2 Marcos H. Woehrmann 2011-05-09 16:26:01 UTC
Created attachment 7497 [details]
list.txt

As of 2822d8a9f4186aa14f3913258841b74ff87309cf the files in the attached list still lookup.   

Here's an example command line:

./gs -o /dev/null -dMaxBitmap=10000 -sDEVICE=ppmraw -dNumRenderingThreads=4 -r300 ./big-multi-source.eps
Comment 3 Marcos H. Woehrmann 2011-05-09 16:35:37 UTC
This is probably not useful, but here is -ZA output for the command given in Comment 2:

.
.
.
[a-]gs_free(destroy_buf_device) 0x2144370(2936)
[a+]gs_malloc(create_buf_device)(2936) = 0x2144370: OK, used=26372717, max=27822829
[a+]gs_malloc(setup_buf_device)(8) = 0x1fbb9d0: OK, used=26372773, max=27822829
[a-]gs_free(mem_close) 0x1fbb9d0(8)
[a-]gs_free(destroy_buf_device) 0x2144370(2936)
[a+]gs_malloc(create_buf_device)(2936) = 0x2144370: OK, used=26372717, max=27822829
[a+]gs_malloc(setup_buf_device)(8) = 0x1fbb9d0: OK, used=26372773, max=27822829
[a-]gs_free(mem_close) 0x1fbb9d0(8)
[a-]gs_free(destroy_buf_device) 0x2144370(2936)
[a+]gs_malloc(create_buf_device)(2936) = 0x2144370: OK, used=26372717, max=27822829
[a+]gs_malloc(setup_buf_device)(8) = 0x1fbb9d0: OK, used=26372773, max=27822829
[a-]gs_free(mem_close) 0x1fbb9d0(8)
[a-]gs_free(destroy_buf_device) 0x2144370(2936)
[a+]gs_malloc(create_buf_device)(2936) = 0x2144370: OK, used=26372717, max=27822829
[a+]gs_malloc(setup_buf_device)(8) = 0x1fbb9d0: OK, used=26372773, max=27822829
[a-]gs_free(mem_close) 0x1fbb9d0(8)
[a-]gs_free(destroy_buf_device) 0x2144370(2936)
[a+]gs_malloc(create_buf_device)(2936) = 0x2144370: OK, used=26372717, max=27822829
[a+]gs_malloc(setup_buf_device)(8) = 0x1fbb9d0: OK, used=26372773, max=27822829
[a-]gs_free(mem_close) 0x1fbb9d0(8)
[a-]gs_free(destroy_buf_device) 0x2144370(2936)
[a+]gs_malloc(create_buf_device)(2936) = 0x2144370: OK, used=26372717, max=27822829
[a+]gs_malloc(setup_buf_device)(8) = 0x1fbb9d0: OK, used=26372773, max=27822829
[a-]gs_free(mem_close) 0x1fbb9d0(8)
[a-]gs_free(destroy_buf_device) 0x2144370(2936)
[a+]gs_malloc(create_buf_device)(2936) = 0x2144370: OK, used=26372717, max=27822829
[a+]gs_malloc(setup_buf_device)(8) = 0x1fbb9d0: OK, used=26372773, max=27822829
[a-]gs_free(mem_close) 0x1fbb9d0(8)
[a-]gs_free(destroy_buf_device) 0x2144370(2936)
[a+]gs_malloc(create_buf_device)(2936) = 0x2144370: OK, used=26372717, max=27822829
[a+]gs_malloc(setup_buf_device)(8) = 0x1fbb9d0: OK, used=26372773, max=27822829
[a-]gs_free(mem_close) 0x1fbb9d0(8)
[a-]gs_free(destroy_buf_device) 0x2144370(2936)
[a+]gs_malloc(create_buf_device)(2936) = 0x2144370: OK, used=26372717, max=27822829
[a+]gs_malloc(setup_buf_device)(8) = 0x1fbb9d0: OK, used=26372773, max=27822829
[a-]gs_free(mem_close) 0x1fbb9d0(8)
[a-]gs_free(destroy_buf_device) 0x2144370(2936)
[a+]gs_malloc(create_buf_device)(2936) = 0x2144370: OK, used=26372717, max=27822829
[a+]gs_malloc(setup_buf_device)(8) = 0x1fbb9d0: OK, used=26372773, max=27822829
[a-]gs_free(mem_close) 0x1fbb9d0(8)
[a-]gs_free(destroy_buf_device) 0x2144370(2936)

At this point gs lockups.

Running under gdb here is the stacktrace:

(gdb) where
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x0000000000778777 in gp_semaphore_wait (sema=0x1e0e070) at ./base/gp_psync.c:98
#2  0x00000000007723b8 in clist_get_band_from_thread (dev=0x1b24ae8, band_needed=7) at ./base/gxclthrd.c:460
#3  0x0000000000772793 in clist_get_bits_rect_mt (dev=0x1b24ae8, prect=0x7fffffffca20, params=0x7fffffffc900, unread=0x0) at ./base/gxclthrd.c:543
#4  0x0000000000a4691a in gx_default_get_bits (dev=0x1b24ae8, y=3192, data=0x1d80648 "", actual_data=0x7fffffffcaf0) at ./base/gdevdgbr.c:52
#5  0x0000000000748849 in gdev_prn_get_bits (pdev=0x1b24ae8, y=3192, str=0x1d80648 "", actual_data=0x7fffffffcaf0) at ./base/gdevprn.c:1228
#6  0x000000000082d630 in pbm_print_page_loop (pdev=0x1b24ae8, magic=54 '6', pstream=0x1c407a0, row_proc=0x82cff9 <nop_row_proc>) at ./base/gdevpbm.c:721
#7  0x000000000082e0d5 in ppm_print_page (pdev=0x1b24ae8, pstream=0x1c407a0) at ./base/gdevpbm.c:974
#8  0x0000000000747a4e in gx_default_print_page_copies (pdev=0x1b24ae8, prn_stream=0x1c407a0, num_copies=1) at ./base/gdevprn.c:836
#9  0x00000000007477ad in gdev_prn_output_page (pdev=0x1b24ae8, num_copies=1, flush=1) at ./base/gdevprn.c:772
#10 0x000000000082c091 in ppm_output_page (pdev=0x1b24ae8, num_copies=1, flush=1) at ./base/gdevpbm.c:276
#11 0x00000000009ab2cd in gs_output_page (pgs=0x1abbfa8, num_copies=1, flush=1) at ./base/gsdevice.c:147
#12 0x000000000056f865 in zoutputpage (i_ctx_p=0x1ad8180) at ./psi/zdevice.c:355
#13 0x0000000000526bb5 in call_operator (op_proc=0x56f777 <zoutputpage>, i_ctx_p=0x1ad8180) at ./psi/interp.c:94
#14 0x0000000000528fab in interp (pi_ctx_p=0x1a99388, pref=0x7fffffffdc20, perror_object=0x7fffffffdd20) at ./psi/interp.c:1150
#15 0x00000000005272fa in gs_call_interp (pi_ctx_p=0x1a99388, pref=0x7fffffffdc20, user_errors=1, pexit_code=0x7fffffffdd3c, perror_object=0x7fffffffdd20)
    at ./psi/interp.c:484
#16 0x0000000000527116 in gs_interpret (pi_ctx_p=0x1a99388, pref=0x7fffffffdc20, user_errors=1, pexit_code=0x7fffffffdd3c, perror_object=0x7fffffffdd20)
    at ./psi/interp.c:442
#17 0x000000000051a6e5 in gs_main_interpret (minst=0x1a992f0, pref=0x7fffffffdc20, user_errors=1, pexit_code=0x7fffffffdd3c, perror_object=0x7fffffffdd20)
    at ./psi/imain.c:239
#18 0x000000000051b33b in gs_main_run_string_end (minst=0x1a992f0, user_errors=1, pexit_code=0x7fffffffdd3c, perror_object=0x7fffffffdd20) at ./psi/imain.c:555
#19 0x000000000051b1ec in gs_main_run_string_with_length (minst=0x1a992f0, 
    str=0x1b2aa10 "<2f686f6d652f6d6172636f732f617274696665782f74657374732f6570732f6269672d6d756c74692d736f757263652e657073>.runfile", length=112, user_errors=1, 
    pexit_code=0x7fffffffdd3c, perror_object=0x7fffffffdd20) at ./psi/imain.c:513
#20 0x000000000051b151 in gs_main_run_string (minst=0x1a992f0, 
    str=0x1b2aa10 "<2f686f6d652f6d6172636f732f617274696665782f74657374732f6570732f6269672d6d756c74692d736f757263652e657073>.runfile", user_errors=1, 
    pexit_code=0x7fffffffdd3c, perror_object=0x7fffffffdd20) at ./psi/imain.c:495
#21 0x000000000051e44c in run_string (minst=0x1a992f0, 
    str=0x1b2aa10 "<2f686f6d652f6d6172636f732f617274696665782f74657374732f6570732f6269672d6d756c74692d736f757263652e657073>.runfile", options=3)
    at ./psi/imainarg.c:816
#22 0x000000000051e3f1 in runarg (minst=0x1a992f0, pre=0xa808bb "", arg=0x1adfff0 "/home/marcos/artifex/tests/eps/big-multi-source.eps", post=0xa809bd ".runfile", 
    options=3) at ./psi/imainarg.c:807
#23 0x000000000051e056 in argproc (minst=0x1a992f0, arg=0x7fffffffec74 "/home/marcos/artifex/tests/eps/big-multi-source.eps") at ./psi/imainarg.c:740
#24 0x000000000051c81d in gs_main_init_with_args (minst=0x1a992f0, argc=9, argv=0x7fffffffe958) at ./psi/imainarg.c:215
#25 0x00000000004663c3 in main (argc=9, argv=0x7fffffffe958) at ./psi/gs.c:94
(gdb)
Comment 4 Michael Vrhel 2011-05-19 04:11:58 UTC
This should be retested since the commit of http://tinyurl.com/67g888h
Comment 5 Marcos H. Woehrmann 2011-06-11 17:14:00 UTC
This appears to have been fixed as of at least f256d925aba7bd2c552e3598b5782bc3ab09cf4f.
Comment 6 Ray Johnston 2011-07-18 16:47:12 UTC
Actually, the more likely commit was:

commit 79e14a10307ba37bcf00af1b05c1c52875d9774a

Closing, in any case, as FIXED.