[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Statically linked ptex also crashes



On Do, 24 Dez 2009, YOSHINO Yoshihito wrote:
> I tried ptex linked statically with libkpathsea4 (using tetex source
> included in ptex-buildsupport), but it crashes with the same error
> except that all "/usr/lib/libkpathsea.so.4"'s in the backtrace are
> replaced with "ptex"...

Yes, I know. The problem is that in libkpathsea4 there is a bug that 
is only triggered with loads of fonts (AFAIS). 

I cannot upgrade TL2007 packages for Debian now that 2009 is already in
unstable, but the patch would be attached.

I see two options:
- build your own kpathsea4 library and link it statically, but then
  apply the attached patch, otherwise it will break
- make sure that the header files in /usr/include/kpathsea/ are used
  and not the ones in the package (tetex3), and link dynamically 
  against libkpathsea5, in this case no patch needed.

One of the two will resolve the problem (I opt for the second, if that
is possible).

Best wishes

Norbert
------------------------------------------------------------------------
Norbert Preining            preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan            TU Wien, Austria           Debian TeX Task Force
DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
And wow! Hey! What's this thing coming towards me very
fast? Very very fast. So big and flat and round, it needs a
big wide sounding word like... ow... ound... round...
ground! That's it! That's a good name - ground!
I wonder if it will be friends with me?
                 --- For the sperm whale, it wasn't.
                 --- Douglas Adams, The Hitchhikers Guide to the Galaxy
fix free-ing of wrong pointer in fontname_lookup
picked from upstream
---
 build/source/texk/kpathsea/fontmap.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: texlive-bin-2007.dfsg.2/build/source/texk/kpathsea/fontmap.c
===================================================================
--- texlive-bin-2007.dfsg.2.orig/build/source/texk/kpathsea/fontmap.c	2009-12-19 09:40:11.000000000 +0900
+++ texlive-bin-2007.dfsg.2/build/source/texk/kpathsea/fontmap.c	2009-12-19 09:40:59.000000000 +0900
@@ -84,7 +84,7 @@
   
   while ((orig_l = read_line (f)) != NULL) {
     string filename;
-    string l = orig_l;
+    string l = orig_l; /* save for free() */
     string comment_loc = strrchr (l, '%');
     if (!comment_loc) {
       comment_loc = strstr (l, "@c");
@@ -137,7 +137,7 @@
       }
     }
 
-    free (l);
+    free (orig_l);
   }
   
   xfclose (f, map_filename);

Reply to: