8000 GH-91079: Implement C stack limits using addresses, not counters. by markshannon · Pull Request #130007 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-91079: Implement C stack limits using addresses, not counters. #130007

New issue < 8000 button aria-label="Close dialog" data-close-dialog="" type="button" data-view-component="true" class="Link--muted btn-link position-absolute p-4 right-0">

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 46 commits into from
Feb 19, 2025

Conversation

markshannon
Copy link
Member
@markshannon markshannon commented Feb 11, 2025

@bedevere-app
Copy link
bedevere-app bot commented Feb 18, 2025

Thanks for making the requested changes!

@iritkatriel, @encukou: please review the changes made to this pull request.

Copy link
Member
@encukou encukou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great now, thank you!

Would you be OK with me asking the SC to remove Py_C_RECURSION_LIMIT (and c_recursion_remaining) without deprecation? IMO it's the right thing to do here.

@markshannon
Copy link
Member Author

Would you be OK with me asking the SC to remove Py_C_RECURSION_LIMIT (and c_recursion_remaining) without deprecation? IMO it's the right thing to do here.

Sure, go ahead.

I was thinking that we should deprecate the whole of struct _ts (the thread state struct), but that probably needs a bit more discussion and it might be tricky to deprecate the struct, but still allow pointers to it in the API.

@markshannon markshannon merged commit 2498c22 into python:main Feb 19, 2025
71 checks passed
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot wasm32-wasi 3.x has failed when building commit 2498c22.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1046/builds/7562) and take a look at the build logs.
  4. Check if the failure is related to this commit (2498c22) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1046/builds/7562

