New submission from Senhui Guo <guo.lec...@gmail.com>:
I was trying to build a c extension with cpython while it keeps crashing when I get it running, the code is quite simple: ```cpp #include "Python.h" int main () { PyObject *p; p = PySet_New(NULL); } ``` I build with command `clang -I/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m test.c -o run` when I ran it `./run`, segmentation fault: 11 kicks in However, if I go with python2, it worked fine: `clang -I /usr/local/Cellar/python\@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -L /usr/local/opt/python\@2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/ -lpython2.7 test.c -o run` I was wondering if it is the problem with macOS? I tried build python from source, but didn't work, keeps crashing ---------- components: macOS messages: 341196 nosy: Senhui Guo, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Segmentation fault when running c extension on macOS type: crash versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36767> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com