Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 04-02-2008, 10:08 PM   #1 (permalink)
meowww meoww
 
Kenshin's Avatar
 
Join Date: May 2006
Location: Ganymede
Posts: 121
Default segmentation fault dunnu why


I wrote a program for booth's algorithm for signed multiplication.Attached is the c code...I am gettin segmentation fault...whyy


kenshin@cutie:~$ ./a.out

Enter the two numbers
-3
7

Segmentation fault (core dumped)
kenshin@cutie:~$
__________________
"Microsoft: You've got questions. We've got a dancing paperclip."

Have fun,no worries..

Last edited by Kenshin; 04-02-2008 at 11:02 PM.
Kenshin is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 04-02-2008, 10:52 PM   #2 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: segmentation fault dunnu why



Anyway, where's the attachment?
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 04-02-2008, 11:03 PM   #3 (permalink)
meowww meoww
 
Kenshin's Avatar
 
Join Date: May 2006
Location: Ganymede
Posts: 121
Default Re: segmentation fault dunnu why

Heres the attachment....actually we elex ppl are not much familier with C...pls check up wat pointers i hv messed up



Code:
#include <stdio.h>

#include <math.h>

 void bin(int l,int *mat);

 void add(int *tem1,int *tem2);

 void shift(int *k,int *l,int *j);

void print(int *tem5,int *tem6, int b);
/*A[4]={0,0,0,0},Q[4],M[4]={0,0,0,0},c[4]={0,0,0,1},C1[8]={0,0,0,0,0,0,0,1};*/

int main()

{

   int s,a,i,p,q,q1,m;

   int ans[8],A[4]={0,0,0,0},Q[4],Q1=0,M[4]={0,0,0,0},c[4]={0,0,0,1},tee[4],C1[8]={0,0,0,0,0,0,0,1},x,z,d;

   printf("\nEnter the two numbers\n ");

   scanf("%d%d",&q,&m);

   printf("\n");

   printf("Binary equivalent of 1st no is ");

   bin(q,Q);

   printf("\n");

   printf("Binary equivalent of 2nd no is ");

   bin(m,M);

   printf("\n\nOpr      A    Q    Q(-1)");

   printf("\n\nInit --- ") ;

   print(A,Q,Q1);



   i=0;

   while(i<4)

   {

    if((Q[3]==0)&&(Q1==1))

    {

    add(A,M);

    printf("\nA+M ---- ");

    print(A,Q,Q1);

    }

    if((Q[3]==1)&&(Q1==0))

    {

     for(p=0;p<4;p++)

     {tee[p]=M[p];

     tee[p]=1-tee[p];

     }

     add(tee,c);

     add(A,tee);

     printf("\nA-M ---- ");

     print(A,Q,Q1);

    }

    shift(A,Q,&Q1);

    i++;

    printf("\nShift -- ");

    print(A,Q,Q1);

   }





for(i=0;i< 4;i++)

ans[i]=A[i];

for(i=0;i< 4;i++)

ans[i+4]=Q[i];

if(((q< 0)&&(m>0))||((q>0)&&(m< 0)))

{

for(i=0;i< 8;i++)

ans[i]=1-ans[i];

for(i=7;i>=0;i--)

{

x = ans[i];

ans[i]=d^x^C1[i];

if(((d==1)&&(x==1))||((x==1)&&(C1[i]==1))||((C1[i]==1)&&(d==1)))

d=1;

else

d=0;

}

}

printf("\n\n");

for(i=0;i< 8;i++)

printf("%d",ans[i]);

s=0;z=0;

for(i=7;i>=0;i--)

{

s = s + (pow(2,z) * ans[i]);

z = z+1;

}

if(((q< 0)&&(m>0))||((q>0)&&(m< 0)))

printf("\nTHE ANSWER IN DECIMAL IS : -%d\n",s);

else

printf("\nTHE ANSWER IN DECIMAL IS : %d\n",s);



return 0;

}





void add(int *tem1,int *tem2)

{



 int c=0,i,p;

 for (i=3;i>=0;i--)

 {

 p= tem1[i];

 tem1[i]=p^c^tem2[i];

 if((p&&c) || (p&&tem2[i]) || (tem2[i]&&c))

 c=1;

 else c=0;

 }

}





