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 05-17-2005, 04:29 PM   #1
eagle683
Member
 
Registered: May 2005
Posts: 38

Rep: Reputation: 15
stack problem C


hey all,

I am programming in C, and I am working with a very large program that I did not write myself, but have the joy of debugging. When I gdb this program I get the following.

#0 0x400b4984 in _IO_str_overflow_internal () from /lib/tls/libc.so.6
#1 0x400b3488 in _IO_default_xsputn_internal () from /lib/tls/libc.so.6
#2 0x4008c4f8 in vfprintf () from /lib/tls/libc.so.6
#3 0xbfff4290 in ?? ()
#4 0x00000004 in ?? ()
#5 0xffffffff in ?? ()
#6 0xffffffe1 in ?? ()

It looks like the error involves printf, but the line that causes the error calls a struct whose member looks like, "int *name (*void) ;"

I'm puzzled. Any help would be greatly appreciated

Thanks,
Eagle
 
Old 05-17-2005, 04:34 PM   #2
Hivemind
Member
 
Registered: Sep 2004
Posts: 273

Rep: Reputation: 30
If you know where in code it crashes, then maybe you could examine the values of all variables involved and create
a self-contained, compilable example for us to look at?
 
Old 05-17-2005, 04:41 PM   #3
eagle683
Member
 
Registered: May 2005
Posts: 38

Original Poster
Rep: Reputation: 15
I'll try and do that in a few minutes.
Just another question real quick - the program runs fine on Unix Machines. I have changed some lines because I am porting it to Linux, and I'm pretty sure those are correct. Besides the fact, that I changed all of the necessary functions, are there any other major major differences between Unix and Linux, thanks
 
Old 05-17-2005, 04:52 PM   #4
eagle683
Member
 
Registered: May 2005
Posts: 38

Original Poster
Rep: Reputation: 15
error: segmentation fault

structname[max1][max2].xxxx() is the line that causes error

max1 = 34, max2 = 1 .... allowable[38][175]

struct structname
{
....
int (*xxxxx) (void);
.....
};

That's the best I can do.
 
  


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
Difference b/t Kernel stack and User stack hazzyb Linux - Software 2 09-29-2008 07:40 PM
allocation problem [static stack storage] kranti Programming 1 10-18-2005 09:10 AM
gcc stack problem scoban Programming 8 08-15-2005 11:44 PM
2052 stack size is not enough! - glibc problem Yerp Linux From Scratch 2 12-26-2004 03:12 PM
stack in chapter 6 alaios Linux From Scratch 1 03-29-2004 08:11 AM

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

All times are GMT -5. The time now is 10:57 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