0
0
mirror of https://github.com/python/cpython.git synced 2024-11-24 00:38:00 +01:00
cpython/Misc
George Alexopoulos 8717f792f7
gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555)
For dlsym(), a return value of NULL does not necessarily indicate
an error [1].

Therefore, to avoid using stale (or NULL) dlerror() values, we must:

 1. clear the previous error state by calling dlerror()
 2. call dlsym()
 3. call dlerror()

If the return value of dlerror() is not NULL, an error occured.

In ctypes we choose to treat a NULL return value from dlsym()
as a "not found" error. This is the same as the fallback
message we use on Windows, Cygwin or when getting/formatting
the error reason fails.

[1]: https://man7.org/linux/man-pages/man3/dlsym.3.html

Signed-off-by: Georgios Alexopoulos <grgalex42@gmail.com>
Signed-off-by: Georgios Alexopoulos <grgalex@ba.uoa.gr>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-11-15 11:05:51 +01:00
..
NEWS.d gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555) 2024-11-15 11:05:51 +01:00
rhel7
ACKS gh-71936: Fix race condition in multiprocessing.Pool (GH-124973) 2024-11-13 10:25:10 +01:00
externals.spdx.json
HISTORY
indent.pro
platform_triplet.c
Porting
python-config.in
python-config.sh.in
python-embed.pc.in
python.man
python.pc.in
README gh-124457: Remove coverity from CPython repo (GH-124460) 2024-09-27 13:42:32 -07:00
README.AIX
README.valgrind
sbom.spdx.json gh-126433: Update hacl-star (GH-126791) 2024-11-15 00:22:50 +00:00
SpecialBuilds.txt
stable_abi.toml gh-121654: Add PyType_Freeze() function (#122457) 2024-10-25 11:12:48 +02:00
svnmap.txt
valgrind-python.supp
vgrindefs

Python Misc subdirectory
========================

This directory contains files that wouldn't fit in elsewhere.  Some
documents are only of historic importance.

Files found here
----------------

ACKS                    Acknowledgements
HISTORY                 News from previous releases -- oldest last
indent.pro              GNU indent profile approximating my C style
NEWS                    News for this release (for some meaning of "this")
Porting                 Mini-FAQ on porting to new platforms
python-config.in        Python script template for python-config
python.man              UNIX man page for the python interpreter
python.pc.in            Package configuration info template for pkg-config
README                  The file you're reading now
README.AIX              Information about using Python on AIX
README.valgrind         Information for Valgrind users, see valgrind-python.supp
SpecialBuilds.txt       Describes extra symbols you can set for debug builds
svnmap.txt              Map of old SVN revs and branches to hg changeset ids,
                        help history-digging
valgrind-python.supp    Valgrind suppression file, see README.valgrind
vgrindefs               Python configuration for vgrind (a generic pretty printer)