[cfe-dev] clang with Python 3.1 release31-maint

Douglas Gregor dgregor at apple.com
Wed Mar 3 07:19:13 PST 2010


On Mar 3, 2010, at 6:43 AM, Tony Arkles wrote:

> Hi,
> 
> I'm at a bit of a loss here for how to continue.  I've built
> llvm/clang from svn, and I'm compiling the latest rev from the Python
> 3.1 release branch.  It compiles fine, but fails its regression suite.
> I've tried recompiling using gcc instead and it seems to work fine.
> 
> I'm not sure if this is a clang problem, an llvm problem, a Python
> problem, a library problem (Ubuntu 8.04.2), or maybe something else
> entirely.
> 
> Here's where I'm at so far:
> 
> - I've tried compiling with -O0, no change
> - I've used GDB to narrow down the segfault to a somewhat complicated
> piece of code (in expat, which has apparently been stable for a long
> time)
> - Valgrind reports a lot of bad memory access (Python, I think, should
> generate some as "known behaviour", but when compiled with clang it
> produces quite a bit more)
> 
> I'm not really sure where to go next to optimize the use of my time...
> I've done quite a bit of search for others that have experienced
> similar issues, but have so far come up mostly dry...

The typical approach to narrowing down these problems is to compile half of the .o files with GCC and half with Clang, link them together, and see if that works. Continue that binary search down until you've found the small set of .o files that, when compiled with Clang, result in a failure. Then you can debug or start splitting up the file itself to narrow it down to a few function(s) to determine whether it's a Clang mis-compile, or undefined behavior in Python, or something entirely different.

	- Doug



More information about the cfe-dev mailing list