![]() |
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 |
| Can't locate object method "fetchrow_array" Error | rawat_me01 | Shell Programming and Scripting | 1 | 06-03-2009 10:07 AM |
| Help! "Bus error" and "CPU Panic" box wont boot | hcclnoodles | SUN Solaris | 3 | 10-05-2006 04:38 PM |
| shared object "undefined symbol: fstat" error | marcus121 | High Level Programming | 5 | 04-24-2006 07:11 PM |
| dbx error ("Executable contains object file compiled on ...") | Sabari Nath S | High Level Programming | 0 | 08-04-2005 05:03 PM |
| Error : "No data written to object that was write locked" | nileshkarania | UNIX for Dummies Questions & Answers | 1 | 06-07-2003 11:29 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
getting "mi_cmd_var_create: unable to create variable object" error msg
Hi,
i am working in C in Fedora Eclipse 3.3.0 with gdb debugger. I am geting segmentation fault with an error message "mi_cmd_var_create: unable to create variable object" on debugging the program. What should I do to solve this problem? rgds, Dona_m |
|
||||
|
Is this variable local to a function or is it global. If global check the allocated data segment size else check the allocated stack segment. Try increasing the size of whichever segment it lies in.
|
|
||||
|
It compile with no errors and no warnings.This is the part of code
#include<stdio.h> #include<string.h> #include "header.h" #include "struct.h" extern struct stack_rec stack[100]; extern char word[MAXWORD], mal_mean[MAXWORD], E_attr[MAXLEN], H_attr[CATLEN], semantic_tag[MAXWORD]; extern int word_cat, top, VOICE, prep_par, pos, phrase; void getreltvform (char[], int); void check_suffix (char[], int , int); int p = 0; /***This function is used to resolve the meaning of relative pronouns and takes the formation with the word***/ void resolve_reltvpronoun () { char mmean[MAXWORD], means[5][MAXWORD]; int len = 0, i, clen = 0, ci = 0, spos = 0; p = pos; printf ("\ninside resolve rel pronouunnn\n"); if (stack[top - 1].word_cat == KARAK && prep_par == 7) spos = top - 2; else spos = top - 1; strcpy (mmean, stack[spos].mal); len = strlen (mmean); printf ("\n\nstack mal : %s\n", mmean); stack[spos].mal[0] = '\0'; for (; i < 5; i++) means[i][0] = '\0'; for (i = 0; mmean[i] != '\0'; i++) { if (mmean[i] == '/') { means[clen++][ci] = '\0'; ci = 0; } else means[clen][ci++] = mmean[i]; } means[clen][ci] = '\0'; for (i = 0; i <= clen; i++) getreltvform (means[i], spos); stack[spos].mal[strlen (stack[spos].mal) - 1] = '\0'; printf ("\n final stack mallllllllll : %s", stack[spos].mal); } segmention fault occur at the line -stack[spos].mal[0] = '\0';If we comment the line it will go to another line after that. All the extern variables are declared in other files. |
|
||||
|
Sounds like spos is going out of bounds. Can you print out its value just before? How large is stack[] and how is it defined?
Last edited by era; 08-14-2008 at 06:56 AM.. Reason: Hey, a fellow computational linguist! http://xkcd.com/114/ |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|