Failed tests:

  • test_call

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 142, done.        
remote: Counting objects:   0% (1/142)        
remote: Counting objects:   1% (2/142)        
remote: Counting objects:   2% (3/142)        
remote: Counting objects:   3% (5/142)        
remote: Counting objects:   4% (6/142)        
remote: Counting objects:   5% (8/142)        
remote: Counting objects:   6% (9/142)        
remote: Counting objects:   7% (10/142)        
remote: Counting objects:   8% (12/142)        
remote: Counting objects:   9% (13/142)        
remote: Counting objects:  10% (15/142)        
remote: Counting objects:  11% (16/142)        
remote: Counting objects:  12% (18/142)        
remote: Counting objects:  13% (19/142)        
remote: Counting objects:  14% (20/142)        
remote: Counting objects:  15% (22/142)        
remote: Counting objects:  16% (23/142)        
remote: Counting objects:  17% (25/142)        
remote: Counting objects:  18% (26/142)        
remote: Counting objects:  19% (27/142)        
remote: Counting objects:  20% (29/142)        
remote: Counting objects:  21% (30/142)        
remote: Counting objects:  22% (32/142)        
remote: Counting objects:  23% (33/142)        
remote: Counting objects:  24% (35/142)        
remote: Counting objects:  25% (36/142)        
remote: Counting objects:  26% (37/142)        
remote: Counting objects:  27% (39/142)        
remote: Counting objects:  28% (40/142)        
remote: Counting objects:  29% (42/142)        
remote: Counting objects:  30% (43/142)        
remote: Counting objects:  31% (45/142)        
remote: Counting objects:  32% (46/142)        
remote: Counting objects:  33% (47/142)        
remote: Counting objects:  34% (49/142)        
remote: Counting objects:  35% (50/142)        
remote: Counting objects:  36% (52/142)        
remote: Counting objects:  37% (53/142)        
remote: Counting objects:  38% (54/142)        
remote: Counting objects:  39% (56/142)        
remote: Counting objects:  40% (57/142)        
remote: Counting objects:  41% (59/142)        
remote: Counting objects:  42% (60/142)        
remote: Counting objects:  43% (62/142)        
remote: Counting objects:  44% (63/142)        
remote: Counting objects:  45% (64/142)        
remote: Counting objects:  46% (66/142)        
remote: Counting objects:  47% (67/142)        
remote: Counting objects:  48% (69/142)        
remote: Counting objects:  49% (70/142)        
remote: Counting objects:  50% (71/142)        
remote: Counting objects:  51% (73/142)        
remote: Counting objects:  52% (74/142)        
remote: Counting objects:  53% (76/142)        
remote: Counting objects:  54% (77/142)        
remote: Counting objects:  55% (79/142)        
remote: Counting objects:  56% (80/142)        
remote: Counting objects:  57% (81/142)        
remote: Counting objects:  58% (83/142)        
remote: Counting objects:  59% (84/142)        
remote: Counting objects:  60% (86/142)        
remote: Counting objects:  61% (87/142)        
remote: Counting objects:  62% (89/142)        
remote: Counting objects:  63% (90/142)        
remote: Counting objects:  64% (91/142)        
remote: Counting objects:  65% (93/142)        
remote: Counting objects:  66% (94/142)        
remote: Counting objects:  67% (96/142)        
remote: Counting objects:  68% (97/142)        
remote: Counting objects:  69% (98/142)        
remote: Counting objects:  70% (100/142)        
remote: Counting objects:  71% (101/142)        
remote: Counting objects:  72% (103/142)        
remote: Counting objects:  73% (104/142)        
remote: Counting objects:  74% (106/142)        
remote: Counting objects:  75% (107/142)        
remote: Counting objects:  76% (108/142)        
remote: Counting objects:  77% (110/142)        
remote: Counting objects:  78% (111/142)        
remote: Counting objects:  79% (113/142)        
remote: Counting objects:  80% (114/142)        
remote: Counting objects:  81% (116/142)        
remote: Counting objects:  82% (117/142)        
remote: Counting objects:  83% (118/142)        
remote: Counting objects:  84% (120/142)        
remote: Counting objects:  85% (121/142)        
remote: Counting objects:  86% (123/142)        
remote: Counting objects:  87% (124/142)        
remote: Counting objects:  88% (125/142)        
remote: Counting objects:  89% (127/142)        
remote: Counting objects:  90% (128/142)        
remote: Counting objects:  91% (130/142)        
remote: Counting objects:  92% (131/142)        
remote: Counting objects:  93% (133/142)        
remote: Counting objects:  94% (134/142)        
remote: Counting objects:  95% (135/142)        
remote: Counting objects:  96% (137/142)        
remote: Counting objects:  97% (138/142)        
remote: Counting objects:  98% (140/142)        
remote: Counting objects:  99% (141/142)        
remote: Counting objects: 100% (142/142)        
remote: Counting objects: 100% (142/142), done.        
remote: Compressing objects:   1% (1/62)        
remote: Compressing objects:   3% (2/62)        
remote: Compressing objects:   4% (3/62)        
remote: Compressing objects:   6% (4/62)        
remote: Compressing objects:   8% (5/62)        
remote: Compressing objects:   9% (6/62)        
remote: Compressing objects:  11% (7/62)        
remote: Compressing objects:  12% (8/62)        
remote: Compressing objects:  14% (9/62)        
remote: Compressing objects:  16% (10/62)        
remote: Compressing objects:  17% (11/62)        
remote: Compressing objects:  19% (12/62)        
remote: Compressing objects:  20% (13/62)        
remote: Compressing objects:  22% (14/62)        
remote: Compressing objects:  24% (15/62)        
remote: Compressing objects:  25% (16/62)        
remote: Compressing objects:  27% (17/62)        
remote: Compressing objects:  29% (18/62)        
remote: Compressing objects:  30% (19/62)        
remote: Compressing objects:  32% (20/62)        
remote: Compressing objects:  33% (21/62)        
remote: Compressing objects:  35% (22/62)        
remote: Compressing objects:  37% (23/62)        
remote: Compressing objects:  38% (24/62)        
remote: Compressing objects:  40% (25/62)        
remote: Compressing objects:  41% (26/62)        
remote: Compressing objects:  43% (27/62)        
remote: Compressing objects:  45% (28/62)        
remote: Compressing objects:  46% (29/62)        
remote: Compressing objects:  48% (30/62)        
remote: Compressing objects:  50% (31/62)        
remote: Compressing objects:  51% (32/62)        
remote: Compressing objects:  53% (33/62)        
remote: Compressing objects:  54% (34/62)        
remote: Compressing objects:  56% (35/62)        
remote: Compressing objects:  58% (36/62)        
remote: Compressing objects:  59% (37/62)        
remote: Compressing objects:  61% (38/62)        
remote: Compressing objects:  62% (39/62)        
remote: Compressing objects:  64% (40/62)        
remote: Compressing objects:  66% (41/62)        
remote: Compressing objects:  67% (42/62)        
remote: Compressing objects:  69% (43/62)        
remote: Compressing objects:  70% (44/62)        
remote: Compressing objects:  72% (45/62)        
remote: Compressing objects:  74% (46/62)        
remote: Compressing objects:  75% (47/62)        
remote: Compressing objects:  77% (48/62)        
remote: Compressing objects:  79% (49/62)        
remote: Compressing objects:  80% (50/62)        
remote: Compressing objects:  82% (51/62)        
remote: Compressing objects:  83% (52/62)        
remote: Compressing objects:  85% (53/62)        
remote: Compressing objects:  87% (54/62)        
remote: Compressing objects:  88% (55/62)        
remote: Compressing objects:  90% (56/62)        
remote: Compressing objects:  91% (57/62)        
remote: Compressing objects:  93% (58/62)        
remote: Compressing objects:  95% (59/62)        
remote: Compressing objects:  96% (60/62)        
remote: Compressing objects:  98% (61/62)        
remote: Compressing objects: 100% (62/62)        
remote: Compressing objects: 100% (62/62), done.        
remote: Total 72 (delta 70), reused 11 (delta 10), pack-reused 0 (from 0)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to '2498c22fa0a2b560491bc503fa676585c1a603d0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 2498c22fa0a GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)

