Bug 690638 - Regression: Indeterministic lockup on x86_64 with -m32
Summary: Regression: Indeterministic lockup on x86_64 with -m32
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: master
Hardware: Macintosh MacOS X
: P4 normal
Assignee: Ray Johnston
URL:
Keywords: bountiable
Depends on:
Blocks: 690650
  Show dependency tree
 
Reported: 2009-07-19 07:32 UTC by Marcos H. Woehrmann
Modified: 2010-01-09 14:11 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2009-07-19 07:32:36 UTC
I've been experimenting with differences in output on the various artifex computers and have 
discovered an indeterministic lockup when compiling ghostscript with -m32 on a x86_64 machine.  

The most reproducible combination of machine, file, and command line I've been able to find is on 
Alex's i7a machine where this command line locks up about 10% of the time:

/home/marcos/nightly_32/gs/bin/gs -sOutputFile=176-01.ps.ppmraw.300.1 -dMaxBitmap=10000 -
sDEVICE=ppmraw -r300 -q -dNOPAUSE -dBATCH -K1000000 -dNOOUTERSAVE -dJOBSERVER -c false 
0 startjob pop -f - < /home/marcos/nightly_32/testfiles/176-01.ps

Note that configure is run with --disable-cups and then the Makefile is modified by adding -m32 to 
CC=gcc (i.e. "CC=gcc -m32").
Comment 1 Marcos H. Woehrmann 2009-07-19 07:38:49 UTC
The good news is that this is reproducible with 'make debug' and when run under gdb.