void bin(int l,int *mat)

{

int i,c[4]={0,0,0,1};

mat[i]=0;

if(l>0)

{

for(i=3;i>=0;i--)

{

   mat[i]=l%2;

   l = l/2;

}

}

else{

l= -1*l;

for(i=3;i>=0;i--)

{

   mat[i]=l%2;

   l= l/2;

   mat[i]= 1-mat[i];

}

add(mat,c);

}

for(i=0;i<4;i++)

printf("%d",mat[i]);

}



void shift(int *tem3,int *tem4,int *j)

{

 *j=tem4[3];

 tem4[3]=tem4[2];

 tem4[2]=tem4[1];

 tem4[1]=tem4[0];

 tem4[0]=tem3[3];

 tem3[3]=tem3[2];

 tem3[2]=tem3[1];

 tem3[1]=tem3[0];

}



void print(int *tem5,int *tem6, int b)

{

 int i;

for(i=0;i<4;i++)

printf("%d",tem5[i]);

printf(" ");

for(i=0;i<4;i++)

printf("%d",tem6[i]);

printf(" ");

printf("%d",b);

}

for sum unknown reason..was not able to attach file


The program works perfectly fine in turbo C...not in linux tho...and in college we hv fedora machines.
__________________
"Microsoft: You've got questions. We've got a dancing paperclip."

Have fun,no worries..

Last edited by Kenshin; 04-02-2008 at 11:13 PM.
Kenshin is offline  
Old 05-02-2008, 01:06 PM   #4 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: segmentation fault dunnu why

You need to attach math library in gcc.
Code:
gcc filename.c -lm
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 05-02-2008, 04:39 PM   #5 (permalink)
meowww meoww
 
Kenshin's Avatar
 
Join Date: May 2006
Location: Ganymede
Posts: 121
Default Re: segmentation fault dunnu why

no...i mean i complied with the -lm thing...the prob is when i run the file..THe program asks for the 2 numbers.after enterin the numbers the segmentation fault occurs
__________________
"Microsoft: You've got questions. We've got a dancing paperclip."

Have fun,no worries..
Kenshin is offline  
Old 06-02-2008, 06:15 PM   #6 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,675
Default Re: segmentation fault dunnu why

Quote:
Originally Posted by Kenshin View Post
no...i mean i complied with the -lm thing...the prob is when i run the file..THe program asks for the 2 numbers.after enterin the numbers the segmentation fault occurs
compile with -g flag and then
debug it to get the correct location.

My net is down so cant do much, hope u can debug.
Steps
1) compile with $ gcc -Wall -g -o outputfile inputfile.c
2) start gdb session $ gdb outputfile core

More here http://www.unknownroad.com/rtfm/gdbtut/gdbsegfault.html
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now  
Old 06-02-2008, 07:09 PM   #7 (permalink)
Wise Old Owl
 
The Unknown's Avatar
 
Join Date: Nov 2006
Location: Pune, Maharashtra, India
Posts: 1,728
Default Re: segmentation fault dunnu why

Quote:
Originally Posted by Kenshin View Post
I wrote a program for booth's algorithm for signed multiplication.Attached is the c code...I am gettin segmentation fault...whyy


kenshin@cutie:~$ ./a.out

Enter the two numbers
-3
7

Segmentation fault (core dumped)
kenshin@cutie:~$
Quote:
Originally Posted by wikipedia

A segmentation fault (often shortened to segfault) is a particular error condition that can occur during the operation of computer software. A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system). Systems based on processors like the Motorola 68000 tend to refer to these events as address or bus errors.
Segmentation is one approach to memory management and protection in the operating system. It has been superseded by paging for most purposes, but much of the terminology of segmentation is still used, "segmentation fault" being an example. Some operating systems still have segmentation at some logical level although paging is used as the main memory management policy.
On Unix-like operating systems, a process that accesses invalid memory receives the SIGSEGV signal. On Microsoft Windows, a process that accesses invalid memory receives the STATUS_ACCESS_VIOLATION exception.



Example