configure: WARNING: using cross tools not prefixed with host triplet
configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)
../../configure: line 32078: test: : integer expression expected
../../configure: line 32153: test: : integer expression expected

In file included from ../../Python/ceval.c:946:
../../Python/generated_cases.c.h:6522:41: warning: code will never be executed [-Wunreachable-code]
 6522 |                     stack_pointer[-1] = kwnames;
      |                                         ^~~~~~~
../../Python/generated_cases.c.h:6116:21: warning: code will never be executed [-Wunreachable-code]
 6116 |                     _PyFrame_SetStackPointer(frame, stack_pointer);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
../../Python/generated_cases.c.h:3814:21: warning: code will never be executed [-Wunreachable-code]
 3814 |                     _PyFrame_SetStackPointer(frame, stack_pointer);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
../../Python/generated_cases.c.h:3477:21: warning: code will never be executed [-Wunreachable-code]
 3477 |                     _PyFrame_SetStackPointer(frame, stack_pointer);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
../../Python/generated_cases.c.h:3355:21: warning: code will never be executed [-Wunreachable-code]
 3355 |                     _PyFrame_SetStackPointer(frame, stack_pointer);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
../../Python/generated_cases.c.h:2984:21: warning: code will never be executed [-Wunreachable-code]
 2984 |                     _PyFrame_SetStackPointer(frame, stack_pointer);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
../../Python/generated_cases.c.h:2716:41: warning: code will never be executed [-Wunreachable-code]
 2716 |                     stack_pointer[-1] = kwnames;
      |                                         ^~~~~~~
../../Python/generated_cases.c.h:2112:21: warning: code will never be executed [-Wunreachable-code]
 2112 |                     _PyFrame_SetStackPointer(frame, stack_pointer);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
