[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Segmentation fault , core dumped  in  C .

Posted on 2012-08-10
38
Medium Priority
?
781 Views
Last Modified: 2013-02-28
Dear Experts,

I need read  an ascii file , it has data as an array of NxN   the values has the syntax 99.99 as maximum value  , ej.
34.23  9.12 4.7
4.12 6.2 32.08
5.2 83.1 11.27

and I need store the values in a Dynamic array.  I will be use arrays of 30x30, or  5000x5000 or  more.

My code in order to do it works fine as unique file with a main function, I  turned it into a function costs_order in a head file.
and I have a error message:  " Segmentation fault      (core dumped)"  

so, I change the core file size  to unlimited and the stack size  to 15360 kbytes

part of my valgrind output is:
-----------------------------------------------------------------------------------
....
...
[1]  {0} .. Is digit
==16707== Conditional jump or move depends on uninitialised value(s)
==16707==    at 0x8049930: costs_order(bins-hy.h:390)
==16707==    by 0x804A984: main (main.c:265)
==16707==
i:[2]  {.} .. Is a POINT
==16707== Conditional jump or move depends on uninitialised value(s)
==16707==    at 0x80499A5: costs_orderbins-hy.h:396)
==16707==    by 0x804A984: main (main.c:265)
==16707==
==16707== Invalid write of size 1
==16707==    at 0x80499C8: costs_order(bins-hy.h:398)
==16707==    by 0x804A984: main (main.c:265)
==16707==  Address 0xbea749be is not stack'd, malloc'd or (recently) free'd
==16707==
==16707==
==16707== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==16707==  Access not within mapped region at address 0xBEA749BE
==16707==    at 0x80499C8: costs_order (bins-hy.h:398)
==16707==    by 0x804A984: main (main.c:265)
==16707==  If you believe this happened as a result of a stack
==16707==  overflow in your program's main thread (unlikely but
==16707==  possible), you can try to increase the size of the
==16707==  main thread stack using the --main-stacksize= flag.
==16707==  The main thread stack size used in this run was 15728640.
==16707==
==16707== HEAP SUMMARY:
==16707==     in use at exit: 422,141 bytes in 595 blocks
==16707==   total heap usage: 16,784 allocs, 16,189 frees, 10,757,912 bytes allocated
==16707==
==16707== Searching for pointers to 595 not-freed blocks
==16707== Checked 150,844 bytes
==16707==
==16707== 228 bytes in 57 blocks are definitely lost in loss record 37 of 53
==16707==    at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==16707==    by 0x40CBA50: strdup (strdup.c:43)
==16707==    by 0x804A756: main (main.c:242)
==16707==
==16707== 11,716 bytes in 58 blocks are definitely lost in loss record 51 of 53
==16707==    at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==16707==    by 0x8049B5C: cutString (rules.h:26)
==16707==    by 0x804A756: main (main.c:242)
==16707==
==16707== LEAK SUMMARY:
==16707==    definitely lost: 11,944 bytes in 115 blocks
==16707==    indirectly lost: 0 bytes in 0 blocks
==16707==      possibly lost: 0 bytes in 0 blocks
==16707==    still reachable: 410,197 bytes in 480 blocks
==16707==         suppressed: 0 bytes in 0 blocks
==16707== Reachable blocks (those to which a pointer was found) are not shown.
==16707== To see them, rerun with: --leak-check=full --show-reachable=yes
------------------------------------------------------------------------------------------------------------------
line 396 is in the code :       len= strlen(ibuffer);
line 398  is in the code :      ibuffer[len+1]= '\0';       

  in the  for (r=0; r< lSize; r++){   also show msg ... Idont know why because the algorithm as unique main funcion c works fine!! and as head file as problems,  is the same code!! for both cases,  in one works in other has problems why?.
   
for an array of 30x30 data the buffer has a lSize with 5431  and I use 5429 it is not a stack overflow !!

pls find below the code.

what can I do? I don't understand what happend!  any idea?

my best regards,


pd.  I use ansii C under kubuntu 12.04,  gcc 4.6.3
part-of-code.txt
0
Comment
Question by:viertelstrasse
  • 13
  • 7
  • 7
  • +3
32 Comments
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38281474
First question -- What is sizeof(ibuffer) ?
0
 
LVL 13

Assisted Solution

by:Hugh McCurdy
Hugh McCurdy earned 800 total points
ID: 38281503
We don't really know if the violation is happening due to  ibuffer[len+1]= '\0';  

There are two approaches.
1. Assume that it is that statement and try to understand what is happening.  

You can compare len+1 to sizeof(ibuffer) and make sure that len+1 is indeed smaller.  (If has to be smaller. If they are equal, you have a bug.)

2. Spend time finding the statement.

You could try adding printf statements or terminating the program before and after the assignment to see what happens.
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38281521
One more question.  What are you trying to accomplish with the following statement?

ibuffer[len+1]= '\0';

strlen found that ibuffer[len] already has a null character.  Why do you need two null characters in a row?  (One reason would be that you are appending a single character to the string.)

Still, I think the issue is worthy enough of discussion that I asked the question.

In any event, I'd really like to see the result from strlen() and the result from sizeof().
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Expert Comment

by:phoffric
ID: 38281738
Run your program in ddd debugger to get additional clues. Use -ggdb -Wall compiler options, fixing all warnings.

Other options:
   http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html

>> printf("** LSIZE ES: {%ld}  strlen(buffer): {%d} **\n", lSize,strlen(buffer));
re: strlen(buffer) -- how do you know there is a terminating null byte?
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38281827
Good point phoffric about the knowing there's terminating null character.

I think that would show up if we tried to compare sizeof with strlen but it's a good point.
0
 
LVL 32

Expert Comment

by:phoffric
ID: 38281905
If you do not know how to use ddd to isolate this problem(s), then post your entire program including either build instructions or makefile, and one of us should be able to help you better.
0
 

Author Comment

by:viertelstrasse
ID: 38282074
Dear  hmccurdy,

ibuffer is a  char ibuffer[8] it is in order to storage a single char in the char array and after . Yes. Im appending a single character to the string.)

 Dear phoffric,  thanks I will compile again with your suggestions,
