Date: Mon, 10 May 2021 23:48:47 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 255698] dlerror() returns non-NULL after a successful call to dlopen()/dlsym() Message-ID: <bug-255698-227-AZtZRGT3WV@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-255698-227@https.bugs.freebsd.org/bugzilla/> References: <bug-255698-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D255698 --- Comment #3 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D630caa95d46191220dd457c2ae2d06460= cb4f71b commit 630caa95d46191220dd457c2ae2d06460cb4f71b Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-05-10 19:02:19 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-05-10 23:47:00 +0000 rtld: preserve the 'seen' state of the dlerror message in errmsg_save() rtld preserves its current error message around calls to user init/fini lists, to not override original error with potential secondary errors caused by user code recursing into rtld. After 4d9128da54f8f8e2a29190, the preservation of the string itself is not enough, the 'seen' indicator must be preserved as well. Otherwise, since new code does not clear string (it cannot), call to _rtld_error() from errmsg_restore() revived whatever message was consumed last. Change errmsg_save() to return structure recording both 'seen' indicator and the message, if any. PR: 255698 Reported by: Eugene M. Kim <astralblue@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 3 days libexec/rtld-elf/rtld.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-255698-227-AZtZRGT3WV>