1. Environment:
System: FreeBSD 5.1-RELEASE
Packages: python-2.2.2_2, teTeX-2.0.2_2 (kpathsea
library version 3.4.5)
2. Description:
Recently I was trying to write a Python extension using
the kpathsea library. It was simple and everying went
smoothly. But I got a severe problem in FreeBSD. Even
simple code did not work in FreeBSD.
After trying some tests, I found where the problem
occurred. That was "cnf.c" in the kpathsea library
(contained in teTeX-2.0.2_2 package).
There is a place in "cnf.c" calling "hash_create()"
function (defined in hash.c). However, in FreeBSD,
the "hash_create()" was not called properly. After
changing the name "hash_create()" to another one, for
example, "hash_create2()", everything worked fine.
I'd like to know exact reason why this kind of problem
occurs in FreeBSD.
3. How-To-Repeat:
On FreeBSD system with python-2.2.2_2 and teTeX-
2.0.2_2 installed, using the attached three files, run the
following command
python setup.py install
and then run
python kpse_test.py
The result was "Segmentation fault (core dumped)".
4. Fix:
The problem above can be fixed by modifying the
kpathsea library itself as follows:
Change the name of "hash_create" function (defined in
hash.c) to another name, for example, "hash_create2"
from several files, cnf.c, db.c, dir.c, fontname.c, hash.c,
and hash.h.
It seems quite curious because there was no problem in
cygwin.
|