Memory Problem After a certain limit

Thread Solved

Join Date: Jun 2009
Posts: 139
Reputation: Dream2code is an unknown quantity at this point 
Solved Threads: 11
Dream2code's Avatar
Dream2code Dream2code is offline Offline
Junior Poster

Re: Memory Problem After a certaion limit

 
0
  #11
Jul 14th, 2009
Originally Posted by Hiroshe View Post
Try making a smaller example of the problems... that program looks a over complicated. If what you have work's, exept for a few errors, don't worry about changing it. Here's how I would go around doing it:
First read the description file to make a sscanf string, and make two arrays, one to hold the names of the variables, and another to hold the variables. Since the datatype can vary, maybe make the second array an array of pointers.
Next read the data file, record by record and as you index along print out the variables with there names.
Good luck.

Here the problem is not so big.Complie and run the code once.it will work fine.

and its about two functions dont go to the code now just run it and
face the problem then u will definately get sumthing.

Thanks in advance.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 139
Reputation: Dream2code is an unknown quantity at this point 
Solved Threads: 11
Dream2code's Avatar
Dream2code Dream2code is offline Offline
Junior Poster

Re: Memory Problem After a certain limit

 
0
  #12
Jul 14th, 2009
Hello Ancient Dragon,

we are operating on UNIX environment.It will be used in UNIX only.
anyways next time onwards will take care about indetation it a word.

can you please go though my problem:

1st compile and run the code as i said in #1. then while running for different files u will face the problem after the column count exceeds 10.

but why only 10???

but both the functions a running fine independently.

check it one please.
Last edited by Dream2code; Jul 14th, 2009 at 3:02 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 169
Reputation: tuse is an unknown quantity at this point 
Solved Threads: 14
tuse's Avatar
tuse tuse is offline Offline
Junior Poster

Re: Memory Problem After a certain limit

 
0
  #13
Jul 14th, 2009
did you try debugging using gdb?
My blog on .NET- http://dotnet.tekyt.info
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,378
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Memory Problem After a certain limit

 
0
  #14
Jul 14th, 2009
You need to post the input data file (zip it up first!) because the program you posted produces these errors on the three example lines you posted in your post #1.
Dml Error: at line 1
Dml error: Missing ; at line 2
Press any key to continue . . .
it works upto 10 columns.

when the column name exceeds 10

it shows "segmentation fault"
>>record->column_delim=(char**)malloc(10*sizeof(char*));

That line looks awfully suspicious of the reason for your error. It is only allocating room for 10 pointers
Last edited by Ancient Dragon; Jul 14th, 2009 at 9:05 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 139
Reputation: Dream2code is an unknown quantity at this point 
Solved Threads: 11
Dream2code's Avatar
Dream2code Dream2code is offline Offline
Junior Poster

Re: Memory Problem After a certain limit

 
0
  #15
Jul 14th, 2009
Originally Posted by Ancient Dragon View Post
You need to post the input data file (zip it up first!) because the program you posted produces these errors on the three example lines you posted in your post #1.



>>record->column_delim=(char**)malloc(10*sizeof(char*));

That line looks awfully suspicious of the reason for your error. It is only allocating room for 10 pointers
i have given the dml syntax.put in mind that

format like
begin
column_1 string("|");
column_2 string("|");
....

column_n string("\n");
end;

at the End of line 2 in the dml a space is there.

"EVERY STATEMENT SHOULD END WITH A SEMICOLON EXCEPT THE BEGIN AND ENSURE THAT NO SPACE SHOULD BE THERE AFTER THE SEMICOLON"

Thats not the program error..its the error of symantic checker of my program.



record->column_delim=(char**)malloc(10*sizeof(char*));

if its the problem then we should not be able to print the informations from the description file.But we can print it.

and i changed this 10 to 1 ..5 ..20..50 ...many times.

M waiting for a miracle.lets see.its actually a strange problem.

Thanks
DP
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 139
Reputation: Dream2code is an unknown quantity at this point 
Solved Threads: 11
Dream2code's Avatar
Dream2code Dream2code is offline Offline
Junior Poster

Re: Memory Problem After a certain limit

 
0
  #16
Jul 14th, 2009
Originally Posted by tuse View Post
did you try debugging using gdb?
i dont know actually how to use gdb.

please u try once from your side to debug and find the solution.

And please teach to about the usage of gdb.

Thanks,
DP
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,378
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Memory Problem After a certain limit

 
0
  #17
Jul 14th, 2009
I'm only going to say this once more -- post the file, dummy it up with fake names if you want, but we need your file to work with. The example lines you posted in post #1 don't work
Deepak|23|M
puja|21|f
|XY|
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,378
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Memory Problem After a certain limit

 
0
  #18
Jul 14th, 2009
Originally Posted by Dream2code View Post
i dont know actually how to use gdb.

please u try once from your side to debug and find the solution.

And please teach to about the usage of gdb.

Thanks,
DP
Well why don't you learn how to use gdg? Start with google.

>>please u try once from your side to debug and find the solution.
DaniWeb is not your a debugger.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 139
Reputation: Dream2code is an unknown quantity at this point 
Solved Threads: 11
Dream2code's Avatar
Dream2code Dream2code is offline Offline
Junior Poster

Re: Memory Problem After a certain limit

 
0
  #19
Jul 14th, 2009
description file:
=================

begin
name string("|");
age string("|");
a string("|");
a string("|");
a string("|");
a string("|");
a string("|");
a string("|");
a string("|");
a string("|");
sex string("\n");
end;

data file:
============

x|y|x|a|b|c|d|d|d|a|a|d
x|y|x|a|b|c|d|d|d|a|a|d
x|y|x|a|b|c|d|d|d|a|a|d
x|y|x|a|b|c|d|d|d|a|a|d


anyways u can create any kind of file as per the description file syntax and after that
create any data file as per the description file.

In my post#1 every thing described properly.
In fact it a realtime utility to be used in the server.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 139
Reputation: Dream2code is an unknown quantity at this point 
Solved Threads: 11
Dream2code's Avatar
Dream2code Dream2code is offline Offline
Junior Poster

Re: Memory Problem After a certain limit

 
0
  #20
Jul 14th, 2009
Originally Posted by Ancient Dragon View Post
Well why don't you learn how to use gdg? Start with google.

>>please u try once from your side to debug and find the solution.
DaniWeb is not your a debugger.
i am ready to learn and take the tips all time.will learn gdb soon.
anyways now i am concentraing on this problem.

Thanks for your advice.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC