From owner-freebsd-questions Tue Feb 16 08:08:03 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA03761 for freebsd-questions-outgoing; Tue, 16 Feb 1999 08:08:03 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from clefw.ra.rockwell.com (clefw.ra.rockwell.com [192.159.76.15]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA03718 for ; Tue, 16 Feb 1999 08:07:56 -0800 (PST) (envelope-from mkes@ra.rockwell.com) From: mkes@ra.rockwell.com Received: from raclesmtp01.cle.ra.rockwell.com (raclesmtp01.cle.ra.rockwell.com [130.151.192.220]) by clefw.ra.rockwell.com (8.9.3/8.9.3) with SMTP id KAA25375 for ; Tue, 16 Feb 1999 10:19:30 -0500 (EST) Received: by raclesmtp01.cle.ra.rockwell.com(Lotus SMTP MTA v4.6.1 (569.2 2-6-1998)) id 8525671A.00542573 ; Tue, 16 Feb 1999 10:19:06 -0500 X-Lotus-FromDomain: ROCKWELL To: Freebsd-questions@FreeBSD.ORG Message-ID: Date: Tue, 16 Feb 1999 16:25:58 +0100 Subject: problem with MySQL module for python under 3.0 Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi all I have a box with 3.0 release. I have installed MySQL 3.21.33 and python 1.5.1 both from packages. I have downloaded MySQLmodule-1.4 which is a source (just one .c file) for python module allowing to access MySQL database. The README says: --------------- To build a dynamically loadable module without access to the python source tree, use (Trond Eivind Glomsr\xf8d): gcc -shared -I/usr/include/python1.5 -I/usr/local/include/mysql \ MySQLmodule.c -lmysqlclient -L/usr/lib/python1.5/config -lpython1.5 \ -o MySQLmodule.so and move the resulting MySQLmodule.so file into the PYTHONPATH. Again, substitute the proper locations of your include and library files. ---------------- Applied to my situation the command line was: gcc -shared -I/usr/local/include/python1.5 -I/usr/local/include/mysql \ MySQLmodule.c -L/usr/local/lib/mysql -lmysqlclient -L/usr/local/lib/python1.5/config -lpython1.5 \ -o MySQLmodule.so that is how I compiled the module and moved the resulting MySQLmodule.so to appropriate place. When I run python and try to use it the python crashes: ferda:/usr/home/mira> python Python 1.5.1 (#2, Oct 12 1998, 15:11:45) [GCC 2.7.2.1] on freebsd3 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import MySQL Fatal Python error: PyThreadState_Get: no current thread Abort (core dumped) ferda:/usr/home/mira> If I do that under FreeBSD 2.6 release it works. So my guess is there something wrong with the compiler options a.out vs ELF, or .... I found some 3.0 & MySQL related notes saying: ------------------------------------ You have to configure with: --with-named-thread-libs=-lc_r The pthreads library for FreeBSD doesn't contain the sigwait function and there is some bugs in it. To fix this, get the `FreeBSD-3.0-libc_r-1.0.diff' file and apply this in the `/usr/src/lib/libc_r/uthread' directory. Follow after this the instructions that can be found with man pthread about how to recompile the libc_r library. You can test if you have a 'modern' libpthread.a with: > nm /usr/lib/libc_r.a | grep sigwait. If the above doesn't find sigwait you have to use the above patch and recompile libc_r. ---------------------------------- My experience with compiler options, libraries to link with etc. is not good enough to fix this. Can anybody give me a hint what's wrong? Thanks a lot Mira To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message