Attached patch solves issue for me.

During configure neither HAVE_MKSTEMP nor HAVE_MKSTEMPS got
defined, therefore function openTempFile  in /lib/pdf/xpdf/gfile.cc
does not use the randomness of mkstemp.

Regards,
Thomas






Am 18.06.2012 00:45, schrieb [email protected]:
> Attached a test szenario with a shell script to reproduce the
> "Couldn't create temporary font file" - Error.
> (present in 0.9.2 if no delay param given, not present in 0.9.1)
> 
> You are right, it is a specific usage scenario, which causes the error
> to appear, but i can't see anything generally wrong with calling a
> command in parallel and as fast as possible, whatever the cause is to do
> that.
> 
> Test also demonstrates the cause for creating two sets of swfs from one
> pdf. swf is vector format, but not all pdf content always is, depending
> on the images embedded there is a notable difference in size (->download
> and animation speed) between the small thumbnail swfs and the full
> resolution required for full screen reading.
> 
> 
> Regards,
> 
> Thomas
> 
> 
> Am 17.06.2012 20:36, schrieb List_Subs:
>> Thomas,
>>
>>> On Sun, 17 Jun 2012 17:34:13 +0200
>>> [email protected] wrote:
>>
>>> Why do I wish to run several processes of pdf2swf on the same file?
>>>
>>> In my app pdf2swf is used to creat very small thumbnail previews and
>>> higher resolution swfs for a pdf viewer, thats why i start pdf2swf
>>> twice on every new pdf input file.
>>
>> Since swf is a vector graphic format, tell me, what is wrong with doing
>> the conversion once, then simply resizing the resulting file?  Would
>> that not be a much simpler and less resource instensive way of doing it?
>>
>>> Meanwhile further tests revealed, that the error is not limited to
>>> processes working on the same file, it occurs always and reproduceable
>>> if pdf2swf processes are started and backgrounded nearly in parallel,
>>> even if they all work on different input pdfs.
>>
>> I think you slightly missed the point I was trying to make.  That the
>> issue seems to exist with the creation of those temporary files, whatever
>> they be.  Several processes trying to create, write to, or oherwise
>> manipulate the same set of temporary files at the same time, is a recipe
>> for disaster.  That's not multitasking, that's just chaos!
>>  
>>> Such a scenario is likely to happen more often, as more app instances
>>> try to utilize pdf2swf, so imho this is a real issue to be solved.
>>
>> IMVHO, I still think this issue is a direct result of what you trying
>> to do, and the way that you are doing it, not what pdf2swf is doing.
>> How about an example? ;o)
>>
>> Regards,
>>
>>
>> Chris.
>>
>> ---------------
>> SWFTools-common is a self-managed list. To subscribe/unsubscribe, or amend 
>> an existing subscription, please kindly point your favourite web browser 
>> at:<http://lists.nongnu.org/mailman/listinfo/swftools-common>
>>
>>
> 
> 
> 
> ---------------
> SWFTools-common is a self-managed list. To subscribe/unsubscribe, or amend an 
> existing subscription, please kindly point your favourite web browser 
> at:<http://lists.nongnu.org/mailman/listinfo/swftools-common>

diff -U 4 -r config.h.in config.h.in
--- config.h.in 2012-04-08 19:25:26.000000000 +0200
+++ config.h.in 2012-06-18 03:03:57.000000000 +0200
@@ -63,8 +63,14 @@
 
 /* Define if you have the popen function.  */
 #undef HAVE_POPEN
 
+/* Define if you have the mkstemps function.  */
+#undef HAVE_MKSTEMPS
+
+/* Define if you have the mkstemp function.  */
+#undef HAVE_MKSTEMP
+
 /* Define if you have the bcopy function.  */
 #undef HAVE_BCOPY
 
 /* Define if you have the bzero function.  */
diff -U 4 -r swftools-0.9.2_orig//configure swftools-0.9.2//configure
--- configure   2012-04-08 19:25:35.000000000 +0200
+++ configure   2012-06-18 03:03:57.000000000 +0200
@@ -5606,9 +5606,9 @@
 _ACEOF
 
 fi
  #needed for jpeglib
- for ac_func in popen wcschr wcsdup mkstemp stat mmap lrand48 rand srand48 
srand bcopy bzero time getrusage mallinfo open64 calloc
+ for ac_func in popen wcschr wcsdup mkstemp mkstemps stat mmap lrand48 rand 
srand48 srand bcopy bzero time getrusage mallinfo open64 calloc
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
 eval as_val=\$$as_ac_var
---------------
SWFTools-common is a self-managed list. To subscribe/unsubscribe, or amend an 
existing subscription, please kindly point your favourite web browser 
at:<http://lists.nongnu.org/mailman/listinfo/swftools-common>

Reply via email to