Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

zarkoh

Re: System.OverflowException in WinSCP.ConsoleCommStruct..ctor

Yes, using a 64-bit Windows 8 (Release Preview).

Trying on a different machine with the same OS I don't experience the issue, so it is probably some 32-bit vs. 64-bit combination of Visual Studio / solution / project target configuration that is causing the failure.

I'll report back if I manage to force it or bump into it again.

martin wrote:

I suppose you are using 64-bit OS, right?
https://learn.microsoft.com/en-us/dotnet/api/system.intptr.toint32

This bug has been added to the tracker:
https://winscp.net/tracker/869
zarkoh

System.OverflowException in WinSCP.ConsoleCommStruct..ctor

Following the C# example given at https://winscp.net/eng/docs/library#csharp

with the same standard SessionOptions configuration, I am getting the following

Error: System.OverflowException: Arithmetic operation resulted in an overflow.
at System.IntPtr.ToInt32()
at WinSCP.ConsoleCommStruct..ctor(Session session, SafeFileHandle fileMapping)
at WinSCP.ExeSessionProcess.AcquireCommStruct()
at WinSCP.ExeSessionProcess.InitializeConsole()
at WinSCP.ExeSessionProcess.Start()
at WinSCP.Session.Open(SessionOptions sessionOptions)
at ConsoleApplication1.Program.Main(String[] args) in ...\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs
:line 28

on session.Open(sessionOptions);

This basic attempt was made in a console application in VS 2012, targeting .NET 4 and using the latest dll and exe of WinSCP 5.0.7 beta.

Does anything obvious come to mind?