From owner-freebsd-bugs@FreeBSD.ORG Sat Sep 16 12:40:21 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16EF316A417 for ; Sat, 16 Sep 2006 12:40:21 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D48343D58 for ; Sat, 16 Sep 2006 12:40:20 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k8GCeK6j088432 for ; Sat, 16 Sep 2006 12:40:20 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k8GCeKpj088427; Sat, 16 Sep 2006 12:40:20 GMT (envelope-from gnats) Resent-Date: Sat, 16 Sep 2006 12:40:20 GMT Resent-Message-Id: <200609161240.k8GCeKpj088427@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Karasik Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A7DE16A403 for ; Sat, 16 Sep 2006 12:32:46 +0000 (UTC) (envelope-from dk@tetsuo.karasik.eu.org) Received: from tetsuo.karasik.eu.org (tetsuo.karasik.eu.org [193.88.77.78]) by mx1.FreeBSD.org (Postfix) with ESMTP id B674543D49 for ; Sat, 16 Sep 2006 12:32:45 +0000 (GMT) (envelope-from dk@tetsuo.karasik.eu.org) Received: by tetsuo.karasik.eu.org (Postfix, from userid 1003) id 7DF9239C99E; Sat, 16 Sep 2006 14:32:43 +0200 (CEST) Message-Id: <20060916123243.7DF9239C99E@tetsuo.karasik.eu.org> Date: Sat, 16 Sep 2006 14:32:43 +0200 (CEST) From: Dmitry Karasik To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/103312: dlsym(NULL,) doesn't work properly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dmitry Karasik List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 12:40:21 -0000 >Number: 103312 >Category: kern >Synopsis: dlsym(NULL,) doesn't work properly >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Sep 16 12:40:19 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Dmitry Karasik >Release: FreeBSD 6.1-PRERELEASE i386 >Organization: >Environment: System: FreeBSD tetsuo.karasik.eu.org 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #1: Fri Mar 31 20:36:29 CEST 2006 root@flow.eu.org:/data/obj/usr/src/sys/GENERIC i386 >Description: man 3 dlsym states: If dlsym() is called with the special handle NULL, it is interpreted as a reference to the executable or shared object from which the call is being made. however, dlsym(NULL,) returns NULL always. >How-To-Repeat: #include #include #include int main() { void * ptr; ptr = fabs; printf("fabs: %x\n", fabs); ptr = dlsym( NULL, "fabs"); if ( ptr) { printf("dlsym(NULL,fabs)=%x\n", fabs); } else { printf("dlsym(NULL,fabs) error:%s\n", dlerror()); } ptr = dlopen( NULL, RTLD_LOCAL); printf("dlopen(NULL): %x\n", ptr); ptr = dlsym( ptr, "fabs"); if ( ptr) { printf("dlsym(dlopen(NULL),fabs)=%x\n", fabs); } else { printf("dlsym(dlopen(NULL),fabs) error:%s\n", dlerror()); } return 0; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: