[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    kdvi is broken by glibc2.1.1,  and maybe orphaned?
From:       Duncan Haldane <f.d.m.haldane () mciworld ! com>
Date:       1999-07-29 23:43:33
[Download RAW message or body]

*** kdvi seems to be orphaned, AND it's broken with glibc-2.1.1****.

Hi,

This is to draw peoples attention to kdvi, which is showing its age,
and seems unmaintained....  There are problems needing fixing ASAP.
kdvi is a crucial part of the TeX system for KDE.   

  ** can this be done for kde-1.1.2 ? kdvi has become **UNUSABLE**
    with RedHat 6.0 ..... (and maybe other glibc-2.1.1 systems (?) )


(1) kdvi is broken with glibc-2.1.1 (RedHat 6.0) but not glibc-2.0
(RedHat-5.2).   Many dvi files (such as from the sample LaTeX file
sample2e.tex) cause it to terminate when getenv() reports a NULL
environment variable (that should not be null because it is was supposedly set
by an earlier putenv call) and this is trapped by one of two assert() tests.
There is an empirical workaround described below (A).


(2) This is related to the older version of the kpathsea library that kdvi
is statically linked to.  There are pleas at bugs.kde.org for kdvi to be 
updated to a recent kpathsea, which handles font substitution better.
I have tested this, and it in fact also fixes problem (1), but would
need some extra updating of kdvi that I can't handle.  see (B) below also.


(A) the putenv()/getenv() problem.  Surprisingly, kdvi compiled on
RedHat 5.2 (glibc-2.0) works fine on both RedHat-5.2 and 6.0!  Since
kdvi is crucial to my work, I almost had to abandon RedHat-6.0 till I
discovered this.    I have traced the source of the difference:
the kpathsea distribution is appended to kdvi, and runs its own autoconf
script, which tests "whether putenv uses malloc".   On RedHat-5.2 (glibc-2.0)
the test says "yes", and SMART_PUTENV gets defined. On RedHat-6.0 (glibc-2.1.1)
the test says "no", and SMAT_PUTENV is not defined.  kpathsea/xputenv.c
is compiled differently depending on whether or not SMART_PUTENV is  defined. 
This is documented by comments in xputenv.c

**WORKAROUND**
I dont know whether there is really a big change in putenv() in going 
from glibc-2.0 to glibc-2.1.1, but if a #define SMART_PUTENV 1 is patched
into xputenv.c to override the result of the autoconf test, the kdvi
binary compiled on RedHat 6.0 seems to work perfectly!!  I suspect the
test itself somehow is invalidated by changes in glibc.


(B)  The alternative approach is to attempt to upgrade the kpathsea
distribution to which kdvi is statically linked, taking it from the latest
teTeX-0.9, and implementing the patch suggested by Mark Davies
<mark@MCS.VUW.AC.NBZ> in bug report #1470.  This in fact also cures
problem (1) - though the newer autoconf test still claims glibc-2.0 putenv 
uses malloc and glibc-2.1.1 putenv doesn't.

To  replace kpathsea with the new version: (KDE_1_1_BRANCH)

(1) replace kdegraphics/kdvi/pathsea/ with teTeX-0.9/texk/kpathsea/
(2) replace kdegraphics/kdvi/make/ with teTeX-0.9/texk/make/
(3) copy the files from teTeX-0.9/config into kdegraphics/kdvi/kpathsea/
(4) edit kdegraphics/kdvi/make/common.mk so the LIBTOOL line becomes
LIBTOOL = $(kpathsea_srcdir)/klibtool 
(5) edit kdegraphics/kdvi/Makefile.am so
kpathsea = kpathsea/STATIC/libkpathsea.a  
(instead of kpathsea/kpathsea.a)
and if you dont regenerate Makefile.in, make the same change to
kpathsea = ... 
and 
kdvi_DEPENDENCIES = ... 
lines in that file.


(6) now  patch kdvi/dviwin.cpp as in bug report #1470 

These changes let kdvi build successfully (on RedHat 5.2 and 6.0)

While problem (1) is now gone, the resulting binary segfaults if
kdvi tries to generate missing font pk files, so I suppose some other
updates to the kdvi source files are needed to accomodate the changes in 
kpathsea...

If someone has more experience than me on this maybe they could see
what more is needed.....



Regards

Duncan Haldane
<duncan@kde.org>


----------------------------------
E-Mail: Duncan  Haldane <f.d.m.haldane@mciworld.com>
Date: 29-Jul-99
Time: 19:40:17

This message was sent by XFMail
----------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic