Skip to content

gh-159603: Call pthread_attr_init() in hardware_stack_limits() - #159857

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:attr_init
Oct 20, 2026
Merged

vstinner merged 2 commits into
python:mainfrom
vstinner:attr_init

Conversation

@vstinner

@vstinner vstinner commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Always call pthread_attr_init() in hardware_stack_limits(), not only on FreeBSD (if pthread_attr_get_np() is available).

Always call pthread_attr_init() in hardware_stack_limits(), not only
on FreeBSD (if pthread_attr_get_np() is available).
@vstinner

Copy link
Copy Markdown
Member Author

Emscripten fails to build:

../../../../Python/ceval.c:162:33: error: incompatible pointer types passing 'workaround_pthread_attr_t *' to parameter of type 'pthread_attr_t *' [-Wincompatible-pointer-types]
  162 |     int err = pthread_attr_init(&attr);
      |                                 ^~~~~
/home/runner/work/_temp/emsdk-cache/6.0.10/emsdk/upstream/emscripten/cache/sysroot/include/pthread.h:149:39: note: passing argument to parameter here
  149 | int pthread_attr_init(pthread_attr_t *);
      |                                       ^
@vstinner

Copy link
Copy Markdown
Member Author

Good: "Tests / Emscripten / build and test (pull_request)" passed with my fix.

@vstinner
vstinner merged commit 14b43d4 into python:main Oct 20, 2026
57 of 58 checks passed
@vstinner
vstinner deleted the attr_init branch October 20, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant