The ImageMagick ebuild probes for a pdfwriter during ./configure. The ghostscript command used to probe for pdfwriter is: gs -q -dBATCH -sDEVICE=pdfwrite -sOutputFile=/dev/null This hangs if /dev/random does not have enough entropy. This patch makes gs use /dev/urandom during pdf generation Reproducible: Sometimes Steps to Reproduce: 1. 2. 3. --- src/gdevpdf.c-dist 2003-05-24 13:20:16.000000000 -0400 +++ src/gdevpdf.c 2003-05-24 13:35:35.000000000 -0400 @@ -503,8 +503,17 @@ /* * If we're on a system that provides /dev/random, that's the best * source of random bits. + * + * prefer /dev/urandom to /dev/random for generating font subset id + * prefixes. The former is less random and less commonly implemented than the + * former, however /dev/random can block for long times while entropy accumulates, + * slowing down applications that make frequent invocations. Our requirements + * for randomness here aren't particularly stringent. + * + * Patch idea from: Ralph Giles <giles@casper.ghostscript.com> + * http://www.ghostscript.com/pipermail/gs-cvs/2003-January/002812.html */ - FILE *rfile = fopen("/dev/random", "rb"); + FILE *rfile = fopen("/dev/urandom", "rb"); if (rfile && fread(&pdev->random_offset, sizeof(pdev->random_offset), 1, rfile) == sizeof(pdev->random_offset)
Created attachment 12369 [details, diff] one liner to use /dev/urandom against ghostscript-7.05.5 Should apply to all versions I'm not quite sure how to make epatch work independent of ${P}
Created attachment 12370 [details, diff] The other attachment should apply to all ghostscript-7* trees Patch to 7.05.5.ebuild Should be easy to stick into other ebuilds
Obviously, the bigger concern is why my /dev/random is starved. Indeed, /proc/sys/kernel/random/entropy_avail reports 0
will have a look .. sorry for the delay there was a problem with the mail alias so i didn't get the Bugzilla mails
ghostscript-7.05.6-r3 now in portage ...