well,   the >> printf("** LSIZE ES: {%ld}  strlen(buffer): {%d} **\n", lSize,strlen(buffer));
the strleng(buffer)  or lSize  in order to use in my  "for"

 for (r=0; r< lSize; r++){      or      for (r=0; r< strlen(buffer) ; r++){  
because maybe  here is a stack overflow ...  but not it is!.

I add  in the end of the function  strcpy(ibuffer,"");     and now I don't have any problem for an  array of  30x30   but  for an array of 5000x5000 I have  "memory error"  :(

thanks for your suggestions and in advanced!.

chears,
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38282176
I hadn't noticed the code fragment before.  I see you are printing out as you go.

Assuming you don't get a solution by following phoffric's advice, could you share the last few lines that get printed before the crash?

(I'm assuming you haven't redirected the standard output to a file.  Is that correct?)
0
 
LVL 32

Accepted Solution

by:
phoffric earned 800 total points
ID: 38282197
>> the strleng(buffer)  or lSize  in order to use in my  "for"
But, you are using buffer without explicitly adding a terminating null byte. strlen will not stop until it hits the '\0' or until has a memory access error.

After "Is digit" and "Is a POINT" are read accesses to ibuffer. Yet, it is not clear that ibuffer has been set at those two points. Valgrind indicates "uninitialised value(s)" likely at these two LOCs.

To debug this type of problem efficiently, I recommend that you learn how to use ddd over gdb.

You can post your entire program with makefile/build instructions.
0
 

Author Comment

by:viertelstrasse
ID: 38282281
Dear experts,

-----------------------------
char ibuffer[8];
...
  strcpy(ibuffer,"");   // <--- added before to use in order to appending a single character to the string
...
------------
    Now for arrays of 30x30 works fine ...but for arrays of 5000x5000  I have a single error message       "memory error"    and with the  valgrind , it is hanging ..Im waiting and nothing, does not end. :S

Ok I will test now the ddd  ...

thnx
0
 

Author Comment

by:viertelstrasse
ID: 38282324
Dear Experts,

Finally, after a long time running valgrind show this message!! ....ohh! and now? what can I do? I need  use arrays of 5000 x 5000  

thanks in advanced!.
chears!.

--------------------------------------------------------------------------------------------------------------
Memory error==18602==
==18602== HEAP SUMMARY:
==18602==     in use at exit: 2,583,758,982 bytes in 1,279,217 blocks
==18602==   total heap usage: 178,276,343 allocs, 176,977,240 frees, 115,603,705,290 bytes allocated
==18602==
==18602==
==18602==     Valgrind's memory management: out of memory:
==18602==        newSuperblock's request for 5120000 bytes failed.
==18602==        3109568512 bytes have already been allocated.
==18602==     Valgrind cannot continue.  Sorry.
==18602==
==18602==     There are several possible reasons for this.
==18602==     - You have some kind of memory limit in place.  Look at the
==18602==       output of 'ulimit -a'.  Is there a limit on the size of
==18602==       virtual memory or address space?
==18602==     - You have run out of swap space.
==18602==     - Valgrind has a bug.  If you think this is the case or you are
==18602==     not sure, please let us know and we'll try to fix it.
==18602==     Please note that programs can take substantially more memory than
==18602==     normal when running under Valgrind tools, eg. up to twice or
==18602==     more, depending on the tool.  On a 64-bit machine, Valgrind
==18602==     should be able to make use of up 32GB memory.  On a 32-bit
==18602==     machine, Valgrind should be able to use all the memory available
==18602==     to a single process, up to 4GB if that's how you have your
==18602==     kernel configured.  Most 32-bit Linux setups allow a maximum of
==18602==     3GB per process.
==18602==
==18602==     Whatever the reason, Valgrind cannot continue.  Sorry.
0
 
LVL 32

Expert Comment

by:phoffric
ID: 38282358
>> 3109568512 bytes have already been allocated.
For some reason your program appears to be currently using 3GB memory. Are you allocating without properly freeing? Check this without Valgrind in place.
0
 

Author Comment

by:viertelstrasse
ID: 38282496
Dear phoffric

I freeing the  all  memory used.   I use  free() function.   Also for the dynamic vector and all dynamic structure.

pls find enclose the image of the ulimit -a .         I use a  32-bit kubuntu  on processor intel i5 with, 4GB ram.
 

any suggestions?

Thanks in advanced.
message-valgrind3.jpg
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38282651
Was this from the 30x30matrix?

==16707==    definitely lost: 11,944 bytes in 115 blocks

That's a memory leak.  I think it would be useful to see what valgrind reports at 30x30 and then at 100x100 and so forth.  If the leak gets bigger, it could be the problem.

Regardless, at least at the time of that valgrind test you had a memory leak.
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38282656
I assume there's a reason, such as the program is proprietary, why we can't get to see the entire program.  Is that correct?

It's a lot easier to debug the code if we have the code.
0
 
LVL 32

Expert Comment

by:phoffric
ID: 38282675
If the program is proprietary, then the standard practice is for you to sanitize it and shrink the program down while still maintaining the problems you are seeing. Then you can post this minimal program.

Confirm that your program is requiring more memory as processing continues by adding breakpoints and monitor memory usage.
0
 

Author Comment

by:viertelstrasse
ID: 38282777
Dear Experts,

It is the Heap Summary for a 30x30 array , the operations in the array is only are extract information . By other hand,  I use newlisp has shared library loaded in my code because I send a string (lisp instructions) are executed and return the value to C.  
 
For this 30x30 array runs OK ..However I don't know why I have memory leaks .

what happend?  
thanks very much in advanced.
my best regards,

The small part of code is attached

reference:
http://www.newlisp.org/CodePatterns.html#toc-24


==3057==
==3057== HEAP SUMMARY:
==3057==     in use at exit: 414,821 bytes in 564 blocks
==3057==   total heap usage: 16,789 allocs, 16,225 frees, 10,758,736 bytes allocated
==3057==
==3057== Searching for pointers to 564 not-freed blocks
==3057== Checked 144,912 bytes
==3057==
==3057== LEAK SUMMARY:
==3057==    definitely lost: 167,197 bytes in 119 blocks
==3057==    indirectly lost: 0 bytes in 0 blocks
==3057==      possibly lost: 0 bytes in 0 blocks
==3057==    still reachable: 247,624 bytes in 445 blocks
==3057==         suppressed: 0 bytes in 0 blocks
==3057== Rerun with --leak-check=full to see details of leaked memory
==3057==
==3057== Use --track-origins=yes to see where uninitialised values come from
==3057== ERROR SUMMARY: 26 errors from 11 contexts (suppressed: 0 from 0)
==3057==
==3057== 1 errors in context 1 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x46128F8: makeStringSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057==
==3057== 1 errors in context 2 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x4612BB3: initialize (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057==
==3057== 1 errors in context 3 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x4612B89: initialize (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057==
==3057== 1 errors in context 4 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x4612B5F: initialize (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057==
==3057== 1 errors in context 5 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x4612B35: initialize (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057==
==3057== 1 errors in context 6 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x4612B0B: initialize (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057==
==3057== 1 errors in context 7 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x4612AE1: initialize (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057==
==3057== 1 errors in context 8 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x4612AB7: initialize (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057==
==3057== 1 errors in context 9 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x4612A30: initialize (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057==
==3057== 1 errors in context 10 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x46129FD: initialize (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057==
==3057== 16 errors in context 11 of 11:
==3057== Conditional jump or move depends on uninitialised value(s)
==3057==    at 0x4612403: copyCell (in /usr/lib/newlisp.so)
==3057==    by 0x461C7D7: translateCreateSymbol (in /usr/lib/newlisp.so)
==3057==    by 0x4612C0C: initialize (in /usr/lib/newlisp.so)
==3057==    by 0x40694D2: (below main) (libc-start.c:226)
==3057==
==3057== ERROR SUMMARY: 26 errors from 11 contexts (suppressed: 0 from 0)
code-part2.txt
0
 

Author Comment

by:viertelstrasse
ID: 38282857
Dear Experts,

I don't understand why the memory leaks,  for sample for a function that cut String

1.char *cutString(char *str, int start, int len){
2.     char *s;
3.     s= (char*)malloc(len + 1);
4.      if (s){
5.     strncpy(s, str+start, len);
6.    s[len] = '\0';
7.  }
8.  return strdup (s);
9. }

valgrind report memory leak in the line 3  . If I use a free (s) before of return strdup (s);  the value will be lost,   and   by other hand, if the free(s) is not used I will have a memory leak.  so? what is the way to don't have value lost and memory leak?
¿?     :S
thnks in advanced.!
0
 
LVL 32

Assisted Solution

by:phoffric
phoffric earned 800 total points
ID: 38282881
>> what is the way to don't have value lost and memory leak?
These are good questions; possibly they are a new question for another thread.

We do not know whether your original question, "Segmentation fault , core dumped" has been solved.

We did not get feedback from you regarding some of the various specific suggestions we have made. Right now, I am not sure what tests you have done, and what code changes you have made to your original post.
0
 
LVL 13

Assisted Solution

by:Hugh McCurdy
Hugh McCurdy earned 800 total points
ID: 38284013
I'm with phoffric that this the memory leak is a new question but I also asked you to focus on it.  Also, it's easy for me to answer the question.

s is a local variable.  It goes out of scope when you return.  The pointer is gone and the memory is still allocated.

The function is returning a pointer to a new string, which was created by strdup.

I, and I'm sure others, would be happy to discuss memory leaks in great detail in a new thread.  The C zone gets very little traffic and appears to be monitored by several experts.  (New threads will get attention).
0
 
LVL 35

Expert Comment

by:sarabande
ID: 38287406
to solve the leak replace

return strdup (s);

Open in new window


by

return s;

Open in new window


and free the s in the calling function after use.


if your program is c++ i would use std::string and std::vector instead of c arrays. those classes would have a much better memory management than you (probably) will do it now. for example a

std::vector<std::vector<float> >  xarr(5000, std::vector<float>(5000, 0.0));

Open in new window


would create 5.000 "row" arrays each of them is 5.000 x sizeof(float), what is 20.000 bytes each. if you create one single 2-d array of 5000x5000 float, it has a size of 100 mb, and it is a good chance that the request failed because there is not so much contiguous memory available.  

Sara
0
 
LVL 18

Expert Comment

by:Jose Parrot
ID: 38287606
Let me suggest another approach. If you are using strings arrays, should allocate twice. First for the row (the size of the bigger string), then for the column. Strings have unknown size when defined by pointers, as it is the case. So the compiler assumes a default lenght, not necessarily what we need.

Below, an example of memory allocation with  integers, which lenght is known.
 
void createMatrix(int dimension)
{
int **assigncost;
assigncost = new int*[dimension];
for (int i = 0; i < dimension; i++)
    assigncost[i] = new int[dimension];
}

Open in new window

completed with
delete[] assigncost;

Open in new window

Jose
0
 

Author Comment

by:viertelstrasse
ID: 38288152
Im using C .  not C++
0
 
LVL 35

Assisted Solution

by:sarabande
sarabande earned 400 total points
ID: 38288904
ok. but the code is not good.

the segmentation fault was because of ibuffer[len+1]='\0'; already pointed out by hmccurdy and phoffric. you said you solved that problem by an initial strcpy but actually any wrong data in your text file and a missing space character at end of a line would cause your program again to write beyond the boundaries of the ibuffer. why do you use only a 8-byte temporary buffer? even if you don't expect bigger numbers in your file, it is basic practice to check sizes before making a copy beside your target buffer is big enough for any garbage what it definitively is not.

the memory error was because valgrind needs additional memory. so valgrind used all memory when you try to allocate a huge contiguous char buffer for the file. to resolve from that you should consider a few changes:

- read the file line by line instead of reading the whole contents. if it contains 25 million of numbers  where each number needs 8 bytes with separator, you now try to get memory of 200 mb for the doubles and 200 mb  contiguous memory for the file what apparanetly is too much, at least when running with valgrind.

- try to change the call_costsX that it could calculate subtotals out of the numbers of a row. that way you need only to store the numbers for one row and not for the whole matrix. if you need sum totals to calculate the subtotals, make two runs.

- use float instead of double.

Sara
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38300125
Hi,

Did we answer your original question?  If not, where are you stuck?

~Hugh
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 38902306
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38902307
I think the question was answered but the author wouldn't confirm it.  The reason I think this is because he went on to a second question without starting a new thread.

The problem is that we don't know which one of us answered the question.  My guess is that it was a combination.  There should be some way to award points in this muddle because I have pretty good confidence that we did solve the first question.
0
 
LVL 32

Expert Comment

by:phoffric
ID: 38904125
I agree with hmccurdy as to the first question being answered. The follow-on 2nd question may have required some additional input.

I will leave it to the other experts to make their recommendations.
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38909291
IMHO, the initial problem was acknowledged as solved by the author with post ID: 38282281 and the statement "Now for arrays of 30x30 works fine..."  What happened is that once we solved the first problem, instead of posting a new problem (as he should have because it was a new problem), he piggybacked.

(I know EE doesn't work this way but the author really did ask 2 difficult questions at different times and, IMHO, should be 500 points for the first and 500 points for the second.  Perhaps 500 points with an A grade for the first and 500 points with an A or  a B grade for the second.  In this case, I would say A.  In any event...back on task...)

My proposal is a grade of A and points awarded as follows for the first question.
ID: 38282197 -- Best answer 350 points
ID: 38281503 -- Assist 150 points.

I also think 400/100 is fair but I did spend time discovering the point of answer and doing this analysis.

-------

As for question #2, if there's some way for EE to award points for the follow-up question that should have been a new question.  (Grade A because the answers were quality.)
ID: 38288904 -- Best answer 300 points
ID: 38282881 -- Assist 100 points
ID: 38284013 -- Assist 100 points

Again, I don't know if these points can be awarded but IMHO, they should be awarded to a "virtual" second post.  (There should have been a second post because it was a distinct question not initially asked with a very different solution.)
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38915042
Figure it didn't hurt to ask.  The asker was author was asked to post a new question but he didn't, for whatever reason.

In any event, I suggest you either award the points as I suggested in the first section (because of the strong evidence that the first question was indeed answered) or combine the suggestions and divide the points by 2 (so that they add up to 500 instead of 1000).

In any event, I have very high confidence that the original question was answered especially since the Author said it was by saying that it worked now for 30x30.  But once that was fixed, he found another error with his program.
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 38921921
Fine with me.
0
 
LVL 35

Expert Comment

by:sarabande
ID: 38925544
fair enough. an equal split was the wisest decision cause we don't know whether any of the comments really helped. but a new reader could take benefit from comments.

Sara
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question