From owner-freebsd-questions@FreeBSD.ORG Tue Aug 26 16:01:23 2008 Return-Path: Delivered-To: Freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B62CB106564A for ; Tue, 26 Aug 2008 16:01:23 +0000 (UTC) (envelope-from stapleton.41@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.231]) by mx1.freebsd.org (Postfix) with ESMTP id 7B1318FC08 for ; Tue, 26 Aug 2008 16:01:23 +0000 (UTC) (envelope-from stapleton.41@gmail.com) Received: by wr-out-0506.google.com with SMTP id c8so1296164wra.27 for ; Tue, 26 Aug 2008 09:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=7nVwxkZlb8xWn+jGFEIpiwlq7vloiRRay2LDEpfbmoo=; b=sN3oNTDYSbO3jz9nhCBM35AXzF/bhkKvcg/qMjFdW9hRUTlhpei1gWk6T34+svMlTA qLWIAKl9wBZoRGMlD3fwqD+BQaqgUfOuCfSd/7I0b9MZXChwt3KiM5qFQc/YXUFTockc QCODGNJnVA1nYEOv+fPsEFdyt246rRrIJd1PI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=jQO/+Z/c6UQWCgTCBxyBDrBvw8y+aAZY9UzCz9Cq8lard2xZbkHw/wzcAWtNqinhcr lzc270Y2NAjHRZ8oS+QqrSw5BmnkplgcQ0BNn1joXXbu7V6AmDrk2MvM9jGTbcOSLZrD 77BXJejP0Q9ZKTpwOVaPR8gh/7yWQK+4DKua8= Received: by 10.90.94.12 with SMTP id r12mr7292379agb.108.1219766482439; Tue, 26 Aug 2008 09:01:22 -0700 (PDT) Received: by 10.90.65.9 with HTTP; Tue, 26 Aug 2008 09:01:22 -0700 (PDT) Message-ID: <80f4f2b20808260901w651d66dcp892b0206a03ff8b6@mail.gmail.com> Date: Tue, 26 Aug 2008 12:01:22 -0400 From: Jim To: Freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: fairly low level - ld-elf.so.1/rtld_verify_versions() question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Aug 2008 16:01:23 -0000 I have a library that is failing to load. Eventually I managed to play with ld-elf so I could figure out what was wrong (jail -> build the ld-elf in the jail with some printfs) Anyway, I have a lot of test cases that seem to compile/load fine, but one compiles fine but always fails to load, I found /why/ it fails, but I don't know what in my library would cause the issues. It looks like a versioning failure for libc.so.7: libc.so.7 => /lib/libc.so.7 (0x2807e000) What would cause this, but not cause failures on other libraries I've built on the same system? * Between successes and failures I have not rebuilt anything other than the successful and failing libraries. Thanks, -Jim Stapleton In case it might be useful, below I have an output from my modified ld-elf, Anything starting with ">>>" comes from the "rtld_verify_versions" function, anything starting with ">>" comes from the "dlopen" function. Anything starting with "##" is a comment or interperetation I added after the fact. #dlopen, prints name and mode arguments >>Opening: 'libctypeless.so' : 513 #prints name and pointer to main passed to load_object if name is not null >> Name not null, calling: load_object("libctypeless.so", 0x28078000 /*main*/) #prints the pointer returned for obj >> Found: 0x28078400 #tells the refcount on obj, immediately after the increment >> opened, refcount inc'ed: 1 #this is the first thing done after the initial STAILQ_FOREACH(entry, objlist, link) { #in the function, the line printing it is: # printf(">>> Checking version: %p (%p) --> \"%s\"\n", entry, entry->obj, entry->obj->path); >>> Checking version: 0x28079080 (0x28078400) --> "/usr/lib/libctypeless.so" >>> Checking version: 0x280790a0 (0x28078600) --> "/lib/libgcc_s.so.1" >>> Checking version: 0x280790c0 (0x28078200) --> "/lib/libc.so.7" #these next two are printed by #printf(">>> [shouldn't be null] strtab: \"%s\"\n", entry->obj->strtab); #and #printf(">>> [should be null] vertab: "); #printf("%p: %d / %d / \"%s\" / \"%s\" \n", entry->obj->vertab, # entry->obj->vertab->hash,entry->obj->vertab->flags, # entry->obj->vertab->name,entry->obj->vertab->file); #respectively >>> [shouldn't be null] strtab: "" >>> [should be null] vertab: 0x2807a080: 0 / 0 / "(null)" / "(null)" >> versioning failure of dagmembers: 0, libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2818e000) libc.so.7 => /lib/libc.so.7 (0x2807e000)