GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — [3.12] gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555) by picnixz · Pull Request #127764 · python/cpython Conversation
Member
For dlsym(), a return value of NULL does not necessarily indicate Therefore, to avoid using stale (or NULL) dlerror() values, we must:
If the return value of dlerror() is not NULL, an error occured. In ctypes we choose to treat a NULL return value from dlsym() (cherry picked from commit 8717f79) Co-authored-by: George Alexopoulos [email protected]
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…-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 <[email protected]> Signed-off-by: Georgios Alexopoulos <[email protected]> Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
|
There was an error while loading. Please reload this page.
|
I've opened the backport PR so that we are consistent with backporting. But the diff is quite non-trivial since the backport was not automatic. So if you don't want to lose time, we can just say "let's not backport 3.12" (even though you said that you didn't care). I'm marking the PR as a draft so that we don't merge by mistake. EDIT 1: Ok I think I messed up the backport. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @picnixz.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.