getting "mi_cmd_var_create: unable to create variable object" error msg


 
Thread Tools Search this Thread
Top Forums Programming getting "mi_cmd_var_create: unable to create variable object" error msg
# 1  
Old 08-13-2008
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
# 2  
Old 08-13-2008
Question Local or Global variable

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.
# 3  
Old 08-14-2008
I tried by increasing the stack size.But it is not working . It is actually stopped due to segmentation fault with a debugger message "suspended: signal 'SIGSEGV' received".
# 4  
Old 08-14-2008
It is declared as global variable. Is it due to some register related problem?
# 5  
Old 08-14-2008
It would help a lot if we could see the code. Does the code compile with no errors and no warnings? .. global variables are not allocated on the stack.
# 6  
Old 08-14-2008
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.
# 7  
Old 08-14-2008
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 07:56 AM.. Reason: Hey, a fellow computational linguist! http://xkcd.com/114/
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Solaris 10 error "-sh: /tmp/outfile: cannot create"

Hello, Each time a user log on to host, they receive below error: -sh: /tmp/outfile: cannot create Example: $ ssh host user@host's password: Last login: Fri Dec 4 08:17:28 2015 from client.ref |-----------------------------------------------------------------| -sh:... (2 Replies)
Discussion started by: feroccimx
2 Replies

2. Solaris

ZFS flash install "Unable to create Filesystem error"

Hi, I am trying to get an HPz420 workstation instaled (zfs root pool) via a jump-start server. I have a zfs image (from this workstation) the Solaris release is 10 1/13 update 11. I use a sparc U25 install server, upgraded to the same solaris build 10 1/13. This server is configured to install... (8 Replies)
Discussion started by: sc0rpie
8 Replies

3. Shell Programming and Scripting

Unable to store "python --version" to a shell variable

Hi All, I need to get the version of python installed and store it in a variable for later use. Whereas it is printing on the console instead of storing to variable. I am able to store output of ls command in a variable. Please check the below code : root@myhost:/volumes/srini# cat... (4 Replies)
Discussion started by: srinivasan.neel
4 Replies

4. Solaris

Netra X1 LOM: Unable to change any variable via the "set" command

I'm posting here as it didn't seem quite right in the hardware section (as it's LOM commands). My apologies if I have that wrong though :) I've finally gotten round to configuring the LOM on my Netra X1, but I can't get it to change the hostname via the "set" command: lom>show hostname... (2 Replies)
Discussion started by: Smiling Dragon
2 Replies

5. Shell Programming and Scripting

Unable to store "-e" in variable ??????

p="-e" echo $p It is not returning the value "-e" stored. Instead returns null. I am wondering how could this happen. Please help me out.I tried all possibilities like p='-e' | p="\-e". Nothing seems to work. :confused::confused: (10 Replies)
Discussion started by: shanneykar
10 Replies

6. Shell Programming and Scripting

Can't locate object method "fetchrow_array" Error

Hi, I have a perl script which is interacting with Database. I have following line of code : ================================================= sub BEGIN { #use Getopt::Std; #getopt ('S'); #($STEAP)=($opt_S); use lib ("/home/perl_lib"); use... (1 Reply)
Discussion started by: rawat_me01
1 Replies

7. Programming

shared object "undefined symbol: fstat" error

Didn't have this problem in AIX, but ported to Linux with GCC compiler and am now getting a runtime error: tssutil: symbol lookup error: /work/agility/devel/bin/libagam.so: undefined symbol: fstat I'm sure most of you know that fstat is an intrinsic function just like printf, memcpy, etc. When I... (5 Replies)
Discussion started by: marcus121
5 Replies

8. Programming

dbx error ("Executable contains object file compiled on ...")

Hi, We are trying to run dbx on a core file for which we have the original executable and libs, but not the source / object tree. We have recompiled the objects from the original source, but dbx complains that they were compiled at a different time, and refuses to read them: Object file:... (0 Replies)
Discussion started by: Sabari Nath S
0 Replies

9. UNIX for Dummies Questions & Answers

Error : "No data written to object that was write locked"

Hi All, I was able to solve my previous problem (link directory)... but now i have this following problem. I have mounted a disk from other machine using "mount -F nfs" command. When i run a batch which generates some files in that drive.... after a certain number of files i get... (1 Reply)
Discussion started by: nileshkarania
1 Replies
Login or Register to Ask a Question