LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-23-2008, 10:34 AM   #1
alexagr
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Rep: Reputation: 0
Using debug version of standard libraries


I'm debugging my application under Debian 4.0 using DDD/GDB and many times the data produced by GDB backtrace is barely useful, 'cause i see something like
Code:
   #3  0xae550ac8 in ?? ()
As far as I understand the problem is that standard libraries, supplied with Debian are stripped. I found on the Web some post that suggest running the program against non-stripped libraries version by doing:
Code:
   LD_LIBRARY_PATH=/usr/lib/debug
   export LD_LIBRARY_PATH
prior to running the program.

Unfortunately when I do that, my program fails at the following line (that works perfectly fine with normal libraries):
Code:
   m_Semaphore = sem_open("/ipmgr",O_RDWR | O_CREAT,0666,1);
I get SEM_FAILED and errno is set to EINVAL, which means that value (1) is too big (pretty absurd).

Is there anything that I'm doing wrong?
Thank you in advance,
Alex
 
Old 02-07-2008, 02:04 PM   #2
traene
Member
 
Registered: Jan 2005
Distribution: Archlinux, Debian, Centos
Posts: 222

Rep: Reputation: 35
I'd say in many cases you don't need to use the debug version of the libraries. Try to compile your programme with opitmizations turned off:

CC_FLAGS=-O0
 
Old 02-08-2008, 10:25 AM   #3
alexagr
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you for your response.
Unfortunately turning optimization off doesn't really help me...

I noticed that when I normally run "getconf GNU_LIBPTHREAD_VERSION", I get "NPTL 2.3.6" output. But when I set LD_LIBRARY_PATH to point to the debug libraries, the same command returns "linuxthreads-0.10". Does it mean that debug version of the libraries lacks NPTL support? Can it be the source of my problem?
 
Old 02-08-2008, 04:07 PM   #4
traene
Member
 
Registered: Jan 2005
Distribution: Archlinux, Debian, Centos
Posts: 222

Rep: Reputation: 35
What distro do you use? Can you verify what packets of the glibc you have installed? I think you can call he library like so:
/lib/libc.so

this will print some infos of the library like version and components. Check the threads.
When you set your LD_LIBRARY_PATH you can also check the contents of your debug lib. Sounds like different versions to me.
 
Old 02-08-2008, 10:03 PM   #5
cetialphav
Member
 
Registered: Sep 2003
Location: Raleigh, NC, USA
Distribution: Fedora
Posts: 88

Rep: Reputation: 16
Does Debian have debug packages for the libc stuff? I use Fedora, and they provide special rpms that allow you to debug into any of the supplied packages. It is really handy. To install them you run something like:

Code:
debuginfo-install glibc
And that installs the files you need to be able to debug into the C libraries

Code:
[todd@hobbes ush]$ rpm -qa | grep debuginfo
gcc-debuginfo-4.1.2-33
glibc-debuginfo-2.7-2
glibc-debuginfo-common-2.7-2
Now I don't know Debian, but I would think they would have a similar facility.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where are the Standard C Libraries in my file system? nunya_biniss Linux - Newbie 4 10-13-2007 06:18 PM
standard c++ libraries missing? estitt Mandriva 3 04-26-2007 09:23 PM
LXer: American Arium Announces Linux Shared Libraries Debug Feature LXer Syndicated Linux News 0 01-24-2006 04:01 AM
C++ libraries and new standard blufire Programming 8 03-01-2005 02:47 PM
Use gcc and standard libraries with SUSE 9.1 Personal warrenpatrick Linux - Newbie 3 10-10-2004 07:26 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration