Skip to content
New issue

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

gh-110014: Remove PY_TIMEOUT_MAX from limited C API #110217

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Oct 2, 2023

If the timeout is greater than PY_TIMEOUT_MAX,
PyThread_acquire_lock_timed() uses a timeout of PY_TIMEOUT_MAX microseconds, which is around 280.6 years. This case is unlikely and limiting a timeout to 280.6 years sounds like a reasonable trade-off.

The constant PY_TIMEOUT_MAX is not used in PyPI top 5,000 projects.


📚 Documentation preview 📚: https://cpython-previews--110217.org.readthedocs.build/

@vstinner vstinner requested review from a team and encukou as code owners October 2, 2023 11:45
@vstinner
Copy link
Member Author

vstinner commented Oct 2, 2023

I fixed the PyThread_acquire_lock_timed() undefined behavior for very long timeout in Python 3.11 with commit 37b8294:

commit 37b8294d6295ca12553fd7c98778be71d24f4b24
Author: Victor Stinner <vstinner@python.org>
Date:   Thu Sep 30 10:16:51 2021 +0200

    bpo-41710: PyThread_acquire_lock_timed() clamps the timout (GH-28643)
    
    PyThread_acquire_lock_timed() now clamps the timeout into the
    [_PyTime_MIN; _PyTime_MAX] range (_PyTime_t type) if it is too large,
    rather than calling Py_FatalError() which aborts the process.
    
    PyThread_acquire_lock_timed() no longer uses
    MICROSECONDS_TO_TIMESPEC() to compute sem_timedwait() argument, but
    _PyTime_GetSystemClock() and _PyTime_AsTimespec_truncate().
    
    Fix _thread.TIMEOUT_MAX value on Windows: the maximum timeout is
    0x7FFFFFFF milliseconds (around 24.9 days), not 0xFFFFFFFF
    milliseconds (around 49.7 days).
    
    Set PY_TIMEOUT_MAX to 0x7FFFFFFF milliseconds, rather than 0xFFFFFFFF
    milliseconds.
    
    Fix PY_TIMEOUT_MAX overflow test: replace (us >= PY_TIMEOUT_MAX) with
    (us > PY_TIMEOUT_MAX).

The follow-up commit e444752 move to code to pytime.c.

@vstinner vstinner changed the title gh-:110014 Remove PY_TIMEOUT_MAX from limited C API gh-110014: Remove PY_TIMEOUT_MAX from limited C API Oct 2, 2023
@vstinner vstinner force-pushed the remove_timeout_max branch from 6e0bc01 to 420c75c Compare October 2, 2023 11:50
If the timeout is greater than PY_TIMEOUT_MAX,
PyThread_acquire_lock_timed() uses a timeout of PY_TIMEOUT_MAX
microseconds, which is around 280.6 years. This case is unlikely and
limiting a timeout to 280.6 years sounds like a reasonable trade-off.

The constant PY_TIMEOUT_MAX is not used in PyPI top 5,000 projects.
@vstinner vstinner force-pushed the remove_timeout_max branch from 420c75c to 2388358 Compare October 2, 2023 12:14
@vstinner vstinner merged commit 4d0d1c3 into python:main Oct 2, 2023
@vstinner vstinner deleted the remove_timeout_max branch October 2, 2023 16:07
@bedevere-bot
Copy link

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

Hi! The buildbot ARM64 macOS 3.x has failed when building commit 4d0d1c3.

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/all/#builders/725/builds/5823) and take a look at the build logs.
  4. Check if the failure is related to this commit (4d0d1c3) 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/all/#builders/725/builds/5823

Failed tests:

  • test_signal

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

==