The problem appears to be in the command list code (which is reasonable, since all the occurrences of 
the lockup that I've recorded have been with banding turned on).

(gdb) where
#0  0x0822a32c in clist_playback_band (playback_action=playback_action_render, cdev=0xa29e16c, 
s=0xfff7e544, target=0xa397c14, x0=0, y0=0, mem=0xa24c434) at ./base/gxclrast.c:1658
#1  0x08231a98 in clist_playback_file_bands (action=playback_action_render, crdev=0xa29e16c, 
page_info=0xfff7edf0, target=0xa397c14, band_first=0, band_last=0, x0=0, y0=0) at 
./base/gxclread.c:698
#2  0x08231727 in clist_render_rectangle (cldev=0xa29e16c, prect=0xfff7f220, bdev=0xa397c14, 
render_plane=0xfff7f358, clear=1) at ./base/gxclread.c:627
#3  0x08231451 in clist_rasterize_lines (dev=0xa29e16c, y=0, line_count=1, bdev=0xa397c14, 
render_plane=0xfff7f358, pmy=0xfff7f354) at ./base/gxclread.c:539
#4  0x08230f1e in clist_get_bits_rectangle (dev=0xa29e16c, prect=0xfff7f5c0, params=0xfff7f530, 
unread=0x0) at ./base/gxclread.c:430
#5  0x08247430 in clist_get_bits_rect_mt (dev=0xa29e16c, prect=0xfff7f5c0, params=0xfff7f530, 
unread=0x0) at ./base/gxclthrd.c:472
#6  0x08474448 in gx_default_get_bits (dev=0xa29e16c, y=0, data=0xa28b1d4 "?\003?
\a\200\a\200\a\200\017", actual_data=0xfff7f65c) at ./base/gdevdgbr.c:51
#7  0x08221049 in gdev_prn_get_bits (pdev=0xa29e16c, y=0, str=0xa28b1d4 "?\003?
\a\200\a\200\a\200\017", actual_data=0xfff7f65c) at ./base/gdevprn.c:1225
#8  0x082ab905 in pbm_print_page_loop (pdev=0xa29e16c, magic=54 '6', pstream=0xa379c70, 
row_proc=0x82ac2e1 <ppm_print_row>) at ./base/gdevpbm.c:701
#9  0x082ac394 in ppm_print_page (pdev=0xa29e16c, pstream=0xa379c70) at ./base/gdevpbm.c:953
#10 0x082203cb in gx_default_print_page_copies (pdev=0xa29e16c, prn_stream=0xa379c70, 
num_copies=1) at ./base/gdevprn.c:834
#11 0x08220111 in gdev_prn_output_page (pdev=0xa29e16c, num_copies=1, flush=1) at 
./base/gdevprn.c:769
#12 0x082aa73a in ppm_output_page (pdev=0xa29e16c, num_copies=1, flush=1) at 
./base/gdevpbm.c:275
#13 0x083f12af in gs_output_page (pgs=0xa262e04, num_copies=1, flush=1) at 
./base/gsdevice.c:134
#14 0x08132351 in zoutputpage (i_ctx_p=0xa2735dc) at ./psi/zdevice.c:354
#15 0x080edc95 in call_operator (op_proc=0x8132265 <zoutputpage>, i_ctx_p=0xa2735dc) at 
./psi/interp.c:111
#16 0x080f10a7 in interp (pi_ctx_p=0xa24b1a4, pref=0xfff7ff80, perror_object=0xfff80008) at 
./psi/interp.c:1538
#17 0x080ee310 in gs_call_interp (pi_ctx_p=0xa24b1a4, pref=0xfff7ff80, user_errors=1, 
pexit_code=0xfff80010, perror_object=0xfff80008) at ./psi/interp.c:496
#18 0x080ee18a in gs_interpret (pi_ctx_p=0xa24b1a4, pref=0xfff7ff80, user_errors=1, 
pexit_code=0xfff80010, perror_object=0xfff80008) at ./psi/interp.c:454
#19 0x080e2a03 in gs_main_interpret (minst=0xa24b150, pref=0xfff7ff80, user_errors=1, 
pexit_code=0xfff80010, perror_object=0xfff80008) at ./psi/imain.c:214
#20 0x080e34ca in gs_main_run_string_end (minst=0xa24b150, user_errors=1, 
pexit_code=0xfff80010, perror_object=0xfff80008) at ./psi/imain.c:526
#21 0x080e339f in gs_main_run_string_with_length (minst=0xa24b150, str=0x84a548e ".runstdin", 
length=9, user_errors=1, pexit_code=0xfff80010, perror_object=0xfff80008) at ./psi/imain.c:484
#22 0x080e3307 in gs_main_run_string (minst=0xa24b150, str=0x84a548e ".runstdin", 
user_errors=1, pexit_code=0xfff80010, perror_object=0xfff80008) at ./psi/imain.c:466
#23 0x080e5f19 in run_string (minst=0xa24b150, str=0x84a548e ".runstdin", options=2) at 
./psi/imainarg.c:798
#24 0x080e4907 in swproc (minst=0xa24b150, arg=0xfff828dd "REMOTEHOST=gate", 
pal=0xfff80448) at ./psi/imainarg.c:267
#25 0x080e46cf in gs_main_init_with_args (minst=0xa24b150, argc=18, argv=0xfff80e24) at 
./psi/imainarg.c:200
#26 0x0804a6d4 in main (argc=18, argv=0xfff80e24) at ./psi/gs.c:77
(gdb) list
Comment 2 Marcos H. Woehrmann 2009-07-19 08:17:48 UTC
I've been able to reproduce this problem with gs8.64 and head (r9862).
Comment 3 Ray Johnston 2009-07-19 13:18:14 UTC
I built this on peeves (also a 64-bit ubuntu) in 32-bit debug mode and cannot
reproduce it _unless_ I redirect stdout and stderr to /dev/null (at least I
tried 50 times under gdb, but it failed after 3 times with stdout/stderr is
redirected.

The "hang" is a loop where the 'read' (calling gx_dc_pattern_read) is called
with a 'size' of 0, so the pattern tile read never makes any progress. Note
that the 'offset' is only 4085 so there still should be room in the buffer.
Comment 4 Marcos H. Woehrmann 2009-08-05 19:02:59 UTC
It's probably not helpful, but I found a test case with a simpler command line:

debugobj/gs -sDEVICE=pgmraw -o test.pgm -r300 ./pattrans_big.pdf

It appears to be the same problem:

(gdb) where
#0  0x08249be3 in clist_playback_band (playback_action=playback_action_render,
cdev=0x93723fc, s=0xffe411c8, target=0x9360e04, x0=0, y0=0, 
    mem=0x9320444) at ./base/gxclrast.c:1659
#1  0x082519ba in clist_playback_file_bands (action=playback_action_render,
crdev=0x93723fc, page_info=0xffe41808, target=0x9381adc, 
    band_first=0, band_last=0, x0=0, y0=0) at ./base/gxclread.c:698
#2  0x082515b9 in clist_render_rectangle (cldev=0x93723fc, prect=0xffe41ce0,
bdev=0x9381adc, render_plane=0xffe41e24, clear=1)
    at ./base/gxclread.c:627
#3  0x08251234 in clist_rasterize_lines (dev=0x93723fc, y=0, line_count=1,
bdev=0x9381adc, render_plane=0xffe41e24, pmy=0xffe41e40)
    at ./base/gxclread.c:539
