From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3159 invoked by alias); 12 Dec 2002 15:51:20 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 3118 invoked from network); 12 Dec 2002 15:51:16 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 12 Dec 2002 15:51:16 -0000 Received: by fw-cam.cambridge.arm.com; id PAA17179; Thu, 12 Dec 2002 15:51:13 GMT Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma016673; Thu, 12 Dec 02 15:50:47 GMT Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id PAA23765; Thu, 12 Dec 2002 15:50:45 GMT Received: from pc960.cambridge.arm.com (rearnsha@localhost) by pc960.cambridge.arm.com (8.11.6/8.9.3) with ESMTP id gBCFoiN19346; Thu, 12 Dec 2002 15:50:45 GMT Message-Id: <200212121550.gBCFoiN19346@pc960.cambridge.arm.com> X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha owned process doing -bs To: Max cc: gdb@sources.redhat.com, Richard.Earnshaw@arm.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. Subject: Re: Gdb LD_LIBRARY_PATH Problem In-reply-to: Your message of "Thu, 12 Dec 2002 14:41:42 +0100." <3DF89216.4050203@machsim.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 12 Dec 2002 07:51:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-12/txt/msg00189.txt.bz2 > Hi, > > I have an qt application whichis linked against a home made .so file. > While app runs perfectly in the shell, it is not possible to run it in > gdb due to the error : > > error while loading shared libraries: libDCcom.so > > I have gone thru all the posts in the mailing lists and newsgroups and > google, but I still don't have a solution. > > When I do "set env LD_DEBUG=libs", I find something interesting. Gdb > finds all libraries currently till the last one which is libDCcom.so. > When gdb starts looking for this, it notices that the application has > RPATH ( which is correct ) , searches the RPATHS and can not find it > there which is also correct since the .so is not there, it is in the > LD_LIBRARY_PATH. > > After looking for RPATH, gdb searches thru the LD_LIBRARY_PATH but !!!! > this time the LD_LIBRARY_PATH is incorrect !!!! For all the searches > before this shared object, the correct LD_LIBRARY_PATH is used however > for the last .so , the LD_LIBRARY_PATH is broken. > > Can anybody give me a hint ? A situation like this is often observed by csh users (or any similar shell). The cause is normally that their .cshrc file sets LD_LIBRARY_PATH back to a 'well-known' value. Since gdb starts an inferior process by forking a $SHELL and then letting the shell run the real application you get whatever LD_LIBRARY_PATH your .cshrc sets. Setting environment variables in .cshrc is generally a bad idea, since every subshell gets messed around by this. It's far better to put environment settings into your .login file. R.