Here is an example of ANSI C code that should create a segmentation fault on platforms with memory protection:
const char *s = "hello world";
*s = 'H';
When the program containing this code is compiled, the string "hello world" is placed in the section of the program binary marked as read-only; when loaded, the operating system places it with other strings and constant data in a read-only segment of memory. When executed, a variable, s, is set to point to the string's location, and an attempt is made to write an H character through the variable into the memory, causing a segmentation fault. Compiling and running such a program on OpenBSD 4.0 produces the following runtime error:
$ gcc segfault.c -g -o segfault
$ ./segfault
Segmentation fault
Backtrace from gdb:
Program received signal SIGSEGV, Segmentation fault.
0x1c0005c2 in main () at segfault.c:6
6 *s = 'H';
In contrast, gcc 4.1.1 on GNU/Linux produces a compile-time error by default:
$ gcc segfault.c -g -o segfault
segfault.c: In function ‘main’:
segfault.c:4: error: assignment of read-only location
The conditions under which segmentation violations occur and how they manifest themselves are specific to an operating system.
Because a very common program error is a null pointer dereference (a read or write through the null pointer, a pointer to address 0, commonly used in C to mean "pointer to no object" or as an error indicator), most operating systems map the first page of memory (starting at address 0) so that accessing it causes a segmentation fault.
int* ptr = (int*) 0x00000000;


*ptr = 1;
This sample code creates a pointer to memory address 0x00000000, and tries to assign a value to it. Doing so causes a segmentation fault on many compilers.
SRC: http://en.wikipedia.org/wiki/Segmentation_fault
__________________
KDE on ArchLinux
PHP, MySQL, PostgreSQL, Linux, Apache; Message me to hire (freelancing only)
Explore Technology @ http://www.itech7.com
Cheap and Reliable VPS Hosting @ http://j.mp/arHk5e
The Unknown is offline  
Old 14-02-2008, 10:39 PM   #8 (permalink)
Pawned!... Beyond GODLIKE
 
fun2sh's Avatar
 
Join Date: May 2006
Location: World Of Warcraft -DOTA
Posts: 1,051
Default Re: segmentation fault dunnu why

half of our class wil fail (wen results comes for 3rd sem) in the DATA Strucructer lab BECOZ OF THIS SEGMENTATION FAULT.

dont know wat the hell i the problem with linux.

me too had once got this error durin error n after seein i became extremely nervous n scared but i did some modification n that prog whic was ABSOLUTELY CORRECT PROG (WHICH WAS EXACTLY SAME AS THE ONE I HAD DONE ON MY LAPPY IN TC N GOT OUTPUT) TO GET RID OF the frightening SEGEMNTATION FAULT. n we use such a stupid compile n linux. it really wierd to point out the errors. for seg fault it even doesnt tell where has it occured. **** LINUX N ITS STUPID COMPILER WE R USIN. we use vi edit n "cc" to compile the prog. teachers r damn stupid n dont know why dont they move to a better alternative like Visual c++
__________________
If God has indeed created Himself in His own image, then I submit to you that God is a cockroach :mrgreen:!!!!!!!!
fun2sh is offline  
Old 14-02-2008, 11:17 PM   #9 (permalink)
meowww meoww
 
Kenshin's Avatar
 
Join Date: May 2006
Location: Ganymede
Posts: 121
Default Re: segmentation fault dunnu why

Yeah ...my program works fine in windows...dunnu whhy not in linux
__________________
"Microsoft: You've got questions. We've got a dancing paperclip."

Have fun,no worries..
Kenshin is offline  
Old 14-02-2008, 11:26 PM   #10 (permalink)
I have Yolks not Brains!
 
eggman's Avatar
 
Join Date: Aug 2006
Location: Inside the shell
Posts: 743
Default Re: segmentation fault dunnu why

This segmentation faults had driven me mad!!!!!!!!!!!!!!The the worst thing is that it won't even point where's the problem. Just Segmentation Fault.Nothing else.

Even when you just type the ditto prog,thats in the book..this occurs, because of a simple mistake, which could've been pinpointed.
__________________
Y U NO ALLOW PICTURES IN SIGNATURES?
eggman is offline  
Old 15-02-2008, 12:18 AM   #11 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: segmentation fault dunnu why