#4  0x08250d01 in clist_get_bits_rectangle (dev=0x93723fc, prect=0xffe42080,
params=0xffe41ff0, unread=0x0) at ./base/gxclread.c:430
#5  0x082682ab in clist_get_bits_rect_mt (dev=0x93723fc, prect=0xffe42080,
params=0xffe41ff0, unread=0x0) at ./base/gxclthrd.c:472
#6  0x084ba9e0 in gx_default_get_bits (dev=0x93723fc, y=0, data=0x9330ad8 "",
actual_data=0xffe4211c) at ./base/gdevdgbr.c:51
#7  0x0824013b in gdev_prn_get_bits (pdev=0x93723fc, y=0, str=0x9330ad8 "",
actual_data=0xffe4211c) at ./base/gdevprn.c:1225
#8  0x082d2f83 in pbm_print_page_loop (pdev=0x93723fc, magic=53 '5',
pstream=0x93b6840, row_proc=0x82d31b9 <pgm_print_row>)
    at ./base/gdevpbm.c:701
#9  0x082d35e8 in pgm_print_page (pdev=0x93723fc, pstream=0x93b6840) at
./base/gdevpbm.c:852
#10 0x0823f41d in gx_default_print_page_copies (pdev=0x93723fc,
prn_stream=0x93b6840, num_copies=1) at ./base/gdevprn.c:834
#11 0x0823f163 in gdev_prn_output_page (pdev=0x93723fc, num_copies=1, flush=1)
at ./base/gdevprn.c:769
#12 0x082d1a56 in ppm_output_page (pdev=0x93723fc, num_copies=1, flush=1) at
./base/gdevpbm.c:275
#13 0x084bdfe2 in gx_forward_output_page (dev=0x93600ac, num_copies=1, flush=1)
at ./base/gdevnfwd.c:165
#14 0x084336ca in gs_output_page (pgs=0x9336e14, num_copies=1, flush=1) at
./base/gsdevice.c:134
#15 0x0813c8f9 in zoutputpage (i_ctx_p=0x93475ec) at ./psi/zdevice.c:354
#16 0x080f6c19 in call_operator (op_proc=0x813c80d <zoutputpage>,
i_ctx_p=0x93475ec) at ./psi/interp.c:111
#17 0x080fa4ec in interp (pi_ctx_p=0x931f1c4, pref=0xffe429b4,
perror_object=0xffe42b08) at ./psi/interp.c:1538
#18 0x080f7294 in gs_call_interp (pi_ctx_p=0x931f1c4, pref=0xffe42a80,
user_errors=1, pexit_code=0xffe42b14, perror_object=0xffe42b08)
    at ./psi/interp.c:496
#19 0x080f710e in gs_interpret (pi_ctx_p=0x931f1c4, pref=0xffe42a80,
user_errors=1, pexit_code=0xffe42b14, perror_object=0xffe42b08)
    at ./psi/interp.c:454
#20 0x080eb2f3 in gs_main_interpret (minst=0x931f170, pref=0xffe42a80,
user_errors=1, pexit_code=0xffe42b14, perror_object=0xffe42b08)
    at ./psi/imain.c:214
#21 0x080ebe94 in gs_main_run_string_end (minst=0x931f170, user_errors=1,
pexit_code=0xffe42b14, perror_object=0xffe42b08) at ./psi/imain.c:526
#22 0x080ebd69 in gs_main_run_string_with_length (minst=0x931f170, str=0x93adee8
"<2e2f7061747472616e735f6269672e706466>.runfile", length=46, 
    user_errors=1, pexit_code=0xffe42b14, perror_object=0xffe42b08) at
./psi/imain.c:484
#23 0x080ebcd1 in gs_main_run_string (minst=0x931f170, str=0x93adee8
"<2e2f7061747472616e735f6269672e706466>.runfile", user_errors=1, 
    pexit_code=0xffe42b14, perror_object=0xffe42b08) at ./psi/imain.c:466
#24 0x080eee11 in run_string (minst=0x931f170, str=0x93adee8
"<2e2f7061747472616e735f6269672e706466>.runfile", options=3)
    at ./psi/imainarg.c:798
#25 0x080eedc2 in runarg (minst=0x931f170, pre=0x84ef29b "", arg=0x934c8c0
"./pattrans_big.pdf", post=0x84ef335 ".runfile", options=3)
    at ./psi/imainarg.c:788
#26 0x080eea22 in argproc (minst=0x931f170, arg=0xffe448cd "./pattrans_big.pdf")
at ./psi/imainarg.c:723
#27 0x080ed199 in gs_main_init_with_args (minst=0x931f170, argc=6,
argv=0xffe43594) at ./psi/imainarg.c:207
#28 0x08050b84 in main (argc=6, argv=0xffe43594) at ./psi/gs.c:77
(gdb) 
Comment 5 Marcos H. Woehrmann 2009-12-13 09:54:50 UTC
It appears that r10490 has fixed this.  I'm running a longer test now to make sure.