summaryrefslogtreecommitdiffstats
path: root/Tools/c-analyzer
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-104614: Make Sure ob_type is Always Set Correctly by ↵Miss Islington (bot)2023-06-011-0/+2
| | | | | | | | | | PyType_Ready() (gh-105122) (gh-105211) When I added the relevant condition to type_ready_set_bases() in gh-103912, I had missed that the function also sets tp_base and ob_type (if necessary). That led to problems for third-party static types. We fix that here, by making those extra operations distinct and by adjusting the condition to be more specific. (cherry picked from commit 1469393) Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
* [3.12] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) ↵Miss Islington (bot)2023-06-011-0/+1
| | | | | | | | | | | | | | | | | | | | (#105199) gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) Upgrade builds to OpenSSL 1.1.1u. This OpenSSL version addresses a pile if less-urgent CVEs since 1.1.1t. The Mac/BuildScript/build-installer.py was already updated. Also updates _ssl_data_111.h from OpenSSL 1.1.1u, _ssl_data_300.h from 3.0.9, and adds a new _ssl_data_31.h file from 3.1.1 along with the ssl.c code to use it. Manual edits to the _ssl_data_300.h file prevent it from removing any existing definitions in case those exist in some peoples builds and were important (avoiding regressions during backporting). backports of this prior to 3.12 will not include the openssl 3.1 header. (cherry picked from commit ede89af605b1c0442353435ad22195c16274f65d) Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
* gh-103295: expose API for writing perf map files (#103546)gsallam2023-05-211-0/+1
| | | | | Co-authored-by: Aniket Panse <aniketpanse@fb.com> Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-104549: Set __module__ on TypeAliasType (#104550)Jelle Zijlstra2023-05-181-0/+1
|
* GH-103092: isolate `pyexpat` (#104506)Kumar Aditya2023-05-161-1/+0
|
* gh-101819: Isolate `_io` (#101948)Erlend E. Aasland2023-05-151-4/+0
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* GH-103082: Filter LINE events in VM, to simplify tool implementation. ↵Mark Shannon2023-05-121-1/+1
| | | | | | | | (GH-104387) When monitoring LINE events, instrument all instructions that can have a predecessor on a different line. Then check that the a new line has been hit in the instrumentation code. This brings the behavior closer to that of 3.11, simplifying implementation and porting of tools.
* gh-99108: Replace SHA3 implementation HACL* version (#103597)Jonathan Protzenko2023-05-081-7/+1
| | | | | | | | | | | Replaces our built-in SHA3 implementation with a verified one from the HACL* project. This implementation is used when OpenSSL does not provide SHA3 or is not present. 3.11 shiped with a very slow tiny sha3 implementation to get off of the <=3.10 reference implementation that wound up having serious bugs. This brings us back to a reasonably performing built-in implementation consistent with what we've just replaced our other guaranteed available standard hash algorithms with: code from the HACL* project. --------- Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-101819: Port _io.PyBytesIOBuffer_Type to heap type (#104264)Erlend E. Aasland2023-05-071-1/+0
|
* gh-101819: Adapt _io.PyWindowsConsoleIO_Type to heap type (#104197)Erlend E. Aasland2023-05-071-1/+0
|
* gh-101819: Port _io.PyIncrementalNewlineDecoder_Type to heap type (#104249)Erlend E. Aasland2023-05-071-1/+0
|
* gh-103533: Use PEP 669 APIs for cprofile (GH-103534)Tian Gao2023-05-051-0/+1
|
* gh-102500: Implement PEP 688 (#102521)Jelle Zijlstra2023-05-042-0/+2
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-98040: Remove just the `imp` module (#98573)Barry Warsaw2023-04-281-1/+0
|
* gh-103583: Isolate CJK codec modules (#103869)Erlend E. Aasland2023-04-271-21/+0
|
* gh-103092: Isolate _ctypes, part 1 (#103893)Erlend E. Aasland2023-04-271-6/+2
| | | | | | | | | Establish global state and port the following types to heap types: - DictRemover_Type - PyCArg_Type - PyCThunk_Type - PyCField_Type - StructParam_Type
* gh-101659: Isolate "obmalloc" State to Each Interpreter (gh-101660)Eric Snow2023-04-241-0/+1
| | | | | | | | | | | | | | This is strictly about moving the "obmalloc" runtime state from `_PyRuntimeState` to `PyInterpreterState`. Doing so improves isolation between interpreters, specifically most of the memory (incl. objects) allocated for each interpreter's use. This is important for a per-interpreter GIL, but such isolation is valuable even without it. FWIW, a per-interpreter obmalloc is the proverbial canary-in-the-coalmine when it comes to the isolation of objects between interpreters. Any object that leaks (unintentionally) to another interpreter is highly likely to cause a crash (on debug builds at least). That's a useful thing to know, relative to interpreter isolation.
* gh-103583: Add codecs and maps to _codecs_* module state (#103540)Erlend E. Aasland2023-04-171-2/+0
|
* gh-103326: Remove `Python/importlib.h` (GH-103331)Nikita Sobolev2023-04-121-1/+0
| | | | Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-103092: Isolate `_collections` (#103093)Erlend E. Aasland2023-04-121-5/+0
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-103082: Implementation of PEP 669: Low Impact Monitoring for CPython ↵Mark Shannon2023-04-121-0/+5
| | | | | | | | | | (GH-103083) * The majority of the monitoring code is in instrumentation.c * The new instrumentation bytecodes are in bytecodes.c * legacy_tracing.c adapts the new API to the old sys.setrace and sys.setprofile APIs
* gh-103334: Ignore `Tools/c-analyzer/cpython/_parser.py` from `patchcheck` ↵Nikita Sobolev2023-04-101-0/+1
| | | | | | | (GH-103335) I've also added a small comment to `Tools/c-analyzer/cpython/_parser.py` to trigger the `patchcheck` CI. It must pass now. Automerge-Triggered-By: GH:ericsnowcurrently
* gh-103092: Isolate `socket` module (#103094)Erlend E. Aasland2023-04-091-6/+0
|
* gh-103092: Isolate `_pickle` module (#102982)Erlend E. Aasland2023-04-041-5/+0
| | | | Co-authored-by: Mohamed Koubaa <koubaa.m@gmail.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-90110: Bring the whitelists up to date. (gh-103114)Eric Snow2023-03-292-2/+3
| | | https://github.com/python/cpython/issues/90110
* GH-100982: Break up COMPARE_AND_BRANCH (GH-102801)Brandt Bucher2023-03-231-1/+0
|
* gh-102033: Fix syntax error in `Tools/c-analyzer` (GH-102066)Nikita Sobolev2023-03-2214-335/+3
| | | The easiest way to format strings with `{}` meaningful chars is via `%`.
* gh-102304: Move _Py_RefTotal to _PyRuntimeState (gh-102543)Eric Snow2023-03-201-1/+1
| | | | | | | The essentially eliminates the global variable, with the associated benefits. This is also a precursor to isolating this bit of state to PyInterpreterState. Folks that currently read _Py_RefTotal directly would have to start using _Py_GetGlobalRefTotal() instead. https://github.com/python/cpython/issues/102304
* gh-102737: Un-ignore ceval.c in the CI globals check (gh-102745)Eric Snow2023-03-162-7/+7
| | | | | The tool now allows user-added #LINE preprocessor directives. https://github.com/python/cpython/issues/102737
* Exclude `ceval.c` from the C-analyzer tool (#102735)Alex Waygood2023-03-151-0/+5
| | | | | | | | | | The "check if generated files are up to date" CI check appears to be currently failing on all PRs (but not on pushes to main) See, for example: - https://github.com/python/cpython/pull/94468 - https://github.com/python/cpython/pull/94468 - https://github.com/python/cpython/pull/102731 This appears to be because the C-analyzer tool doesn't like the `#line` directives introduced in https://github.com/python/cpython/commit/70185de1abfe428049a5c43d58fcb656b46db96c. I'm advised by the message printed to the terminal in https://github.com/python/cpython/actions/runs/4428706945/jobs/7768216988#step:14:84 that this is the appropriate short-term fix!
* gh-81057: Add a CI Check for New Unsupported C Global Variables (gh-102506)Eric Snow2023-03-145-20/+81
| | | | | | | | | | | This will keep us from adding new unsupported (i.e. non-const) C global variables, which would break interpreter isolation. FYI, historically it is very uncommon for new global variables to get added. Furthermore, it is rare for new code to break the c-analyzer. So the check should almost always pass unnoticed. Note that I've removed test_check_c_globals. A test wasn't a great fit conceptually and was super slow on debug builds. A CI check is a better fit. This also resolves gh-100237. https://github.com/python/cpython/issues/81057
* gh-81057: Vendor a Subset of distutils for the c-analyzer Tool (gh-102505)Eric Snow2023-03-0915-0/+2301
| | | | | distutils was removed in November. However, the c-analyzer relies on it. To solve that here, we vendor the parts the tool needs so it can be run against 3.12+. (Also see gh-92584.) Note that we may end up removing this code later in favor of a solution in common with the peg_generator tool (which also relies on distutils). At the least, the copy here makes sure the c-analyzer tool works on 3.12+ in the meantime.
* gh-90110: Fix the c-analyzer Tool (#102483)Eric Snow2023-03-076-21/+70
| | | | | | | Some incompatible changes had gone in, and the "ignore" lists weren't properly undated. This change fixes that. It's necessary prior to enabling test_check_c_globals, which I hope to do soon. Note that this does include moving last_resort_memory_error to PyInterpreterState. https://github.com/python/cpython/issues/90110
* gh-101819: Adapt _io types to heap types, batch 1 (GH-101949)Erlend E. Aasland2023-02-201-8/+0
| | | | | Adapt StringIO, TextIOWrapper, FileIO, Buffered*, and BytesIO types. Automerge-Triggered-By: GH:erlend-aasland
* gh-99138: Isolate _zoneinfo (#99218)Erlend E. Aasland2023-02-151-11/+0
| | | | * Convert zone info type to heap type and add it to module state * Add global variables to module state
* gh-101277: Finalise isolating itertools (GH-101305)Erlend E. Aasland2023-02-101-22/+0
| | | | | Add repeat, islice, chain, tee, teedataobject, and batched types to module state. Automerge-Triggered-By: GH:erlend-aasland
* GH-91375: Purge `asyncio` static variables from globals-to-fix list (#101288)Erlend E. Aasland2023-01-241-23/+0
|
* GH-92123: Move _elementtree heap types to module state (#101187)Erlend E. Aasland2023-01-211-4/+0
|
* GH-100997: Implement Multi-Phase Init for the _testinternalcapi Module ↵Eric Snow2023-01-122-3/+0
| | | | | | | (gh-100998) _testinternalcapi is an internal module used for testing. https://github.com/python/cpython/issues/100997
* gh-100540: Remove obsolete Modules/_ctypes/darwin/ dlfcn shim (GH-100541)Zachary Ware2022-12-291-1/+0
| | | As far as I can tell, this hasn't been actually used since Mac OS X 10.2.
* gh-100540: Remove unused Modules/_ctypes/libffi_osx/ (GH-100543)Zachary Ware2022-12-281-1/+0
| | | | It was an ancient, modified copy of libffi that has not been in use since GH-22855.
* gh-81057: Move the Cached Parser Dummy Name to _PyRuntimeState (#100277)Eric Snow2022-12-161-4/+0
|
* gh-81057: Move _Py_RefTotal to the "Ignored Globals" List (gh-100203)Eric Snow2022-12-122-4/+7
| | | | | We can't move it to _PyRuntimeState because the symbol is exposed in the stable ABI. We'll have to sort that out before a per-interpreter GIL, but it shouldn't be too hard. https://github.com/python/cpython/issues/81057
* gh-81057: Move Signal-Related Globals to _PyRuntimeState (gh-100085)Eric Snow2022-12-121-7/+1
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move faulthandler Globals to _PyRuntimeState (gh-100152)Eric Snow2022-12-122-10/+1
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move tracemalloc Globals to _PyRuntimeState (gh-100151)Eric Snow2022-12-121-11/+0
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move Threading-Related Globals to _PyRuntimeState (#100084)Eric Snow2022-12-092-6/+2
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move Ceval Trampoline Globals to _PyRuntimeState (gh-100083)Eric Snow2022-12-091-13/+1
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move time Globals to _PyRuntimeState (gh-100122)Eric Snow2022-12-081-6/+0
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move OS-Related Globals to _PyRuntimeState (gh-100082)Eric Snow2022-12-082-5/+6
| | | https://github.com/python/cpython/issues/81057