../../Python/generated_cases.c.h:1992:21: warning: code will never be executed [-Wunreachable-code]
 1992 |                     _PyFrame_SetStackPointer(frame, stack_pointer);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
../../Python/generated_cases.c.h:1880:21: warning: code will never be executed [-Wunreachable-code]
 1880 |                     _PyFrame_SetStackPointer(frame, stack_pointer);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
../../Python/generated_cases.c.h:1352:21: warning: code will never be executed [-Wunreachable-code]
 1352 |                     _PyFrame_SetStackPointer(frame, stack_pointer);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
../../Python/generated_cases.c.h:1187:17: warning: code will never be executed [-Wunreachable-code]
 1187 |                 _PyFrame_SetStackPointer(frame, stack_pointer);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
../../Python/generated_cases.c.h:1042:17: warning: code will never be executed [-Wunreachable-code]
 1042 |                 _PyFrame_SetStackPointer(frame, stack_pointer);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
13 warnings generated.
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:130:11: warning: 'htole32' macro redefined [-Wmacro-redefined]
  130 | #  define htole32(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:43:9: note: previous definition is here
   43 | #define htole32(x) (uint32_t)(x)
      |         ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:131:11: warning: 'le32toh' macro redefined [-Wmacro-redefined]
  131 | #  define le32toh(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:44:9: note: previous definition is here
   44 | #define le32toh(x) (uint32_t)(x)
      |         ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:132:11: warning: 'htobe32' macro redefined [-Wmacro-redefined]
  132 | #  define htobe32(x)                                                           \
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:37:9: note: previous definition is here
   37 | #define htobe32(x) __bswap32(x)
      |         ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:138:11: warning: 'be32toh' macro redefined [-Wmacro-redefined]
  138 | #  define be32toh(x) (htobe32((x)))
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:38:9: note: previous definition is here
   38 | #define be32toh(x) __bswap32(x)
      |         ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:140:11: warning: 'htole64' macro redefined [-Wmacro-redefined]
  140 | #  define htole64(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:45:9: note: previous definition is here
   45 | #define htole64(x) (uint64_t)(x)
      |         ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:141:11: warning: 'le64toh' macro redefined [-Wmacro-redefined]
  141 | #  define le64toh(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:46:9: note: previous definition is here
   46 | #define le64toh(x) (uint64_t)(x)
      |         ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:142:11: warning: 'htobe64' macro redefined [-Wmacro-redefined]
  142 | #  define htobe64(x)                                                           \
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:39:9: note: previous definition is here
   39 | #define htobe64(x) __bswap64(x)
      |         ^
In file included from ../../Modules/md5module.c:46:
In file included from ../../Modules/_hacl/Hacl_Hash_MD5.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:149:11: warning: 'be64toh' macro redefined [-Wmacro-redefined]
  149 | #  define be64toh(x) (htobe64((x)))
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:40:9: note: previous definition is here
   40 | #define be64toh(x) __bswap64(x)
      |         ^
8 warnings generated.
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:130:11: warning: 'htole32' macro redefined [-Wmacro-redefined]
  130 | #  define htole32(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:43:9: note: previous definition is here
   43 | #define htole32(x) (uint32_t)(x)
      |         ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:131:11: warning: 'le32toh' macro redefined [-Wmacro-redefined]
  131 | #  define le32toh(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:44:9: note: previous definition is here
   44 | #define le32toh(x) (uint32_t)(x)
      |         ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:132:11: warning: 'htobe32' macro redefined [-Wmacro-redefined]
  132 | #  define htobe32(x)                                                           \
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:37:9: note: previous definition is here
   37 | #define htobe32(x) __bswap32(x)
      |         ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:138:11: warning: 'be32toh' macro redefined [-Wmacro-redefined]
  138 | #  define be32toh(x) (htobe32((x)))
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:38:9: note: previous definition is here
   38 | #define be32toh(x) __bswap32(x)
      |         ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:140:11: warning: 'htole64' macro redefined [-Wmacro-redefined]
  140 | #  define htole64(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:45:9: note: previous definition is here
   45 | #define htole64(x) (uint64_t)(x)
      |         ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:141:11: warning: 'le64toh' macro redefined [-Wmacro-redefined]
  141 | #  define le64toh(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:46:9: note: previous definition is here
   46 | #define le64toh(x) (uint64_t)(x)
      |         ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:142:11: warning: 'htobe64' macro redefined [-Wmacro-redefined]
  142 | #  define htobe64(x)                                                           \
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:39:9: note: previous definition is here
   39 | #define htobe64(x) __bswap64(x)
      |         ^