I took some help of a friend, this is what we did
1) Copied the code to a file named prog.c
2) Compiled it like this
Code:
gcc -Wall -o prog prog.c -lm -ggdb
3) Then we ran it through the debugger
Code:
gdb ./prog.c
(gdb) run
Starting program: /usr/home/mehul/prog

Enter the two numbers
 1
2


Program received signal SIGSEGV, Segmentation fault.
0x08048b6d in bin (l=1, mat=0xbfbfe740) at prog.c:208
208     mat[i]=0;
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/home/mehul/prog

Enter the two numbers
 1 3


Program received signal SIGSEGV, Segmentation fault.
0x08048b6d in bin (l=1, mat=0xbfbfe740) at prog.c:208
208     mat[i]=0;
(gdb) bt
#0  0x08048b6d in bin (l=1, mat=0xbfbfe740) at prog.c:208
#1  0x08048687 in main () at prog.c:30
So, the problem is at line 208.
Here's what he had to say about it
Quote:
he is trying to subscript a pointer..big no..afaik
BTW, where do you get the value of i on line 208?
As, I can see you've just declared i but you haven't defined it.
I tried by changing i to 100 and program worked fine.
I dunno how it worked in Turbo C.
__________________
http://www.bash.org/?258908

Last edited by mehulved; 15-02-2008 at 12:18 AM. Reason: Automerged Doublepost
mehulved is offline  
Old 15-02-2008, 12:21 AM   #12 (permalink)
Alpha Geek
 
Krazy_About_Technology's Avatar
 
Join Date: Jun 2004
Location: Noida - India
Posts: 765
Default Re: segmentation fault dunnu why

you are using the subscript i without initializing it.

you have written
Code:
int i,c[4]={0,0,0,1};

mat[i]=0;
here i is defined and then used as subscript in the array without initialization. This is causing problem.
GCC is a very good compiler and as a student you should use it instead of more 'forgiving' compilers which let you make mistakes that cause problems in long run. I have myself seen borland compiler missing many memory leak scenarios which are reported in advance in GCC. If you want to learn C or C++ by Standards, GCC is one of the best compilers to have.
__________________
Dell Inspiron 1525 - C2D 2 Ghz, 3GB, 250GB, X3100 :)

Samsung Omnia Pro B7610 with Stock WM 6.1 ROM

Blog: http://www.sumitbhardwaj.co.in/blog
Krazy_About_Technology is offline  
Old 15-02-2008, 12:30 AM   #13 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: segmentation fault dunnu why

And BTW, FYI, you have 2 unused variables
Code:
prog.c:18: warning: unused variable `a'
prog.c:18: warning: unused variable `q1'
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 02-03-2008, 12:21 PM   #14 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: segmentation fault dunnu why

It worked for me
Just add this line before line no. 208
Code:
for(i=3;i>=0;i++)
You're right your teachers are really stupid to make you use gcc, you should rather stick to cosy old tc++, it makes programming so easy. gcc is just a piece of crap.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 02-03-2008, 12:25 PM   #15 (permalink)
Who stole my Alpaca!
 
FilledVoid's Avatar
 
Join Date: Jan 2005
Location: Kerala
Posts: 2,020
Default Re: segmentation fault dunnu why

Sarcasm as its best ^ . Most people think gcc sucks and are happy with TC. Just wait till your job uses anything BUT TC.
__________________
The Ultimate Chess Strategy : "Hit Hard, Hit Fast and Hit Often"
FilledVoid is offline  
Old 02-03-2008, 12:27 PM   #16 (permalink)
left this forum longback
 
praka123's Avatar
 
Join Date: Sep 2005
Location: -
Posts: 7,536
Default Re: segmentation fault dunnu why

^no, blame Linux also as "he" does @#8 !that will be even more sweeter as Linux contains gcc all fault of gcc and Linux.

yeah using vim/vi editor is a very big sin sheesh..where these fellas are going?
__________________
left this forum long back.Admin Can Delete this Account and posts Permanantly.Thank You
Get GNU/Linux - http://getgnulinux.org
praka123 is offline  
Old 02-03-2008, 03:43 PM   #17 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: segmentation fault dunnu why

What was the need to drag Linux into this topic? Its a compiler-specific and helpful output, not Linux, nor Windows and not any other "Platform".

