llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.27k stars 12.09k forks source link

Segmentation fault in Python example 'cindex-includes.py' #9647

Open llvmbot opened 13 years ago

llvmbot commented 13 years ago
Bugzilla Link 9275
Version 2.9
OS Linux
Attachments I/O and back-trace related to the problem
Reporter LLVM Bugzilla Contributor
CC @tobiasgrosser

Extended Description

Hi, The attachment includes the following:

  1. 'cindex-includes-input.h': The file provided to both 'c-index-test' and 'cindex-includes.py'
  2. 'cindex-includes.output': Console log containing GDB invocation including back-trace
  3. 'c-index-test.output': Console log containing default output from corresponding (?) invocation of 'c-index-test'

Are you able to reproduce? Is this an installation problem? My build is current as of yesterday (Feb. 19).

It's not in the trace but the environment includes a PYTHONPATH setting corresponding to the '$(llvm-config --src-root)/tools/clang/bindings/python'.

Thanks, Chad

llvmbot commented 13 years ago

Hi, I'm also hitting this problem in 2.9 RC1. I compiled with gcc, autoconf build system and release mode.

Regards, Chad

llvmbot commented 13 years ago

Hi Tobi, Thanks for confirming and for the 2.9 info. Has 2.9 branched yet?

I've been looking more closely at this problem. The SourceLocation object appears to be corrupted but I haven't been able to narrow the problem any further. I'm finding ctypes debugging pretty tricky and considering a rewrite of the functions I want as full-blown extensions.

I went back to 2.8 and found that most 'test_translation_unit.py' cases failing. The situation improves on the development line where only the includes case fails. I have debug and asserts enabled in my environment. I'm using gdb to build on ubuntu 10.10.

Best, Chad

tobiasgrosser commented 13 years ago

Created an attachment (id=6192) [details] I/O and back-trace related to the problem

Hi, The attachment includes the following:

  1. 'cindex-includes-input.h': The file provided to both 'c-index-test' and 'cindex-includes.py'
  2. 'cindex-includes.output': Console log containing GDB invocation including back-trace
  3. 'c-index-test.output': Console log containing default output from corresponding (?) invocation of 'c-index-test'

Are you able to reproduce? Is this an installation problem? My build is current as of yesterday (Feb. 19).

It's not in the trace but the environment includes a PYTHONPATH setting corresponding to the '$(llvm-config --src-root)/tools/clang/bindings/python'.

Thanks, Chad

Hi,

I can reproduce this problem with a recent build of llvm/clang. An installation of clang version 2.9 (trunk 125281) works however and gives this output:

python bindings/python/examples/cindex/cindex-includes.py ~/Downloads/cindex-includes-input.h digraph G { "/home/grosser/Downloads/cindex-includes-input.h" "/home/grosser/Downloads/cindex-includes-input.h"->"/usr/include/string.h" "/usr/include/string.h"->"/usr/include/features.h" "/usr/include/features.h"->"/usr/include/bits/predefs.h" "/usr/include/features.h"->"/usr/include/sys/cdefs.h" "/usr/include/sys/cdefs.h"->"/usr/include/bits/wordsize.h" "/usr/include/features.h"->"/usr/include/gnu/stubs.h" "/usr/include/gnu/stubs.h"->"/usr/include/bits/wordsize.h" "/usr/include/gnu/stubs.h"->"/usr/include/gnu/stubs-64.h" "/usr/include/string.h"->"/home/grosser/Projekte/llvm/install/lib/clang/2.9/include/stddef.h" "/usr/include/string.h"->"/usr/include/xlocale.h" }

I did not do any further investigation and there are quite some differences between those builds. The working one is older, compiled with gcc, autoconf build system and release mode. The non-working one is from today compiled with gcc, cmake build system and no build type set. Still this shows that this problem is not local to your system.

Cheers Tobi

llvmbot commented 13 years ago

assigned to @tkremenek