In file included from ../../Modules/sha1module.c:47:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA1.h:35:
In file incl
628C
uded from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:149:11: warning: 'be64toh' macro redefined [-Wmacro-redefined]
  149 | #  define be64toh(x) (htobe64((x)))
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:40:9: note: previous definition is here
   40 | #define be64toh(x) __bswap64(x)
      |         ^
8 warnings generated.
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:130:11: warning: 'htole32' macro redefined [-Wmacro-redefined]
  130 | #  define htole32(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:43:9: note: previous definition is here
   43 | #define htole32(x) (uint32_t)(x)
      |         ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:131:11: warning: 'le32toh' macro redefined [-Wmacro-redefined]
  131 | #  define le32toh(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:44:9: note: previous definition is here
   44 | #define le32toh(x) (uint32_t)(x)
      |         ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:132:11: warning: 'htobe32' macro redefined [-Wmacro-redefined]
  132 | #  define htobe32(x)                                                           \
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:37:9: note: previous definition is here
   37 | #define htobe32(x) __bswap32(x)
      |         ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:138:11: warning: 'be32toh' macro redefined [-Wmacro-redefined]
  138 | #  define be32toh(x) (htobe32((x)))
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:38:9: note: previous definition is here
   38 | #define be32toh(x) __bswap32(x)
      |         ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:140:11: warning: 'htole64' macro redefined [-Wmacro-redefined]
  140 | #  define htole64(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:45:9: note: previous definition is here
   45 | #define htole64(x) (uint64_t)(x)
      |         ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:141:11: warning: 'le64toh' macro redefined [-Wmacro-redefined]
  141 | #  define le64toh(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:46:9: note: previous definition is here
   46 | #define le64toh(x) (uint64_t)(x)
      |         ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:142:11: warning: 'htobe64' macro redefined [-Wmacro-redefined]
  142 | #  define htobe64(x)                                                           \
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:39:9: note: previous definition is here
   39 | #define htobe64(x) __bswap64(x)
      |         ^
In file included from ../../Modules/sha3module.c:59:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA3.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:149:11: warning: 'be64toh' macro redefined [-Wmacro-redefined]
  149 | #  define be64toh(x) (htobe64((x)))
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:40:9: note: previous definition is here
   40 | #define be64toh(x) __bswap64(x)
      |         ^