If you don't know to code with pointers, please avoid doing so. Applies to you eggman. Its even better if you fail, for not understanding what you code. Atleast after that it'd kick some sense into you about 'proper programming'.

So you say that you have never encountered a segmentation fault in Windows? Thats cause the programs compiled on your stupid old compiler don't tell you what's wrong, they just cease to function and crash midway. Good ol' BSOD eh? Prefer that, really, its worth your doom.

If you wish to change your ways, use GNU Debugger along with GCC. It wasn't invented for nothing. Nothing is.

Over that, I don't know what good would using a non-conformal compiler like VC++ 03/05 do to an eventually bad code of yours. Have you ever tried assembly? It makes you think better, try that first.
__________________
Harsh J
www.harshj.com

Last edited by QwertyManiac; 02-03-2008 at 03:59 PM.
QwertyManiac is offline  
Old 02-03-2008, 03:49 PM   #18 (permalink)
"The Gentleman"
 
vish786's Avatar
 
Join Date: Sep 2006
Posts: 1,434
Post Re: segmentation fault dunnu why

Quote:
Originally Posted by QwertyManiac View Post
If you don't know to code with pointers, please avoid doing so. Applies to you eggman. Its even better if you fail, for not understanding what you code. Atleast after that it'd kick some sense into you about 'proper programming'.
@others, well thats reason most dont tend to use pointers !
__________________
"The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense."
- Dijkstra
vish786 is offline  
Old 02-03-2008, 04:34 PM   #19 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: segmentation fault dunnu why

Quote:
Originally Posted by QwertyManiac View Post
If you don't know to code with pointers, please avoid doing so. Applies to you eggman. Its even better if you fail, for not understanding what you code. Atleast after that it'd kick some sense into you about 'proper programming'.
Not everyone is a good programmer like you
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 02-03-2008, 08:08 PM   #20 (permalink)
Alpha Geek
 
Krazy_About_Technology's Avatar
 
Join Date: Jun 2004
Location: Noida - India
Posts: 765
Default Re: segmentation fault dunnu why

@mehulved : Well not everyone is a good programmer, but why is he studying programming then, to always be a 'not good programmer", huh?

In my opinion, old TC is not good enough even for beginners due to its forgiving nature. It causes you to 'learn' doing mistakes that cause havoc in big, real world programs. If gcc is a crap, then Linux and whole of its software repository is crap, which it is not , that even a noob can tell.

Pointer arithmetic is an important topic in C and C++ and no great programs can be made without learning it properly. Uninitialized variables before use, null pointers etc are so big of a problem that all the new programming languages are coming with strong checking for these troublesome chunks of code. are they all crap???
__________________
Dell Inspiron 1525 - C2D 2 Ghz, 3GB, 250GB, X3100 :)

Samsung Omnia Pro B7610 with Stock WM 6.1 ROM

Blog: http://www.sumitbhardwaj.co.in/blog
Krazy_About_Technology is offline  
Old 03-03-2008, 12:14 AM   #21 (permalink)
meowww meoww
 
Kenshin's Avatar
 
Join Date: May 2006
Location: Ganymede
Posts: 121
Default Re: segmentation fault dunnu why

gcc is great no doubt bout tat...i just wanted to find the mistake tho..

Quote:
Originally Posted by fun2sh View Post
half of our class wil fail (wen results comes for 3rd sem) in the DATA Strucructer lab BECOZ OF THIS SEGMENTATION FAULT.

dont know wat the hell i the problem with linux.

me too had once got this error durin error n after seein i became extremely nervous n scared but i did some modification n that prog whic was ABSOLUTELY CORRECT PROG (WHICH WAS EXACTLY SAME AS THE ONE I HAD DONE ON MY LAPPY IN TC N GOT OUTPUT) TO GET RID OF the frightening SEGEMNTATION FAULT. n we use such a stupid compile n linux. it really wierd to point out the errors. for seg fault it even doesnt tell where has it occured. **** LINUX N ITS STUPID COMPILER WE R USIN. we use vi edit n "cc" to compile the prog. teachers r damn stupid n dont know why dont they move to a better alternative like Visual c++
sorry to say but ur wrong tho....only thing i like bout my college is tat its entirely linux
__________________
"Microsoft: You've got questions. We've got a dancing paperclip."

