Thank you for the responce<br>
<br>
I tried the following, Please let me know , if more details are required <br>
&nbsp;&nbsp; <br>
- Case 1:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Stub function is declared in XXXXX_dll.h as&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long __stdcall STUB_Add(long, long);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Stub function is defined&nbsp; in XXXXX_main.c as&nbsp; <br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long __stdcall STUB_Add(long x, long y)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
printf (&quot;stub function is called \n&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In one Application , I used <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LoadLibrary(&quot;<a href="http://XXXXX.dll.so">XXXXX.dll.so</a>&quot;) - to load the dll<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetProcAddress(&quot;&quot;) - to get the function pointer<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and if I
call the function continuously in a loop of for 1000 times, first 2
calls are success 3rd call&nbsp; is crashed<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; In another application , I used <br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dlopen() - to load the dll<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dlsym - to get the function pointer<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and if I
call the function continuously in a loop of for 1000 times,&nbsp; then
the I got a crash after 40 - 50&nbsp; times<br>
<br>
<br>
- Case 2:<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Stub function is declared in XXXXX_dll.h as&nbsp; <br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long STUB_Add(long, long);<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Stub function is defined&nbsp; in XXXXX_main.c as&nbsp; <br>


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long STUB_Add(long x, long y)<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
printf (&quot;stub function is called \n&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 0;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>

 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The first&nbsp; Application (that uses
LoadLibrary(), GetProcAddress ...) is executed without any crash.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The Second application (that uses the
dlopen, dlsym() ..) is giving the same results as in case 1. (i.e
crashing after 40-50 times)<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>

<br>
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
 <br><div><span class="gmail_quote">On 12/23/05, <b class="gmail_sendername">Alex Villac��s Lasso</b> &lt;<a href="mailto:a_villacis@palosanto.com">a_villacis@palosanto.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ananth M wrote:<br><br>&gt;Hi<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I am able to successfully convert the windows dll into .so file and I<br>&gt;am able to call the functions exported by dll from the winelib application.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; But if I call those functions from winelib application continuously for
<br>&gt;1000 times , in a loop, then&nbsp;&nbsp;wine is crashing with the following error<br>&gt;<br>&gt;err:seh:setup_exception stack overflow 28 bytes in thread 0025<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Then I tried calling the stub function itself in the loop (commented
<br>&gt;the code in stub function such that , it wont call the dll function )<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Still I am getting the same error.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Can any one faced this problem ?<br>&gt;<br>&gt;Can any one help on the same
<br>&gt;<br>&gt;<br>It seems that there is a mismatch between the stub's and the caller's<br>idea of the stack usage. This mismatch accumulates over the loop until<br>the stack overflows (or underflows). From your symptoms, the prime
<br>suspect would be a stdcall/cdecl mismatch, but more information is<br>needed. Could you please post the declaration and the definition of your<br>stub, and an example of how the caller is calling such function?<br><br>
Alex Villac�s Lasso<br><br></blockquote></div><br>