Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: Loading shared libraries for core file
@ 2005-02-01 14:57 Ben Hutchings
  2005-02-01 15:12 ` Kris Warkentin
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2005-02-01 14:57 UTC (permalink / raw)
  To: gdb

Kris Warkentin wrote:
> 'info shared' should tell you what it plans to load and whether or not 
> it has yet.

Unfortunately not:
"No shared libraries loaded at this time."

Ben.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Loading shared libraries for core file
  2005-02-01 14:57 Loading shared libraries for core file Ben Hutchings
@ 2005-02-01 15:12 ` Kris Warkentin
  0 siblings, 0 replies; 6+ messages in thread
From: Kris Warkentin @ 2005-02-01 15:12 UTC (permalink / raw)
  To: gdb

Ben Hutchings wrote:

>Kris Warkentin wrote:
>  
>
>>'info shared' should tell you what it plans to load and whether or not
>>    
>>
>
>  
>
>>it has yet.
>>    
>>
>
>Unfortunately not:
>"No shared libraries loaded at this time."
>
>Ben.
>  
>

Strange.  Is it possible that your application cored before it loaded 
the shared libs?  Linux uses lazy linking so if none of your objects had 
been used yet, they might not be loaded.  You'd think that at least libc 
would be there.  What do you get when you 'objdump -x <your_app> | grep 
NEEDED'?  What does your backtrace show?

Also, you might want to try "LD_DEBUG=all LD_DEBUG_OUTPUT=ld_debug.txt 
<your_app>" to see what's going on.

cheers,

Kris


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Loading shared libraries for core file
  2005-02-01 15:53   ` Ben Hutchings
@ 2005-02-01 16:02     ` Kris Warkentin
  0 siblings, 0 replies; 6+ messages in thread
From: Kris Warkentin @ 2005-02-01 16:02 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: gdb

Ben Hutchings wrote:

>Kris Warkentin wrote:
>  
>
>>Ben Hutchings wrote:
>>    
>>
>>>Kris Warkentin wrote:
>>>      
>>>
>>>>'info shared' should tell you what it plans to load and whether or
>>>>        
>>>>
>not
>  
>
>>>>it has yet.
>>>>        
>>>>
>>>Unfortunately not:
>>>"No shared libraries loaded at this time."
>>>
>>>      
>>>
>>Strange.  Is it possible that your application cored before it loaded 
>>the shared libs?  Linux uses lazy linking so if none of your objects
>>    
>>
>had
>  
>
>>been used yet, they might not be loaded.
>>    
>>
>
>The process had been running for a while and to get to that point it 
>would have had to run code from all the libraries.  It was actually 
>running code from a shared library at the point I made the core dump. 
>Now gdb won't show me that code!
>
><snip>
>  
>
>>What do you get when you 'objdump -x <your_app> | grep NEEDED'?
>>    
>>
>
>   NEEDED      libboost_thread.so
>   NEEDED      libdl.so.2
>   NEEDED      libstdc++.so.6
>   NEEDED      libm.so.6
>   NEEDED      libgcc_s.so.1
>   NEEDED      libpthread.so.0
>   NEEDED      libc.so.6
>   NEEDED      ld-linux.so.2
>
>  
>
>>Also, you might want to try "LD_DEBUG=all LD_DEBUG_OUTPUT=ld_debug.txt
>>    
>>
>
>  
>
>><your_app>" to see what's going on.
>>    
>>
>
>It's fairly clear that all the libraries are loaded successfully.
>

What happens if you run the app in gdb?  Can you see the shared libs 
then?  Perhaps there is something wrong with the core file.  If you look 
at usr/include/link.h, you'll see how this all works.  The runtime 
linker fills in a list of r_debug structures containing all the solibs.  
This information should be in the core file.  If you can see the solibs 
when you just run it in gdb but not in the core-file, perhaps something 
is going on there.

cheers,

Kris


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Loading shared libraries for core file
       [not found] ` <41FF9CB8.8070507@qnx.com>
@ 2005-02-01 15:53   ` Ben Hutchings
  2005-02-01 16:02     ` Kris Warkentin
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2005-02-01 15:53 UTC (permalink / raw)
  To: Kris Warkentin; +Cc: gdb

Kris Warkentin wrote:
> Ben Hutchings wrote:
>> Kris Warkentin wrote:
>>> 'info shared' should tell you what it plans to load and whether or not
>>> it has yet.
>>
>> Unfortunately not:
>> "No shared libraries loaded at this time."
>>
> 
> Strange.  Is it possible that your application cored before it loaded 
> the shared libs?  Linux uses lazy linking so if none of your objects had
> been used yet, they might not be loaded.

The process had been running for a while and to get to that point it 
would have had to run code from all the libraries.  It was actually 
running code from a shared library at the point I made the core dump. 
Now gdb won't show me that code!

<snip>
> What do you get when you 'objdump -x <your_app> | grep NEEDED'?

   NEEDED      libboost_thread.so
   NEEDED      libdl.so.2
   NEEDED      libstdc++.so.6
   NEEDED      libm.so.6
   NEEDED      libgcc_s.so.1
   NEEDED      libpthread.so.0
   NEEDED      libc.so.6
   NEEDED      ld-linux.so.2

> Also, you might want to try "LD_DEBUG=all LD_DEBUG_OUTPUT=ld_debug.txt 
> <your_app>" to see what's going on.

It's fairly clear that all the libraries are loaded successfully.

Ben.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Loading shared libraries for core file
  2005-01-31 19:14 Ben Hutchings
@ 2005-01-31 20:14 ` Kris Warkentin
  0 siblings, 0 replies; 6+ messages in thread
From: Kris Warkentin @ 2005-01-31 20:14 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: gdb

'info shared' should tell you what it plans to load and whether or not 
it has yet.
'shared' should tell it to load them.
If auto-solib-add is set, it should grab them without you explicitly 
calling shared.

cheers,

Kris

Ben Hutchings wrote:

>I am using gdb 5.1-1 under Red Hat Enterprise Linux 2.1 and trying to
>examine a core file created under the same operating system.  gdb
>appears to read the core file and the executable file successfully, but
>does not load shared libraries, nor does it display any error message
>indicating that it tried and failed to do so.
>
>The same shared libraries are installed on the system which I'm running
>gdb.  Some of them are in a non-standard directory (under /opt) but I
>have set solib-search-path to point to the directory they are in.  What
>else do I need to do?
>
>Ben.
>  
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Loading shared libraries for core file
@ 2005-01-31 19:14 Ben Hutchings
  2005-01-31 20:14 ` Kris Warkentin
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2005-01-31 19:14 UTC (permalink / raw)
  To: gdb

I am using gdb 5.1-1 under Red Hat Enterprise Linux 2.1 and trying to
examine a core file created under the same operating system.  gdb
appears to read the core file and the executable file successfully, but
does not load shared libraries, nor does it display any error message
indicating that it tried and failed to do so.

The same shared libraries are installed on the system which I'm running
gdb.  Some of them are in a non-standard directory (under /opt) but I
have set solib-search-path to point to the directory they are in.  What
else do I need to do?

Ben.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-02-01 16:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-01 14:57 Loading shared libraries for core file Ben Hutchings
2005-02-01 15:12 ` Kris Warkentin
     [not found] <41FF84B0.2060008@businesswebsoftware.com>
     [not found] ` <41FF9CB8.8070507@qnx.com>
2005-02-01 15:53   ` Ben Hutchings
2005-02-01 16:02     ` Kris Warkentin
  -- strict thread matches above, loose matches on Subject: below --
2005-01-31 19:14 Ben Hutchings
2005-01-31 20:14 ` Kris Warkentin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox