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

2017-03-24 Thread INADA Naoki
INADA Naoki added the comment: New changeset d7fa6b259e00fca04dbf816bfcf4115fdda14bb7 by INADA Naoki (Daniel Birnstiel) in branch 'master': bpo-29859: Fix error messages from return codes for pthread_* calls (GH-741)

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

2017-03-24 Thread INADA Naoki
INADA Naoki added the comment: New changeset fe30339534c602af1123e1402e44a1463f91f2e5 by INADA Naoki in branch '3.6': bpo-29859: Fix error messages from return codes for pthread_* calls (GH-753) https://github.com/python/cpython/commit/fe30339534c602af1123e1402e44a1463f91f2e5 --

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

2017-03-21 Thread INADA Naoki
Changes by INADA Naoki : -- pull_requests: +666 ___ Python tracker ___ ___

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

2017-03-21 Thread Daniel Birnstiel
Changes by Daniel Birnstiel : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

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

2017-03-21 Thread INADA Naoki
INADA Naoki added the comment: OK, perror() writes to stderr too. fair enough. -- ___ Python tracker ___ ___

[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," | wc -l

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

2017-03-20 Thread INADA Naoki
INADA Naoki added the comment: I don't know your patch is worth enough or not. (I dislike fprintf(stderr, ...) at least). But my advice is stop mixing multithreading and fork (except fork+exec). It's almost impossible. While Python has GIL, some extension can release GIL and run any C code.

[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

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

2017-03-20 Thread INADA Naoki
INADA Naoki added the comment: Could you give us minimum sample Python code to reproduce the error? -- nosy: +inada.naoki ___ Python tracker ___

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

2017-03-20 Thread Daniel Birnstiel
Changes by Daniel Birnstiel : -- pull_requests: +654 ___ Python tracker ___ ___

[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 the