Thank you for the responce
I tried the following, Please let me know , if more details are required
- Case 1:
- Stub function is declared in XXXXX_dll.h as
long __stdcall STUB_Add(long, long);
-Stub function is defined in XXXXX_main.c as
long __stdcall STUB_Add(long x, long y)
{
printf ("stub function is called \n");
return 0;
}
In one Application , I used
LoadLibrary("XXXXX.dll.so") - to load the dll
GetProcAddress("") - to get the function pointer
and if I
call the function continuously in a loop of for 1000 times, first 2
calls are success 3rd call is crashed
In another application , I used
dlopen() - to load the dll
dlsym - to get the function pointer
and if I
call the function continuously in a loop of for 1000 times, then
the I got a crash after 40 - 50 times
- Case 2:
- Stub function is declared in XXXXX_dll.h as
long STUB_Add(long, long);
-Stub function is defined in XXXXX_main.c as
long STUB_Add(long x, long y)
{
printf ("stub function is called \n");
return 0;
}
The first Application (that uses
LoadLibrary(), GetProcAddress ...) is executed without any crash.
The Second application (that uses the
dlopen, dlsym() ..) is giving the same results as in case 1. (i.e
crashing after 40-50 times)
Ananth M wrote:
>Hi
> I am able to successfully convert the windows dll into .so file and I
>am able to call the functions exported by dll from the winelib application.
> But if I call those functions from winelib application continuously for
>1000 times , in a loop, then wine is crashing with the following error
>
>err:seh:setup_exception stack overflow 28 bytes in thread 0025
>
> Then I tried calling the stub function itself in the loop (commented
>the code in stub function such that , it wont call the dll function )
>
> Still I am getting the same error.
>
> Can any one faced this problem ?
>
>Can any one help on the same
>
>
It seems that there is a mismatch between the stub's and the caller's
idea of the stack usage. This mismatch accumulates over the loop until
the stack overflows (or underflows). From your symptoms, the prime
suspect would be a stdcall/cdecl mismatch, but more information is
needed. Could you please post the declaration and the definition of your
stub, and an example of how the caller is calling such function?
Alex Villacís Lasso