[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: ld-elf.so.1: assert failed: /usr/src/libexec/rtld-elf/rtld.c:2033
From:       "Russell L. Carter" <rcarter () pinyon ! org>
Date:       2000-12-30 16:47:16
[Download RAW message or body]


Bingo!

Thanks guys!
Russell


%John Polstra (TrimYourCc@polstra.com) wrote:
%> In article <20001229235450.1A09295@pinyon.org>,
%> Russell L. Carter <rcarter@pinyon.org> wrote:
%> > 
%> > On a fairly recent -STABLE I am getting this failure:
%> > 
%> > ld-elf.so.1: assert failed: /usr/src/libexec/rtld-elf/rtld.c:2033
%> > 
%> > I assume I'm doing something stupid, however the same code
%> > works on Linux gcc-2.95.2, so I'm looking for what the 
%> > difference might be.
%> > 
%> > The program is an ACE/TAO C++ program that dlsym()s an object,
%> > uses it happily, and then gets the assertion when dlclose()ing
%> > from the containing object's dtor. 
%> > 
%> > The assertion is that the refcount != 0.  What should I
%> > do to fix that?
%> 
%> There is a bug in the dynamic linker in connection with calling dlopen
%> or dlclose from a static constructor or destructor, and this sounds
%> like it's related to that.  I came up with a fix for it which Peter
%> Wemm was testing at Yahoo.  That was a few months ago, and I'll have
%> to dig it out again after the holiday madness has subsided.  If you
%> haven't heard from me by Saturday Jan. 6, I'd appreciate a gentle
%> reminder to <jdp@freebsd.org>.
%
%Do you mean this patch?
%--- rtld.c	2000/08/01 07:17:54	1.1.1.3
%+++ rtld.c	2000/09/05 22:16:49	1.2
%@@ -694,7 +694,7 @@
% 	if (obj == (Obj_Entry *) handle)
% 	    break;
% 
%-    if (obj == NULL || obj->dl_refcount == 0) {
%+    if (obj == NULL || obj->refcount == 0 || obj->dl_refcount == 0) {
% 	_rtld_error("Invalid shared object handle %p", handle);
% 	return NULL;
%     }
%@@ -1994,6 +1994,8 @@
% {
%     const Needed_Entry *needed;
% 
%+    if (root->refcount == 0)
%+	return;
%     assert(root->refcount != 0);
%     root->refcount--;
%     if (root->refcount == 0)
%
%-- 
%Paul Saab
%Technical Yahoo
%paul@mu.org - ps@yahoo-inc.com - ps@freebsd.org
%Do You .. uhh .. Yahoo!?
%
%
%To Unsubscribe: send mail to majordomo@FreeBSD.org
%with "unsubscribe freebsd-hackers" in the body of the message
%




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic