LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I remove "Stack Overflow" error?

I have a My-CVI.DLL and My-Prog.exe files. The DLL exports a function that inputs a pointer to an array of UNSIGNED CHAR. The EXE passes an array of size [102400] and the program exits out with a "Stack Overflow" error.
- I increased the projects' (My-DLL.prj and My-EXE.prj) stack size in both EXE and DLL (def=250000, into=2500000), but it still had the same problem
- when I reduced the size to [10240], it worked, but this size is too small

What is causing that?

int foo( unsigned char *arr ); // exported in DLL
static unsigned char buf[102400];
main() {
static unsigned char buf2[102400];
foo(buf); // causes "Stack Overflow" error
foo(buf2); // this too
}
0 Kudos
Message 1 of 2
(3,253 Views)
Hello

I tried to alter the cvi dll examples to try to reproduce this problem, but I was unable to reproduce the problem. You might want to make sure that your prototypes match up correctly and that its not something else. If you have some project that reproduces the problem, you can post it here.

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 2
(3,253 Views)