[issue29039] Segmentation fault when using PyUnicode_FromString

2016-12-21 Thread Xiang Zhang
Xiang Zhang added the comment: Just as Christoph said, you need to initialize first. -- nosy: +xiang.zhang resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29039] Segmentation fault when using PyUnicode_FromString

2016-12-21 Thread Christoph Reiter
Christoph Reiter added the comment: You're missing a call to Py_Initialize() [0] [0] https://docs.python.org/3/c-api/init.html#c.Py_Initialize -- nosy: +lazka ___ Python tracker ___

[issue29039] Segmentation fault when using PyUnicode_FromString

2016-12-21 Thread Matteo Cafasso
New submission from Matteo Cafasso: The following code snippet: -- #include #include int main() { char *broken_string[8]; char broken_char = 4294967252; sprintf(broken_string, "%c", broken_char); PyUnicode_FromString(broken_string)