0
0
mirror of https://github.com/python/cpython.git synced 2024-11-24 00:38:00 +01:00
cpython/Misc/NEWS.d
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
..
next
3.5.0.rst
3.5.0a1.rst
3.5.0a2.rst
3.5.0a3.rst
3.5.0a4.rst
3.5.0b1.rst
3.5.0b2.rst
3.5.0b3.rst
3.5.0b4.rst
3.5.0rc1.rst
3.5.0rc2.rst
3.5.0rc3.rst
3.5.0rc4.rst
3.5.1.rst
3.5.1rc1.rst
3.5.2.rst
3.5.2rc1.rst
3.5.3.rst
3.5.3rc1.rst
3.5.4.rst
3.5.4rc1.rst
3.5.5.rst
3.5.5rc1.rst
3.6.0.rst
3.6.0a1.rst
3.6.0a2.rst
3.6.0a3.rst
3.6.0a4.rst
3.6.0b1.rst
3.6.0b2.rst
3.6.0b3.rst
3.6.0b4.rst
3.6.0rc1.rst
3.6.0rc2.rst
3.6.1.rst
3.6.1rc1.rst
3.6.2.rst
3.6.2rc1.rst
3.6.2rc2.rst
3.6.3.rst
3.6.3rc1.rst
3.6.4.rst
3.6.4rc1.rst
3.6.5.rst
3.6.5rc1.rst
3.6.6.rst
3.6.6rc1.rst
3.7.0.rst
3.7.0a1.rst
3.7.0a2.rst
3.7.0a3.rst
3.7.0a4.rst
3.7.0b1.rst
3.7.0b2.rst
3.7.0b3.rst
3.7.0b4.rst
3.7.0b5.rst
3.7.0rc1.rst
3.8.0a1.rst
3.8.0a2.rst
3.8.0a3.rst
3.8.0a4.rst
3.8.0b1.rst
3.9.0a1.rst
3.9.0a2.rst
3.9.0a3.rst
3.9.0a4.rst
3.9.0a5.rst
3.9.0a6.rst
3.9.0b1.rst
3.10.0a1.rst
3.10.0a2.rst
3.10.0a3.rst
3.10.0a4.rst
3.10.0a5.rst
3.10.0a6.rst
3.10.0a7.rst
3.10.0b1.rst
3.11.0a1.rst
3.11.0a2.rst
3.11.0a3.rst
3.11.0a4.rst
3.11.0a5.rst
3.11.0a6.rst
3.11.0a7.rst
3.11.0b1.rst
3.12.0a1.rst
3.12.0a2.rst
3.12.0a3.rst
3.12.0a4.rst
3.12.0a5.rst
3.12.0a6.rst
3.12.0a7.rst
3.12.0b1.rst
3.13.0a1.rst
3.13.0a2.rst
3.13.0a3.rst
3.13.0a4.rst
3.13.0a5.rst
3.13.0a6.rst
3.13.0b1.rst
3.14.0a1.rst