LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-03-2003, 03:41 AM   #1
deadhead
LQ Newbie
 
Registered: Oct 2003
Distribution: Debian 'Woody"
Posts: 24

Rep: Reputation: 15
interpreting gdb......


heloo,

I am new to prgramming in c and I came across the mmap function and decide to see how it works by writing a smal piece of code.
{
void *ptr=0;
int size,stat;
size=getpagesize();
ptr=mmap(0,2,PROT_WRITE,MAP_SHARED,213,size) ;
stat=munmap(ptr,2);
printf("%d",stat);
}
as expected(?), i get a seg fault.
I run gdb and it says:
program recieved SIGSEGV...blah blah,
0x40068f73 in vfprintf() from /lib/libc.so.6 <-------(what does this mean)

how do I interpret such messages.I tried 'info gdb' and found it more cryptic than the debug messages themselves.
soory for the long message,
help anyone?
 
Old 12-03-2003, 06:20 AM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
Try
gdb programfilename core

At the prompt type

ba

this will show you a stack dump

0x40068f73 in vfprintf() from /lib/libc.so.6

means the error occurred in module vrpintf() which was dynamically linked in from the shared library libc

If you want to learn gdb -

try man gdb to see how to start it up
Then when running gdb, type
help
there is extensive help, good enough to let you learn how to you use the program effectively.

Last edited by jim mcnamara; 12-03-2003 at 06:21 AM.
 
Old 12-03-2003, 10:12 PM   #3
deadhead
LQ Newbie
 
Registered: Oct 2003
Distribution: Debian 'Woody"
Posts: 24

Original Poster
Rep: Reputation: 15
thanks alot o god's gift to earth.mind if i nominate you for the nobel in 2100;-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
normal gdb and spec gdb for kgdb Igor007 Programming 1 09-23-2005 04:15 PM
normal gdb and spec gdb for kgdb Igor007 Linux - Newbie 1 09-23-2005 01:41 PM
gdb .. looking for 32 bit gdb.. for ia64 suse.. nkshirsagar SUSE / openSUSE 0 12-09-2004 03:02 AM
interpreting system messages corbis_demon Linux - Newbie 1 10-29-2004 12:54 PM
interpreting a cron nitaish Linux - General 1 10-15-2004 12:18 PM

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

All times are GMT -5. The time now is 02:12 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration