Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackOverflow exception thrown when invoking StartCopyAsync on a PageBlob #597

Closed
Jericho opened this issue Dec 26, 2017 · 3 comments
Closed

Comments

@Jericho
Copy link

Jericho commented Dec 26, 2017

Whenever I try to copy a page blob, I get a StackOverflow exception and my console app crashes. This issue can be easily reproduced with the following program.cs:

using Microsoft.WindowsAzure.Storage;
using System;
using System.Threading;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var storageAccount = CloudStorageAccount.DevelopmentStorageAccount;
            var blobClient = storageAccount.CreateCloudBlobClient();
            var blobContainer = blobClient.GetContainerReference("mycontainer");

            var sourceBlob = blobContainer.GetPageBlobReference("SOURCE.txt");
            var targetBlob = blobContainer.GetPageBlobReference("TARGET.txt");
            targetBlob.StartCopyAsync(sourceBlob, null, null, null, null, CancellationToken.None).Wait();

        }
    }
}

and with the following ConsoleApp1.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="WindowsAzure.Storage" Version="8.7.0" />
  </ItemGroup>

</Project>

Here's the result when I run this console app:
sshot-12

The output window in Visual Studio shows the following:

An unhandled exception of type 'System.StackOverflowException' occurred in Microsoft.WindowsAzure.Storage.dll

@erezvani1529
Copy link
Contributor

Hi @Jericho,

Thank you very much for reporting this issue. Looks like the overload that you are using has regressed since a few releases back. We will release the fix for it asap.

As a workaround, please use the maximum overload for StartCopyAsync:

targetBlob.StartCopyAsync(sourceBlob, premiumBlobTier: null, sourceAccessCondition: null, destAccessCondition: null, options: null, operationContext: null, cancellationToken: CancellationToken.None);

@Jericho
Copy link
Author

Jericho commented Jan 9, 2018

@erezvani1529 I just want to confirm that the workaround you suggested solves the issue. Thank you.

Jericho added a commit to Jericho/Picton that referenced this issue Jan 9, 2018
…b to work around a bug in the Azure Storage SDK as discussed: Azure/azure-storage-net#597
@erezvani1529
Copy link
Contributor

@Jericho ,

This issue is fixed with v9.0.0. Thanks again for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants