Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Cygwin: cindex-dump.py segfaults under python2.7 #24038

Open Quuxplusone opened 9 years ago

Quuxplusone commented 9 years ago
Bugzilla Link PR24039
Status NEW
Importance P normal
Reported by brad_e@hotmail.com
Reported on 2015-07-06 11:25:42 -0700
Last modified on 2015-07-24 10:24:56 -0700
Version 3.5
Hardware PC Windows NT
CC geek4civic@gmail.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
I'm not sure if this should be reported to Cygwin or here but I've been using
the Python bindings for libclang for a while. I updated last week to the latest
provided with Cygwin (3.5.2) and now I'm getting a segmentation fault when I
try to run the cindex-dump.py example script provided with the Python bindings.

python cindex-dump.py hello.c:

  #include <stdio.h>
  #include <stdlib.h>

  int main(void)
  {
      return 0;
  }

The version I'm using is:
    python-clang (3.5.2.1)

I'm running on a 64 bit version of Windows 7. The same problem happens on a 64
bit version of Windows 8.

The cindex-includes.py file runs correctly. I'm using the cindex-dump.py and
cindex-includes.py bundled with 3.5.2 from the LLVM downloads page.

I also tried downloading 3.6.1 and compiling it from source but the python
bindings again crash under Cygwin when I run cindex-dump.py.
Quuxplusone commented 9 years ago
The 32 bit version of Cygwin (on a 64 bit OS) doesn't seem to crash when I run
the Python bindings for libclang/cygclang so it must be something to do with
the 64 bit version. I don't see a crash but I end up with all kinds of forking
issues when I try to launch a process via subprocess. I've tried rebasing many
times but it doesn't seem to resolve the forking issue. It's at least a partial
solution to my problem.

[main] python2.7 3400 child_info_fork::abort: address space needed by 'c
ygfontconfig-1.dll' (0x1FC0000) is already occupied
(<type 'exceptions.OSError'>, OSError(11, 'Resource temporarily unavailable'),
<                                                                traceback
object at 0xffa95d9c>)
Traceback (most recent call last):
Quuxplusone commented 9 years ago
The command that I run in Cygwin is this:

  python cindex-dump.py hello.c
  Segmentation fault (core dumped)

This creates a python2.7.exe.stackdump file but I can't figure out how to get
anything useful from it as it appears I need to re-build Python with debug
symbols turned on.

The cindex-dump.py file comes from:
    http://llvm.org/svn/llvm-project/cfe/trunk/bindings/python/examples/cindex/cindex-dump.py

There don't appear to be any differences between version 3.5.2 (which it looks
like Cygwin is bundling) and the latest.

The hello.c file is pretty simple:

  #include <stdio.h>
  #include <stdlib.h>

  int main(void)
  {
    return 0;
  }