This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Problem in calling kpathsea library from Python extension
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: chofchof, nnorwitz
Priority: normal Keywords:

Created on 2003-12-09 04:39 by chofchof, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
sample.tar.gz chofchof, 2003-12-09 04:39 Sample files causing the problem above
Messages (2)
msg19339 - (view) Author: Jin-Hwan Cho (chofchof) Date: 2003-12-09 04:39
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.
msg19340 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-10-02 07:07
Logged In: YES 
user_id=33168

This is not a bug in python, so I'm closing it.

I looked over your code and didn't see a specific problem,
though I don't know what the kpathsea functions are doing. 
The problem could be a kpathsea issue, a compiler issue, or
something else.  There isn't enough information to know. 
There could be memory corruption elsewhere.

I'm assuming the definition of string is char *.  If string
isn't a char*, then there is a decent chance that is your
problem.
History
Date User Action Args
2022-04-11 14:56:01adminsetgithub: 39684
2003-12-09 04:39:05chofchofcreate