2.2.1 crashes on Linux (RH7.3) trying to load python shared library timemodule.so

morden morden at shadows.net
Fri Mar 28 15:59:34 EST 2003


Martin v. Löwis wrote:
> morden <morden at shadows.net> writes:
> 
> 
>>1. Why does 2.2.1 goes looking for timemodule.so in
>>/usr/lib/python2.2/lib-dynload/ even though I've built it statically
>>with prefix /u/local
> 
> 
> That is hard to believe, unless you have added somehow
> /usr/lib/python2.2 to sys.path. Are you sure your app is linked with
> the library you have built?

Yes, the warnings that linked gives for my app point to the sources of 
2.2.1:

/u/local/lib/python2.2/config/libpython2.2.a(posixmodule.o): In function 
`posix_tmpnam':
/usr/local/src/Python-2.2.1/./Modules/posixmodule.c:4505: the use of 
`tmpnam_r' is dangerous, better use `mkstemp'
/u/local/lib/python2.2/config/libpython2.2.a(posixmodule.o): In function 
`posix_tempnam':
/usr/local/src/Python-2.2.1/./Modules/posixmodule.c:4453: the use of 
`tempnam' is dangerous, better use `mkstemp'

The crash happens in Py_Initialize before I get a chance to mess with 
sys.path

Here's the top of the stack:

#102 0x080c5f48 in builtin___import__ (self=0x0, args=0x81cd22c)
     at Python/bltinmodule.c:40
#103 0x0806b114 in PyCFunction_Call (func=0x81c7d28, arg=0x81cd22c, kw=0x0)
     at Objects/methodobject.c:80
#104 0x080551e0 in PyObject_Call (func=0x81c7d28, arg=0x81cd22c, kw=0x0)
     at Objects/abstract.c:1684
#105 0x0808df0f in PyEval_CallObjectWithKeywords (func=0x81c7d28,
     arg=0x81cd22c, kw=0x0) at Python/ceval.c:3049
#106 0x080548a2 in PyObject_CallFunction (callable=0x81c7d28,
---Type <return> to continue, or q <return> to quit---
     format=0x8144f27 "OOOO") at Objects/abstract.c:1725
#107 0x080a2821 in PyImport_Import (module_name=0x81d4130)
     at Python/import.c:2048
#108 0x080a2faa in PyImport_ImportModule (name=0x81466c3 "site")
     at Python/import.c:1574
#109 0x080a97ab in initsite () at Python/pythonrun.c:443
#110 0x080a7c90 in Py_Initialize () at Python/pythonrun.c:173

>>2. How could I tell configure that I want modules statically linked with
>>libpython.a? 
> 
> 
> I'm not sure I understand this question. Which modules? The ones of
> the standard Python distribution? They are never linked with

Yes. Stuff like timemodule.so that my program tries to load dynamically.

> libpython.a: they are *part* of it. Your own modules? which configure
> do you want to tell something, then?
> 
configure of Python 2.2.1 of course!





More information about the Python-list mailing list