From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29987 invoked by alias); 16 Jan 2013 20:30:14 -0000 Received: (qmail 29920 invoked by uid 22791); 16 Jan 2013 20:30:10 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Jan 2013 20:30:04 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TvZca-0005L7-4S from joseph_myers@mentor.com ; Wed, 16 Jan 2013 12:30:04 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 16 Jan 2013 12:30:03 -0800 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Wed, 16 Jan 2013 20:30:01 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1TvZcW-00014a-Dj; Wed, 16 Jan 2013 20:30:00 +0000 Date: Wed, 16 Jan 2013 20:30:00 -0000 From: "Joseph S. Myers" To: "Maciej W. Rozycki" CC: , Subject: Re: [PATCH] Correct global-scope dlopen issues in static executables In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2013-01/txt/msg00032.txt.bz2 On Wed, 16 Jan 2013, Maciej W. Rozycki wrote: > We have two issues with dlopen issued from static executables when the > global scope is accessed. > > First, an attempt to add a dynamic shared module to the global scope > (i.e. with RTLD_GLOBAL requested) crashes like this: > > Program received signal SIGSEGV, Segmentation fault. > add_to_global (new=0x49ef60) at dl-open.c:101 > 101 ns->_ns_global_scope_alloc > > This is because at this point in static executables no global search list > data structure has been initialised and as result the _ns_main_searchlist > member of _dl_ns[LM_ID_BASE] (the initial namespace) is null. > > Second, an attempt to access the global scope itself (i.e. by using a > null file name pointer) fails with an obscure error like: Could you file a bug (or two bugs) for these issues in glibc Bugzilla (component dynamic-link), if there isn't already one there? We like to have a bug in Bugzilla for any patch submission that fixes a user-visible bug that was present in a glibc release, so that the issue remains visible if the patch takes a while to review and so that people can search resolved bugs in Bugzilla to see if a bug they have found in a past release is known and fixed. See item 1 at . (The fixed bugs are then listed using [BZ #N] notation in the ChangeLog entries for the patch that fixes them, and added to the list of fixed bugs in NEWS when committing the patch.) I hope someone more familiar with the details of the dynamic linker will review the substance of this patch. -- Joseph S. Myers joseph@codesourcery.com