NetBSD Problem Report #39649

From jmcneill@black.invisible.ca  Mon Sep 29 12:02:40 2008
Return-Path: <jmcneill@black.invisible.ca>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 16A6263BCFE
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 29 Sep 2008 12:02:40 +0000 (UTC)
Message-Id: <20080929120153.CD3197D9663@black.invisible.ca>
Date: Mon, 29 Sep 2008 08:01:53 -0400 (EDT)
From: jmcneill@invisible.ca
Reply-To: jmcneill@invisible.ca
To: gnats-bugs@gnats.NetBSD.org
Subject: dlsym(3) does not follow dependencies
X-Send-Pr-Version: 3.95

>Number:         39649
>Category:       lib
>Synopsis:       dlsym(3) does not follow dependencies
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 29 12:05:00 +0000 2008
>Closed-Date:    Sat Oct 04 13:28:57 +0000 2008
>Last-Modified:  Sat Oct 04 13:28:57 +0000 2008
>Originator:     Jared D. McNeill
>Release:        NetBSD 4.99.72
>Organization:

>Environment:


System: NetBSD black.invisible.ca 4.99.72 NetBSD 4.99.72 (GENERIC) #98: Tue Sep 23 14:23:39 EDT 2008 jmcneill@black.invisible.ca:/export/home/jmcneill/branches/HEAD/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	After dlopen(3)ing a library and then calling dlsym(3) on the handle,
	symbols in libraries marked as NEEDED are not searched.
>How-To-Repeat:

	Install multimedia/ffmpeg and run the following test application.

	Results on NetBSD -current:

		$ cc -Wl,-R/usr/pkg/lib test.c -o test 
		$ ./test
		couldn't find symbol av_free: Undefined symbol "av_free"

	Results on Ubuntu 8.04LTS:

		$ cc test.c -o test -ldl
		$ ./test
		success

	Test application:

#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>

int
main(void)
{
	void *hdl, *fn;

	hdl = dlopen("libavcodec.so", RTLD_NOW);
	if (hdl == NULL) {
		printf("couldn't find libavcodec: %s\n", dlerror());
		return EXIT_FAILURE;
	}

	/* av_free is in libavutil */
	fn = dlsym(hdl, "av_free");
	if (fn == NULL) {
		printf("couldn't find symbol av_free: %s\n", dlerror());
		return EXIT_FAILURE;
	}

	printf("success\n");

	return 0;
}
>Fix:


>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sat, 04 Oct 2008 09:38:34 +0000
State-Changed-Why:
Fix commited. OK to close?


From: "Jared D. McNeill" <jmcneill@invisible.ca>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/39649 (dlsym(3) does not follow dependencies)
Date: Sat, 04 Oct 2008 09:09:16 -0400

 skrll@NetBSD.org wrote:
 > Synopsis: dlsym(3) does not follow dependencies
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: skrll@NetBSD.org
 > State-Changed-When: Sat, 04 Oct 2008 09:38:34 +0000
 > State-Changed-Why:
 > Fix commited. OK to close?

 Yes, thanks!

State-Changed-From-To: feedback->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sat, 04 Oct 2008 13:28:57 +0000
State-Changed-Why:
Jared is happyto close.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.