![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why not a segmentation fault?? | lagigliaivan | High Level Programming | 22 | 05-21-2008 11:07 AM |
| Segmentation Fault | compbug | UNIX for Dummies Questions & Answers | 3 | 04-21-2006 10:43 AM |
| segmentation fault | wojtyla | High Level Programming | 3 | 02-19-2005 02:53 PM |
| Segmentation fault | jshaulis | AIX | 1 | 06-01-2004 04:16 PM |
| segmentation fault | omran | High Level Programming | 2 | 08-01-2003 08:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
ive written my code in C for implementation of a simple lexical analyser using singly linked list hence am making use of dynamic allocation,but when run in linux it gives a segmentation fault is it cause of the malloc function that ive made use of????any suggestions as to what i could do???
thank you!! Last edited by rockgal; 12-03-2006 at 01:02 AM.. |
|
||||
|
I can't tell what your problem is from here.
The first problem is to find where in your code the segfault occurs - compile and run your code under a debugger (gdb) Code:
gcc -g -o myfile myfile.c gdb myfile gdb > r <command line arguments> <segfault happens here> ba |
|
||||
|
I tried out these commands gdb >r <myfile> & gdb bt <myfile> on fedora 4.0
and this is what i got bash: syntax error near unexpected token 'newline' Am not sure of the syntax of the command but i picked up 'bt' from the man pages. I did try all possibilities and this is what i got for all of them...! Please let me know if my command syntax is wrong or thats the error in my program and how can i debug it??? thank you, rockgal Last edited by rockgal; 12-03-2006 at 01:03 AM.. |
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|