8 warnings generated.
../../Modules/_hacl/Lib_Memzero0.c:52:6: warning: "Your platform does not support any safe implementation of memzero -- consider a pull request!" [-W#warnings]
   52 |     #warning "Your platform does not support any safe implementation of memzero -- consider a pull request!"
      |      ^
../../Modules/_hacl/Lib_Memzero0.c:40:10: warning: unused variable 'len_' [-Wunused-variable]
   40 |   size_t len_ = (size_t) len;
      |          ^~~~
2 warnings generated.
../../Modules/expat/xmlparse.c:7870:11: warning: format specifies type 'int' but the argument has type 'ptrdiff_t' (aka 'long') [-Wformat]
 7869 |           " (+" EXPAT_FMT_PTRDIFF_T("6") " bytes %s|%u, xmlparse.c:%d) %*s\"",
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~
 7870 |           bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
      |           ^~~~~~~~~
1 warning generated.
../../Modules/_testcapimodule.c:2422:13: warning: unused function 'finalize_thread_hang_cleanup_callback' [-Wunused-function]
 2422 | static void finalize_thread_hang_cleanup_callback(void *Py_UNUSED(arg)) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
../../Modules/_testcapi/long.c:231:28: warning: comparison of integers of different signs: 'long' and 'digit' (aka 'unsigned int') [-Wsign-compare]
  231 |         if (num < 0 || num >= PyLong_BASE) {
      |                        ~~~ ^  ~~~~~~~~~~~
1 warning generated.
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:130:11: warning: 'htole32' macro redefined [-Wmacro-redefined]
  130 | #  define htole32(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:43:9: note: previous definition is here
   43 | #define htole32(x) (uint32_t)(x)
      |         ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:131:11: warning: 'le32toh' macro redefined [-Wmacro-redefined]
  131 | #  define le32toh(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:44:9: note: previous definition is here
   44 | #define le32toh(x) (uint32_t)(x)
      |         ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:132:11: warning: 'htobe32' macro redefined [-Wmacro-redefined]
  132 | #  define htobe32(x)                                                           \
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:37:9: note: previous definition is here
   37 | #define htobe32(x) __bswap32(x)
      |         ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:138:11: warning: 'be32toh' macro redefined [-Wmacro-redefined]
  138 | #  define be32toh(x) (htobe32((x)))
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:38:9: note: previous definition is here
   38 | #define be32toh(x) __bswap32(x)
      |         ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:140:11: warning: 'htole64' macro redefined [-Wmacro-redefined]
  140 | #  define htole64(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:45:9: note: previous definition is here
   45 | #define htole64(x) (uint64_t)(x)
      |         ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:141:11: warning: 'le64toh' macro redefined [-Wmacro-redefined]
  141 | #  define le64toh(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:46:9: note: previous definition is here
   46 | #define le64toh(x) (uint64_t)(x)
      |         ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:142:11: warning: 'htobe64' macro redefined [-Wmacro-redefined]
  142 | #  define htobe64(x)                                                           \
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:39:9: note: previous definition is here
   39 | #define htobe64(x) __bswap64(x)
      |         ^
In file included from ../../Modules/sha2module.c:48:
In file included from ../../Modules/_hacl/Hacl_Hash_SHA2.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:149:11: warning: 'be64toh' macro redefined [-Wmacro-redefined]
  149 | #  define be64toh(x) (htobe64((x)))
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:40:9: note: previous definition is here
   40 | #define be64toh(x) __bswap64(x)
      |         ^
In file included from ../../Modules/blake2module.c:136:
In file included from ../../Modules/_hacl/Hacl_Hash_Blake2b.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:130:11: warning: 'htole32' macro redefined [-Wmacro-redefined]
  130 | #  define htole32(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:43:9: note: previous definition is here
   43 | #define htole32(x) (uint32_t)(x)
      |         ^
In file included from ../../Modules/blake2module.c:136:
In file included from ../../Modules/_hacl/Hacl_Hash_Blake2b.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:131:11: warning: 'le32toh' macro redefined [-Wmacro-redefined]
  131 | #  define le32toh(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:44:9: note: previous definition is here
   44 | #define le32toh(x) (uint32_t)(x)
      |         ^
In file included from ../../Modules/blake2module.c:136:
In file included from ../../Modules/_hacl/Hacl_Hash_Blake2b.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:132:11: warning: 'htobe32' macro redefined [-Wmacro-redefined]
  132 | #  define htobe32(x)                                                           \
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:37:9: note: previous definition is here
   37 | #define htobe32(x) __bswap32(x)
      |         ^
In file included from ../../Modules/blake2module.c:136:
In file included from ../../Modules/_hacl/Hacl_Hash_Blake2b.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:138:11: warning: 'be32toh' macro redefined [-Wmacro-redefined]
  138 | #  define be32toh(x) (htobe32((x)))
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:38:9: note: previous definition is here
   38 | #define be32toh(x) __bswap32(x)
      |         ^
In file included from ../../Modules/blake2module.c:136:
In file included from ../../Modules/_hacl/Hacl_Hash_Blake2b.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:140:11: warning: 'htole64' macro redefined [-Wmacro-redefined]
  140 | #  define htole64(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:45:9: note: previous definition is here
   45 | #define htole64(x) (uint64_t)(x)
      |         ^
In file included from ../../Modules/blake2module.c:136:
In file included from ../../Modules/_hacl/Hacl_Hash_Blake2b.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:141:11: warning: 'le64toh' macro redefined [-Wmacro-redefined]
  141 | #  define le64toh(x) (x)
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:46:9: note: previous definition is here
   46 | #define le64toh(x) (uint64_t)(x)
      |         ^
In file included from ../../Modules/blake2module.c:136:
In file included from ../../Modules/_hacl/Hacl_Hash_Blake2b.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:142:11: warning: 'htobe64' macro redefined [-Wmacro-redefined]
  142 | #  define htobe64(x)                                                           \
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:39:9: note: previous definition is here
   39 | #define htobe64(x) __bswap64(x)
      |         ^
In file included from ../../Modules/blake2module.c:136:
In file included from ../../Modules/_hacl/Hacl_Hash_Blake2b.h:35:
In file included from ../../Modules/_hacl/include/krml/types.h:12:
../../Modules/_hacl/include/krml/lowstar_endianness.h:149:11: warning: 'be64toh' macro redefined [-Wmacro-redefined]
  149 | #  define be64toh(x) (htobe64((x)))
      |           ^
/opt/wasi-sdk-21.0/bin/../share/wasi-sysroot/include/endian.h:40:9: note: previous definition is here
   40 | #define be64toh(x) __bswap64(x)
      |         ^
8 warnings generated.
8 warnings generated.

make: *** [Makefile:2294: buildbottest] Error 2

Cannot open file '/home/buildbot/buildarea/3.x.bcannon-wasi.wasi.debug/build/build/cross-build/wasm32-wasip1/test-results.xml' for upload

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Windows Server 2022 NoGIL 3.x has failed when building commit 2498c22.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1241/builds/4656) and take a look at the build logs.
  4. Check if the failure is related to this commit (2498c22) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1241/builds/4656

Failed tests:

  • test_capi

Failed subtests:

  • test_trashcan_python_class1 - test.test_capi.test_misc.CAPITest.test_trashcan_python_class1
  • test_trashcan_python_class2 - test.test_capi.test_misc.CAPITest.test_trashcan_python_class2

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "C:\Users\Administrator\buildarea\3.x.itamaro-win64-srv-22-aws.x64.nogil\build\Lib\test\test_capi\test_misc.py", line 421, in test_trashcan_python_class2
    self.do_test_trashcan_python_class(MyList)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "C:\Users\Administrator\buildarea\3.x.itamaro-win64-srv-22-aws.x64.nogil\build\Lib\test\test_capi\test_misc.py", line 449, in do_test_trashcan_python_class
    self.assertEqual(PyList.num, 0)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
AssertionError: 32295 != 0


Traceback (most recent call last):
  File "<string>", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 813, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1056, in create_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
ImportError: module _test_module_state_shared does not support loading in subinterpreters
xpected failure


Traceback (most recent call last):
  File "C:\Users\Administrator\buildarea\3.x.itamaro-win64-srv-22-aws.x64.nogil\build\Lib\test\test_capi\test_misc.py", line 416, in test_trashcan_python_class1
    self.do_test_trashcan_python_class(list)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "C:\Users\Administrator\buildarea\3.x.itamaro-win64-srv-22-aws.x64.nogil\build\Lib\test\test_capi\test_misc.py", line 449, in do_test_trashcan_python_class
    self.assertEqual(PyList.num, 0)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
AssertionError: 30365 != 0


Traceback (most recent call last):
  File "C:\Users\Administrator\buildarea\3.x.itamaro-win64-srv-22-aws.x64.nogil\build\Lib\test\test_capi\test_misc.py", line 416, in test_trashcan_python_class1
    self.do_test_trashcan_python_class(list)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "C:\Users\Administrator\buildarea\3.x.itamaro-win64-srv-22-aws.x64.nogil\build\Lib\test\test_capi\test_misc.py", line 449, in do_test_trashcan_python_class
    self.assertEqual(PyList.num, 0)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
AssertionError: 60728 != 0

@brettcannon
Copy link
Member

Hi! The buildbot wasm32-wasi 3.x has failed when building commit 2498c22.

@markshannon if you look at line 427 of https://buildbot.python.org/#/builders/1046/builds/7562/steps/8/logs/stdio you will see that test_super_deep nows stack overflows.

@brettcannon
Copy link
Member

I opened #130319 and assigned it to @markshannon .

@freakboy3742
Copy link
Contributor

This also appears to have caused a failure on the iOS buildbot (masked because there was an existing failure with the colorise tests). However, this build, triggered by the merge of this PR is the first one that has a failure in test_sys

======================================================================FAIL: test_getallocatedblocks (test.test_sys.SysModuleTest.test_getallocatedblocks)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/8A66533E-162E-4905-BE21-60D36FEECA7F/data/Containers/Bundle/Application/AB83D4DE-36DA-4FB0-ADE1-C02F896A0910/iOSTestbed.app/python/lib/python3.14/test/test_sys.py", line 1104, in test_getallocatedblocks
    self.assertLess(a, sys.gettotalrefcount())
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 592882 not less than 517807
----------------------------------------------------------------------

@freakboy3742
Copy link
Contributor

@markshannon Looking into the iOS failure - the comment before the test that is failing says:

            # While we could imagine a Python session where the number of
            # multiple buffer objects would exceed the sharing of references,
            # it is unlikely to happen in a normal test run.

What constitutes "normal" here? Is it possible a sequential, single process run (i.e., how iOS runs the test suite) might trigger this? I'm a bit out my depth here on diagnosing the cause of this one, so any pointers or suggestions for possible causes would be most welcome.

@markshannon
Copy link
Member Author

sys.gettotalrefcount() is the total refcount per interpreter, but sys.getallocatedblocks() seems to be the total number of allocated blocks per process. If multiple interpreters were involved, I could see this test failing. Otherwise, it is puzzling.

This PR does no refcounting, allocation or deallocation.
My guess is that this PR is exposing an already existing miscounting of references when a recursion error occurs. Just a guess though.

@freakboy3742
Copy link
Contributor

@markshannon I've opened #130384 to track the problem. Annoyingly, I can't reproduce this locally - the test passes reliably on my own iOS test setup.

encukou added a commit to encukou/cpython that referenced this pull request Feb 21, 2025
… counters. (pythonGH-130007)" for now

Unfortunatlely, the change broke some buildbots.

This reverts commit 2498c22.
encukou added a commit that referenced this pull request Feb 24, 2025
… not counters. (GH-130007)" for now (GH130413)

Revert "GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)" for now

Unfortunatlely, the change broke some buildbots.

This reverts commit 2498c22.
markshannon added a commit to faster-cpython/cpython that referenced this pull request Feb 24, 2025
…its using addresses, not counters. (pythonGH-130007)" for now (GH130413)"

This reverts commit ef29104.
@markshannon markshannon deleted the c-recursion-limit branch February 25, 2025 09:23
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
…g addresses, not counters. (pythonGH-130007)" for now (GH130413)

Revert "pythonGH-91079: Implement C stack limits using addresses, not counters. (pythonGH-130007)" for now

Unfortunatlely, the change broke some buildbots.

This reverts commit 2498c22.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack overflow collecting PGO data on Windows
8 participants
0