Out of stack space error in VB when uploading file - WeOnlyDo Discussion board

Out of stack space error in VB when uploading file (wodSFTP / wodSFTP.NET / wodSFTPdll)

by RBosveld, Wednesday, October 20, 2004, 17:27 (7121 days ago)

Hi,
We've recently purchased wodftpdlx and I'm very pleased with it so far. However I've run into a strange problem and no matter what I try, I can't get around it. I'm working in Visual Basic btw.
Whenever I try to upload a file larger then roughly 32kb with SFTP it freezes for a few secs then VB pops up a messagebox with an Out of stack space error. It works fine for smaller files. When I use regular FTP it works fine for any filesize.

To exclude that it might be caused by my own code, I tried the same with one of your samples (VB/Component/1. Simple). I still get a stack error, only slightly different this time: VB just quits alltogether and DrWatson pops up. When I look in the DrWatson log I see this message:

[code]Application exception occurred:
App: VB6.exe (pid=1840)
When: 10/20/2004 @ 15:37:11.571
Exception number: c00000fd (stack overflow)
[/code]

To exclude everything (like things going wrong in the code in the events, etc), I created a new empty project and only put in the most basic statements to connect and upload. Now I get the messagebox with the Out of stack space error again.

Here's that project:
Create a form, put a button on it, then copy & paste the following code:

[code]
Option Explicit

Dim WithEvents Ftp1 As wodFtpDLXCom

Private Sub Form_Load()

Set Ftp1 = New wodFtpDLXCom
End Sub

Private Sub Form_Unload(Cancel As Integer)

Set Ftp1 = Nothing
End Sub

Private Sub Command1_Click()

Ftp1.HostName = <edited: our server>
Ftp1.Login = <edited: my username>
Ftp1.Password = <edited: my password>
Ftp1.Passive = False
Ftp1.Protocol = SFTP
Ftp1.Blocking = True

Ftp1.Connect

Ftp1.RemotePath = /home/rbo003db/test
Ftp1.LocalPath = D:\Test34kb.txt

Ftp1.PutFile '<- heres where the error occurs

Ftp1.Disconnect
End Sub
[/code]

I also created an .exe and tried running that to see what happens. When I press the button the program freezes for a few secs then simply disappears without any errormsg.


The software I am using:
- Visual Basic 6
- Windows 2000 SP4 + all the latest updates
- wodFTPdlx component, version 2.3.0.5
- The FTP Server is on our intranet. This is what it reports when I connect to it: Version 6.5/OpenBSD, linux port 0.3.2


The problem only occurs when I use SFTP. Unfortunately, we really need SFTP.:)
I hope you can help me with this problem.

Thx,

Ronald Bosveld
ING Car Lease Netherlands

Re: Out of stack space error in VB when uploading

by wodSupport, Wednesday, October 20, 2004, 18:26 (7121 days ago) @ RBosveld

Ronald,

I see. Let me try to duplicate this. I'll post here my results in a hour-two. You do use most recent version of wodFtpDLX, correct?

Kreso

Re: Out of stack space error in VB when uploading

by RBosveld, Wednesday, October 20, 2004, 18:36 (7121 days ago) @ wodSupport

Yup, latest version.

Btw, I won't be at work anymore in 2 hours. You don't have to stay late for this. :)

Re: Out of stack space error in VB when uploading

by wodSupport, Wednesday, October 20, 2004, 18:42 (7121 days ago) @ RBosveld

Ronald,

one more question: is there any other wodFtpDLX-related code in your app, such as it's events? It may be important.

Re: Out of stack space error in VB when uploading

by RBosveld, Wednesday, October 20, 2004, 18:52 (7121 days ago) @ wodSupport

In my original program there is some code in some events like statechange and pretranslatereply, but only for logging purposes. I just record the information you give back both internally (in a collection) and to a file. And I use the progress event to control a progressbar.

But in that project I posted I don't use events at all. I posted all the code there is.
That's why I did that test, my first guess was that I was doing something in an event that triggered that event again, thereby creating an ifinite loop and the stack overflow.

Re: Out of stack space error in VB when uploading

by RBosveld, Wednesday, October 20, 2004, 19:26 (7121 days ago) @ RBosveld

Perhaps this also helpfull.
I just did some more testing in that project I posted. I put a Stop statement in every event of wodftpDlx so I could track what events fired and I could debug through the putfile command.
What I found: Directly after I execute the putfile command the statechange event fires. State property is 16, Statetext says Sending data to server . Then the progress event fires once with parameter Position=0 and Total= size of the file. Then a freeze for a few seconds and the out of stack space error occurs.
The problem seems to occur when it tries to initiate the transfer, not when it is already uploading the file and reaches this limit of 32 kb.

Re: Out of stack space error in VB when uploading

by wodSupport, Wednesday, October 20, 2004, 21:03 (7121 days ago) @ RBosveld

Ronald,

I was affraid this would happen - it works for me without any problems :( I pasted your code, changed hostname/login/password and changed local/remote paths. And it worked each time, didn't have any issues.

Can you send me email (techsupport@weonlydo.com) so I can give you details from our UNIX testing server. We could both attack it so we can exchange exact source code that causes these troubles.