[issue6721] Locks in the standard library should be sanitized on fork

2017-05-31 Thread Daniel Birnstiel
Daniel Birnstiel added the comment: While having to deal with this bug for a while I have written a small library using `pthread_atfork`: https://github.com/Birne94/python-atfork-lock-release It allows registering atfork-hooks (similar to the ones available by now) and frees the stdout/stderr

[issue30385] Segfault on OSX with 3.6.1

2017-05-19 Thread Daniel Birnstiel
Daniel Birnstiel added the comment: I am currently (occasionally) running into the same problem, using Python 3.6.0 on OSX 10.12.3. I cannot reproduce this segmentation fault reliably, it happens after running for a while in production. This appears to be similar to issue 13829. python

[issue29859] Return code of pthread_* in thread_pthread.h is not used for perror

2017-03-21 Thread Daniel Birnstiel
Changes by Daniel Birnstiel <dan...@birne.me>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue29859] Return code of pthread_* in thread_pthread.h is not used for perror

2017-03-21 Thread Daniel Birnstiel
Daniel Birnstiel added the comment: While I agree, fprintf it not really nice, I looked through other parts of the python source where information is printed to stderr and fprintf was used there as well, so I fell back to it myself. % grep -rnw . -e "fprintf(stderr,&quo

[issue29859] Return code of pthread_* in thread_pthread.h is not used for perror

2017-03-20 Thread Daniel Birnstiel
Daniel Birnstiel added the comment: While you might scold me for the following code, it is just some fiddling with the cpython functions from python side. Backstory is issue 6721 or related to it. I am working on a multi-process service which uses multiprocessing (or rather the billiard fork

[issue29859] Return code of pthread_* in thread_pthread.h is not used for perror

2017-03-20 Thread Daniel Birnstiel
Changes by Daniel Birnstiel <dan...@birne.me>: -- pull_requests: +654 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29859> ___ _

[issue29859] Return code of pthread_* in thread_pthread.h is not used for perror

2017-03-20 Thread Daniel Birnstiel
Daniel Birnstiel added the comment: I have attached a diff adding a new macro for handling pthread_* status codes. Will submit PR as soon as my CLA is approved. -- keywords: +patch versions: +Python 3.7 Added file: http://bugs.python.org/file46746/patch.diff

[issue29859] Return code of pthread_* in thread_pthread.h is not used for perror

2017-03-20 Thread Daniel Birnstiel
New submission from Daniel Birnstiel: Python/thread_pthread.h:145 defines the CHECK_STATUS macro used for printing error messages in case any of the calls fail. CHECK_STATUS uses perror for formatting an error message, which relies on the global erno being set (see man perror). Since

[issue6721] Locks in the standard library should be sanitized on fork

2017-03-16 Thread Daniel Birnstiel
Daniel Birnstiel added the comment: Currently using Python 3.6.0 (default, Mar 4 2017, 12:32:34) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin > So, somehow the print() statement is blocking, which I have /no/ idea how to > go about debugging. I assume there's