Have fun,no worries..

Last edited by Kenshin; 03-03-2008 at 12:14 AM. Reason: Automerged Doublepost
Kenshin is offline  
Old 03-03-2008, 02:37 AM   #22 (permalink)
GaurishSharma.com
 
gary4gar's Avatar
 
Join Date: May 2005
Location: Jaipur
Posts: 4,116
Default Re: segmentation fault dunnu why

^^^^
huh! using linux in college
Do you live in INDIA?
gary4gar is offline  
Old 03-03-2008, 09:58 AM   #23 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,675
Default Re: segmentation fault dunnu why

programming is not all about executing a program.

Its the ability of a developer to divulge every minute possible error and warnings(yup warnings count too) and get it endorsed 99% bug free.
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now  
Old 03-03-2008, 10:01 AM   #24 (permalink)
left this forum longback
 
praka123's Avatar
 
Join Date: Sep 2005
Location: -
Posts: 7,536
Smile Re: segmentation fault dunnu why

Quote:
Originally Posted by gary4gar View Post
^^^^
huh! using linux in college
Do you live in INDIA?
ya.most of the colleges(engineering esp) in my state uses linux I think.esp fedora or Debian.
__________________
left this forum long back.Admin Can Delete this Account and posts Permanantly.Thank You
Get GNU/Linux - http://getgnulinux.org
praka123 is offline  
Old 03-03-2008, 06:43 PM   #25 (permalink)
meowww meoww
 
Kenshin's Avatar
 
Join Date: May 2006
Location: Ganymede
Posts: 121
Default Re: segmentation fault dunnu why

yeah i am from Fr agnels Bandra Mumbai....We have all Solaris,Red hats and fedoras
__________________
"Microsoft: You've got questions. We've got a dancing paperclip."

Have fun,no worries..
Kenshin is offline  
Old 03-03-2008, 07:33 PM   #26 (permalink)
die blizzard die! D3?
 
The_Devil_Himself's Avatar
 
Join Date: Aug 2007
Location: Event horizon
Posts: 2,361
Default Re: segmentation fault dunnu why

my college too uses linux though teachers are usually clueless about it but the system admistrators are pretty intelligent.

+! for using GNU debugger,I used it only a few times and it was able to pin-point the problem exactly in the first go.
__________________
Stealing your women and horses since 1843.
The_Devil_Himself is offline  
Old 03-03-2008, 07:45 PM   #27 (permalink)
left this forum longback
 
praka123's Avatar
 
Join Date: Sep 2005
Location: -
Posts: 7,536
Default Re: segmentation fault dunnu why

I have tried submitting stack trace or backtrace (whatever u call it!) of applications that crash in Debian Sid using gdb ,strace etc to BTS via reportbug tool

not to say that I am clueless about the o/p it is showing.Indeed it is very helpful if u do bug reports of apps in Linux. (bug-buddy in Gnome automates!)

Here is a howto:
HowToGetABacktrace - Debian Wiki
StackTraces - Fedora Project Wiki
__________________
left this forum long back.Admin Can Delete this Account and posts Permanantly.Thank You
Get GNU/Linux - http://getgnulinux.org
praka123 is offline  
Old 04-03-2008, 07:30 AM   #28 (permalink)
99.9% Idle
 
axxo's Avatar
 
Join Date: Sep 2007
Posts: 835
Default Re: segmentation fault dunnu why

Quote:
Originally Posted by gary4gar View Post
^^^^
huh! using linux in college
Do you live in INDIA?
for ur info..our college has got a dedicated solaris lab with servers & thinclients...
I have come across this error...most of the time it will be due to improper assignations and illegal referencing...like if you miss out '&' in scanf will lead to this error..and gcc reports this message for most of the error..so quite difficult to trace..havent said that its not a problem with gcc..somewhere the program has got some error need to be corrected.
axxo is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
software fault or CODE ismart Mobiles and Tablets 1 22-01-2008 01:19 PM
Vista creators fault !!!!!! dreams Chit-Chat 2 23-10-2007 08:39 PM
Is any fault in my graphics card? bhalchandra QnA (read only) 9 26-09-2004 05:29 PM

 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:50 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2