ctypes segfault on OSX only
问题 I created a very simple C library binding in Python using ctypes. All it does is accept a string and return a string. I did the development on Ubuntu, and everything looked fine. Unfortunately, on OSX the exact same code fails. I'm completely stumped. I've put together a minimal case showing the issue I'm having. main.py import ctypes # Compile for: # Linux: `gcc -fPIC -shared hello.c -o hello.so` # OSX: `gcc -shared hello.c -o hello.so` lib = ctypes.cdll.LoadLibrary('./hello.so') # Call the