Click to see traceback logs
remote: Enumerating objects: 17, done.        
remote: Counting objects:   5% (1/17)        
remote: Counting objects:  11% (2/17)        
remote: Counting objects:  17% (3/17)        
remote: Counting objects:  23% (4/17)        
remote: Counting objects:  29% (5/17)        
remote: Counting objects:  35% (6/17)        
remote: Counting objects:  41% (7/17)        
remote: Counting objects:  47% (8/17)        
remote: Counting objects:  52% (9/17)        
remote: Counting objects:  58% (10/17)        
remote: Counting objects:  64% (11/17)        
remote: Counting objects:  70% (12/17)        
remote: Counting objects:  76% (13/17)        
remote: Counting objects:  82% (14/17)        
remote: Counting objects:  88% (15/17)        
remote: Counting objects:  94% (16/17)        
remote: Counting objects: 100% (17/17)        
remote: Counting objects: 100% (17/17), done.        
remote: Compressing objects:   6% (1/15)        
remote: Compressing objects:  13% (2/15)        
remote: Compressing objects:  20% (3/15)        
remote: Compressing objects:  26% (4/15)        
remote: Compressing objects:  33% (5/15)        
remote: Compressing objects:  40% (6/15)        
remote: Compressing objects:  46% (7/15)        
remote: Compressing objects:  53% (8/15)        
remote: Compressing objects:  60% (9/15)        
remote: Compressing objects:  66% (10/15)        
remote: Compressing objects:  73% (11/15)        
remote: Compressing objects:  80% (12/15)        
remote: Compressing objects:  86% (13/15)        
remote: Compressing objects:  93% (14/15)        
remote: Compressing objects: 100% (15/15)        
remote: Compressing objects: 100% (15/15), done.        
remote: Total 17 (delta 2), reused 6 (delta 2), pack-reused 0        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to '4d0d1c3866cc408ff3382a9a0220ac0e4f2b3b34'.

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 4d0d1c3866 gh-110014: Remove PY_TIMEOUT_MAX from limited C API (#110217)
Switched to and reset branch 'main'

In file included from ./Modules/_tkinter.c:52:
In file included from /opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/tk.h:99:
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:131:21: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        int (*free_private)();  /* called to free private storage */
                           ^
                            void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:334:33: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        struct _XImage *(*create_image)();
                                       ^
                                        void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:453:23: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        XID (*resource_alloc)(); /* allocator function */
                             ^
                              void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:471:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        int (*synchandler)();   /* Synchronization handler */
                          ^
                           void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:496:24: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        Bool (*event_vec[128])();  /* vector for wire to event */
                              ^
                               void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:497:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        Status (*wire_vec[128])(); /* vector for event to wire */
                               ^
                                void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:509:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        Bool (**error_vec)();      /* vector for wire to error */
                          ^
                           void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:522:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        int (*savedsynchandler)(); /* user synchandler when Xlib usurps */
                               ^
                                void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:1053:24: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
typedef void (*XIMProc)();
                       ^
                        void
In file included from ./Modules/tkappinit.c:17:
In file included from /opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/tk.h:99:
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:131:21: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        int (*free_private)();  /* called to free private storage */
                           ^
                            void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:334:33: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        struct _XImage *(*create_image)();
                                       ^
                                        void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:453:23: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        XID (*resource_alloc)(); /* allocator function */
                             ^
                              void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:471:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        int (*synchandler)();   /* Synchronization handler */
                          ^
                           void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:496:24: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        Bool (*event_vec[128])();  /* vector for wire to event */
                              ^
                               void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:497:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        Status (*wire_vec[128])(); /* vector for event to wire */
                               ^
                                void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:509:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        Bool (**error_vec)();      /* vector for wire to error */
                          ^
                           void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:522:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
        int (*savedsynchandler)(); /* user synchandler when Xlib usurps */
                               ^
                                void
/opt/homebrew/Cellar/tcl-tk/8.6.13_5/include/tcl-tk/X11/Xlib.h:1053:24: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
typedef void (*XIMProc)();
                       ^
                        void
9 warnings generated.
9 warnings generated.

make: *** [buildbottest] Error 5

@bedevere-bot
Copy link

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

Hi! The buildbot PPC64LE RHEL7 LTO + PGO 3.x has failed when building commit 4d0d1c3.

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/all/#builders/43/builds/4330) and take a look at the build logs.
  4. Check if the failure is related to this commit (4d0d1c3) 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/all/#builders/43/builds/4330

Failed tests:

  • test_socket

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

==

Click to see traceback logs
remote: Enumerating objects: 1488, done.        
remote: Counting objects:   0% (1/934)        
remote: Counting objects:   1% (10/934)        
remote: Counting objects:   2% (19/934)        
remote: Counting objects:   3% (29/934)        
remote: Counting objects:   4% (38/934)        
remote: Counting objects:   5% (47/934)        
remote: Counting objects:   6% (57/934)        
remote: Counting objects:   7% (66/934)        
remote: Counting objects:   8% (75/934)        
remote: Counting objects:   9% (85/934)        
remote: Counting objects:  10% (94/934)        
remote: Counting objects:  11% (103/934)        
remote: Counting objects:  12% (113/934)        
remote: Counting objects:  13% (122/934)        
remote: Counting objects:  14% (131/934)        
remote: Counting objects:  15% (141/934)        
remote: Counting objects:  16% (150/934)        
remote: Counting objects:  17% (159/934)        
remote: Counting objects:  18% (169/934)        
remote: Counting objects:  19% (178/934)        
remote: Counting objects:  20% (187/934)        
remote: Counting objects:  21% (197/934)        
remote: Counting objects:  22% (206/934)        
remote: Counting objects:  23% (215/934)        
remote: Counting objects:  24% (225/934)        
remote: Counting objects:  25% (234/934)        
remote: Counting objects:  26% (243/934)        
remote: Counting objects:  27% (253/934)        
remote: Counting objects:  28% (262/934)        
remote: Counting objects:  29% (271/934)        
remote: Counting objects:  30% (281/934)        
remote: Counting objects:  31% (290/934)        
remote: Counting objects:  32% (299/934)        
remote: Counting objects:  33% (309/934)        
remote: Counting objects:  34% (318/934)        
remote: Counting objects:  35% (327/934)        
remote: Counting objects:  36% (337/934)        
remote: Counting objects:  37% (346/934)        
remote: Counting objects:  38% (355/934)        
remote: Counting objects:  39% (365/934)        
remote: Counting objects:  40% (374/934)        
remote: Counting objects:  41% (383/934)        
remote: Counting objects:  42% (393/934)        
remote: Counting objects:  43% (402/934)        
remote: Counting objects:  44% (411/934)        
remote: Counting objects:  45% (421/934)        
remote: Counting objects:  46% (430/934)        
remote: Counting objects:  47% (439/934)        
remote: Counting objects:  48% (449/934)        
remote: Counting objects:  49% (458/934)        
remote: Counting objects:  50% (467/934)        
remote: Counting objects:  51% (477/934)        
remote: Counting objects:  52% (486/934)        
remote: Counting objects:  53% (496/934)        
remote: Counting objects:  54% (505/934)        
remote: Counting objects:  55% (514/934)        
remote: Counting objects:  56% (524/934)        
remote: Counting objects:  57% (533/934)        
remote: Counting objects:  58% (542/934)        
remote: Counting objects:  59% (552/934)        
remote: Counting objects:  60% (561/934)        
remote: Counting objects:  61% (570/934)        
remote: Counting objects:  62% (580/934)        
remote: Counting objects:  63% (589/934)        
remote: Counting objects:  64% (598/934)        
remote: Counting objects:  65% (608/934)        
remote: Counting objects:  66% (617/934)        
remote: Counting objects:  67% (626/934)        
remote: Counting objects:  68% (636/934)        
remote: Counting objects:  69% (645/934)        
remote: Counting objects:  70% (654/934)        
remote: Counting objects:  71% (664/934)        
remote: Counting objects:  72% (673/934)        
remote: Counting objects:  73% (682/934)        
remote: Counting objects:  74% (692/934)        
remote: Counting objects:  75% (701/934)        
remote: Counting objects:  76% (710/934)        
remote: Counting objects:  77% (720/934)        
remote: Counting objects:  78% (729/934)        
remote: Counting objects:  79% (738/934)        
remote: Counting objects:  80% (748/934)        
remote: Counting objects:  81% (757/934)        
remote: Counting objects:  82% (766/934)        
remote: Counting objects:  83% (776/934)        
remote: Counting objects:  84% (785/934)        
remote: Counting objects:  85% (794/934)        
remote: Counting objects:  86% (804/934)        
remote: Counting objects:  87% (813/934)        
remote: Counting objects:  88% (822/934)        
remote: Counting objects:  89% (832/934)        
remote: Counting objects:  90% (841/934)        
remote: Counting objects:  91% (850/934)        
remote: Counting objects:  92% (860/934)        
remote: Counting objects:  93% (869/934)        
remote: Counting objects:  94% (878/934)        
remote: Counting objects:  95% (888/934)        
remote: Counting objects:  96% (897/934)        
remote: Counting objects:  97% (906/934)        
remote: Counting objects:  98% (916/934)        
remote: Counting objects:  99% (925/934)        
remote: Counting objects: 100% (934/934)        
remote: Counting objects: 100% (934/934), done.        
remote: Compressing objects:   1% (1/61)        
remote: Compressing objects:   3% (2/61)        
remote: Compressing objects:   4% (3/61)        
remote: Compressing objects:   6% (4/61)        
remote: Compressing objects:   8% (5/61)        
remote: Compressing objects:   9% (6/61)        
remote: Compressing objects:  11% (7/61)        
remote: Compressing objects:  13% (8/61)        
remote: Compressing objects:  14% (9/61)        
remote: Compressing objects:  16% (10/61)        
remote: Compressing objects:  18% (11/61)        
remote: Compressing objects:  19% (12/61)        
remote: Compressing objects:  21% (13/61)        
remote: Compressing objects:  22% (14/61)        
remote: Compressing objects:  24% (15/61)        
remote: Compressing objects:  26% (16/61)        
remote: Compressing objects:  27% (17/61)        
remote: Compressing objects:  29% (18/61)        
remote: Compressing objects:  31% (19/61)        
remote: Compressing objects:  32% (20/61)        
remote: Compressing objects:  34% (21/61)        
remote: Compressing objects:  36% (22/61)        
remote: Compressing objects:  37% (23/61)        
remote: Compressing objects:  39% (24/61)        
remote: Compressing objects:  40% (25/61)        
remote: Compressing objects:  42% (26/61)        
remote: Compressing objects:  44% (27/61)        
remote: Compressing objects:  45% (28/61)        
remote: Compressing objects:  47% (29/61)        
remote: Compressing objects:  49% (30/61)        
remote: Compressing objects:  50% (31/61)        
remote: Compressing objects:  52% (32/61)        
remote: Compressing objects:  54% (33/61)        
remote: Compressing objects:  55% (34/61)        
remote: Compressing objects:  57% (35/61)        
remote: Compressing objects:  59% (36/61)        
remote: Compressing objects:  60% (37/61)        
remote: Compressing objects:  62% (38/61)        
remote: Compressing objects:  63% (39/61)        
remote: Compressing objects:  65% (40/61)        
remote: Compressing objects:  67% (41/61)        
remote: Compressing objects:  68% (42/61)        
remote: Compressing objects:  70% (43/61)        
remote: Compressing objects:  72% (44/61)        
remote: Compressing objects:  73% (45/61)        
remote: Compressing objects:  75% (46/61)        
remote: Compressing objects:  77% (47/61)        
remote: Compressing objects:  78% (48/61)        
remote: Compressing objects:  80% (49/61)        
remote: Compressing objects:  81% (50/61)        
remote: Compressing objects:  83% (51/61)        
remote: Compressing objects:  85% (52/61)        
remote: Compressing objects:  86% (53/61)        
remote: Compressing objects:  88% (54/61)        
remote: Compressing objects:  90% (55/61)        
remote: Compressing objects:  91% (56/61)        
remote: Compressing objects:  93% (57/61)        
remote: Compressing objects:  95% (58/61)        
remote: Compressing objects:  96% (59/61)        
remote: Compressing objects:  98% (60/61)        
remote: Compressing objects: 100% (61/61)        
remote: Compressing objects: 100% (61/61), done.        
Receiving objects:   0% (1/1488)   
Receiving objects:   1% (15/1488)   
Receiving objects:   2% (30/1488)   
Receiving objects:   3% (45/1488)   
Receiving objects:   4% (60/1488)   
Receiving objects:   5% (75/1488)   
Receiving objects:   6% (90/1488)   
Receiving objects:   7% (105/1488)   
Receiving objects:   8% (120/1488)   
Receiving objects:   9% (134/1488)   
Receiving objects:  10% (149/1488)   
Receiving objects:  11% (164/1488)   
Receiving objects:  12% (179/1488)   
Receiving objects:  13% (194/1488)   
Receiving objects:  14% (209/1488)   
Receiving objects:  15% (224/1488)   
Receiving objects:  16% (239/1488)   
Receiving objects:  17% (253/1488)   
Receiving objects:  18% (268/1488)   
Receiving objects:  19% (283/1488)   
Receiving objects:  20% (298/1488)   
Receiving objects:  21% (313/1488)   
Receiving objects:  22% (328/1488)   
Receiving objects:  23% (343/1488)   
Receiving objects:  24% (358/1488)   
Receiving objects:  25% (372/1488)   
Receiving objects:  26% (387/1488)   
Receiving objects:  27% (402/1488)   
Receiving objects:  28% (417/1488)   
Receiving objects:  29% (432/1488)   
Receiving objects:  30% (447/1488)   
Receiving objects:  31% (462/1488)   
Receiving objects:  32% (477/1488)   
Receiving objects:  33% (492/1488)   
Receiving objects:  34% (506/1488)   
Receiving objects:  35% (521/1488)   
Receiving objects:  36% (536/1488)   
Receiving objects:  37% (551/1488)   
Receiving objects:  38% (566/1488)   
Receiving objects:  39% (581/1488)   
Receiving objects:  40% (596/1488)   
Receiving objects:  41% (611/1488)   
Receiving objects:  42% (625/1488)   
Receiving objects:  43% (640/1488)   
Receiving objects:  44% (655/1488)   
Receiving objects:  45% (670/1488)   
Receiving objects:  46% (685/1488)   
Receiving objects:  47% (700/1488)   
Receiving objects:  48% (715/1488)   
Receiving objects:  49% (730/1488)   
Receiving objects:  50% (744/1488)   
Receiving objects:  51% (759/1488)   
Receiving objects:  52% (774/1488)   
Receiving objects:  53% (789/1488)   
Receiving objects:  54% (804/1488)   
Receiving objects:  55% (819/1488)   
Receiving objects:  56% (834/1488)   
Receiving objects:  57% (849/1488)   
Receiving objects:  58% (864/1488)   
Receiving objects:  59% (878/1488)   
Receiving objects:  60% (893/1488)   
Receiving objects:  61% (908/1488)   
Receiving objects:  62% (923/1488)   
Receiving objects:  63% (938/1488)   
Receiving objects:  64% (953/1488)   
Receiving objects:  65% (968/1488)   
Receiving objects:  66% (983/1488)   
Receiving objects:  67% (997/1488)   
Receiving objects:  68% (1012/1488)   
Receiving objects:  69% (1027/1488)   
Receiving objects:  70% (1042/1488)   
Receiving objects:  71% (1057/1488)   
Receiving objects:  72% (1072/1488)   
Receiving objects:  73% (1087/1488)   
Receiving objects:  74% (1102/1488)   
Receiving objects:  75% (1116/1488)   
Receiving objects:  76% (1131/1488)   
Receiving objects:  77% (1146/1488)   
Receiving objects:  78% (1161/1488)   
Receiving objects:  79% (1176/1488)   
Receiving objects:  80% (1191/1488)   
Receiving objects:  81% (1206/1488)   
Receiving objects:  82% (1221/1488)   
Receiving objects:  83% (1236/1488)   
Receiving objects:  84% (1250/1488)   
Receiving objects:  85% (1265/1488)   
Receiving objects:  86% (1280/1488)   
Receiving objects:  87% (1295/1488)   
Receiving objects:  88% (1310/1488)   
Receiving objects:  89% (1325/1488)   
Receiving objects:  90% (1340/1488)   
Receiving objects:  91% (1355/1488)   
Receiving objects:  92% (1369/1488)   
Receiving objects:  93% (1384/1488)   
Receiving objects:  94% (1399/1488)   
Receiving objects:  95% (1414/1488)   
Receiving objects:  96% (1429/1488)   
Receiving objects:  97% (1444/1488)   
Receiving objects:  98% (1459/1488)   
Receiving objects:  99% (1474/1488)   
remote: Total 1488 (delta 881), reused 905 (delta 873), pack-reused 554        
Receiving objects: 100% (1488/1488)   
Receiving objects: 100% (1488/1488), 1.77 MiB | 0 bytes/s, done.
Resolving deltas:   0% (0/1138)   
Resolving deltas:   1% (12/1138)   
Resolving deltas:   2% (28/1138)   
Resolving deltas:   3% (40/1138)   
Resolving deltas:   4% (51/1138)   
Resolving deltas:   5% (57/1138)   
Resolving deltas:   7% (80/1138)   
Resolving deltas:   8% (92/1138)   
Resolving deltas:   9% (103/1138)   
Resolving deltas:  10% (114/1138)   
Resolving deltas:  11% (128/1138)   
Resolving deltas:  12% (143/1138)   
Resolving deltas:  13% (149/1138)   
Resolving deltas:  14% (160/1138)   
Resolving deltas:  15% (182/1138)   
Resolving deltas:  16% (186/1138)   
Resolving deltas:  17% (204/1138)   
Resolving deltas:  18% (207/1138)   
Resolving deltas:  19% (217/1138)   
Resolving deltas:  20% (236/1138)   
Resolving deltas:  21% (239/1138)   
Resolving deltas:  22% (255/1138)   
Resolving deltas:  23% (269/1138)   
Resolving deltas:  24% (274/1138)   
Resolving deltas:  25% (285/1138)   
Resolving deltas:  29% (341/1138)   
Resolving deltas:  30% (342/1138)   
Resolving deltas:  32% (374/1138)   
Resolving deltas:  33% (377/1138)   
Resolving deltas:  36% (415/1138)   
Resolving deltas:  37% (424/1138)   
Resolving deltas:  39% (454/1138)   
Resolving deltas:  40% (456/1138)   
Resolving deltas:  41% (475/1138)   
Resolving deltas:  42% (478/1138)   
Resolving deltas:  44% (506/1138)   
Resolving deltas:  45% (513/1138)   
Resolving deltas:  46% (524/1138)   
Resolving deltas:  47% (535/1138)   
Resolving deltas:  48% (552/1138)   
Resolving deltas:  49% (564/1138)   
Resolving deltas:  52% (593/1138)   
Resolving deltas:  53% (611/1138)   
Resolving deltas:  54% (625/1138)   
Resolving deltas:  55% (627/1138)   
Resolving deltas:  56% (640/1138)   
Resolving deltas:  58% (661/1138)   
Resolving deltas:  59% (672/1138)   
Resolving deltas:  60% (691/1138)   
Resolving deltas:  61% (700/1138)   
Resolving deltas:  63% (717/1138)   
Resolving deltas:  64% (733/1138)   
Resolving deltas:  65% (746/1138)   
Resolving deltas:  66% (753/1138)   
Resolving deltas:  67% (765/1138)   
Resolving deltas:  68% (774/1138)   
Resolving deltas:  69% (791/1138)   
Resolving deltas:  70% (797/1138)   
Resolving deltas:  71% (809/1138)   
Resolving deltas:  72% (820/1138)   
Resolving deltas:  73% (831/1138)   
Resolving deltas:  74% (843/1138)   
Resolving deltas:  75% (854/1138)   
Resolving deltas:  76% (866/1138)   
Resolving deltas:  77% (878/1138)   
Resolving deltas:  77% (886/1138)   
Resolving deltas:  78% (888/1138)   
Resolving deltas:  79% (900/1138)   
Resolving deltas:  80% (911/1138)   
Resolving deltas:  81% (922/1138)   
Resolving deltas:  82% (935/1138)   
Resolving deltas:  83% (945/1138)   
Resolving deltas:  84% (956/1138)   
Resolving deltas:  85% (968/1138)   
Resolving deltas:  86% (979/1138)   
Resolving deltas:  87% (991/1138)   
Resolving deltas:  88% (1002/1138)   
Resolving deltas:  89% (1013/1138)   
Resolving deltas:  90% (1025/1138)   
Resolving deltas:  91% (1036/1138)   
Resolving deltas:  91% (1043/1138)   
Resolving deltas:  92% (1048/1138)   
Resolving deltas:  93% (1060/1138)   
Resolving deltas:  94% (1070/1138)   
Resolving deltas:  95% (1082/1138)   
Resolving deltas:  96% (1098/1138)   
Resolving deltas:  97% (1105/1138)   
Resolving deltas:  98% (1116/1138)   
Resolving deltas:  99% (1127/1138)   
Resolving deltas: 100% (1138/1138)   
Resolving deltas: 100% (1138/1138), completed with 384 local objects.
From https://github.com/python/cpython
 * branch            main       -> FETCH_HEAD
 * [new tag]         v3.11.6    -> v3.11.6
Note: checking out '4d0d1c3866cc408ff3382a9a0220ac0e4f2b3b34'.

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 performing another checkout.

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

  git checkout -b new_branch_name

HEAD is now at 4d0d1c3... gh-110014: Remove PY_TIMEOUT_MAX from limited C API (#110217)
Switched to and reset branch 'main'

find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [Makefile:2789: clean-retain-profile] Error 1 (ignored)
./Modules/_testcapi/unicode.c: In function ‘test_string_from_format’:
./Modules/_testcapi/unicode.c:1538:1: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
 test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored))
 ^~~~~~~~~~~~~~~~~~~~~~~
./Modules/_testcapi/unicode.c: In function ‘test_string_from_format’:
./Modules/_testcapi/unicode.c:1538:1: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
 test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored))
 ^
./Modules/_decimal/libmpdec/context.c:57: warning: mpd_setminalloc: ignoring request to set MPD_MINALLOC a second time

./Modules/_decimal/libmpdec/context.c:57: warning: mpd_setminalloc: ignoring request to set MPD_MINALLOC a second time


make: *** [Makefile:2012: buildbottest] Error 5

Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
)

If the timeout is greater than PY_TIMEOUT_MAX,
PyThread_acquire_lock_timed() uses a timeout of PY_TIMEOUT_MAX
microseconds, which is around 280.6 years. This case is unlikely and
limiting a timeout to 280.6 years sounds like a reasonable trade-off.

The constant PY_TIMEOUT_MAX is not used in PyPI top 5,000 projects.
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.

2 participants