[Python-bugs-list] [ python-Bugs-727051 ] valgrind python fails

SourceForge.net noreply@sourceforge.net
Sat, 03 May 2003 04:28:49 -0700


Bugs item #727051, was opened at 2003-04-24 19:49
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=727051&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Ralf W. Grosse-Kunstleve (rwgk)
Assigned to: Nobody/Anonymous (nobody)
Summary: valgrind python fails

Initial Comment:
Platform:
  Redhat 7.3 on Intel Xeon

Packages involved:
  valgrind-1.9.5 (http://developer.kde.org/~sewardj/)
  Python CVS snapshot Thu Apr 24 10:00:00 PDT 2003

valgrind python fails with the following message:

% valgrind python
python: relocation error: /lib/librt.so.1: symbol 
__pthread_clock_settime, version GLIBC_PRIVATE not 
defined in file libpthread.so.0 with link time reference

This is with:

% python
Python 2.3b1 (#1, Apr 24 2003, 10:20:26) 
[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-113)] on 
linux2
Type "help", "copyright", "credits" or "license" for more 
information.
>>> 

I observed the same problem with Python 2.3a2.

There are no problems when using Python 2.2.1 on the 
exact same platform with the same valgrind installation.


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-05-03 13:28

Message:
Logged In: YES 
user_id=21627

This is fixed with 73017 patch in

configure 1.393
configure.in 1.404


----------------------------------------------------------------------

Comment By: Armin Rigo (arigo)
Date: 2003-04-30 11:31

Message:
Logged In: YES 
user_id=4771

I figured it out. 'configure.in' now looks in various
libraries for the sem_init() function (it is in different
libs on different platforms); more precisely, it searches in
librt and libposix4. However, on Linux, for some reason it
is also defined in libpthread which is always linked with
Python (unless one disables threads, of course).

As a suggested fix, I'd say that configure.in should first
look for sem_init in libpthread. That way, the Linux
compilation won't be linked against the unneeded and
valgrind-conflicting librt at all.

I can provide a patch that does this.

----------------------------------------------------------------------

Comment By: Ralf W. Grosse-Kunstleve (rwgk)
Date: 2003-04-29 22:49

Message:
Logged In: YES 
user_id=71407

> Is it worth any further investigation ? If not, close this
> bug track.

valgrind is extremely useful. It seems very important to me that 
Python 2.3 works with valgrind out-of-the-box, just like Python 2.2 
does. I'm afraid otherwise "Why doesn't Python work with 
valgrind?" is going to wind up in the Python FAQ.


> What I cannot understand is the purpose of binding against
> that library on Linux. It ends up in the Makefile for some
> indirect reason. I tried without it and the 'make test'
> works just fine.

I'd be very glad if you could find ways of not binding against 
librt.so if it is not needed.


----------------------------------------------------------------------

Comment By: Armin Rigo (arigo)
Date: 2003-04-29 21:06

Message:
Logged In: YES 
user_id=4771

This is documented as a known problem with the librt.so
library on http://developer.kde.org/~sewardj/docs-1.9.5/FAQ.txt.

What I cannot understand is the purpose of binding against
that library on Linux. It ends up in the Makefile for some
indirect reason. I tried without it and the 'make test'
works just fine.

Is it worth any further investigation ? If not, close this
bug track.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-04-24 21:14

Message:
Logged In: YES 
user_id=33168

I think I got around this problem by adding:

  void __pthread_clock_settime() { }

I think this may be mentioned in the valgrind FAQ/doc.  Or
perhaps, it's something similar which I am confusing.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=727051&group_id=5470