-
Notifications
You must be signed in to change notification settings - Fork 148
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
Debug Assertion Expression: _pFirstBlock == pHead #9
Comments
Just an update on this issue, it appears to only happen when using the Azure library in an MFC project that is used statically. |
We were unable to reproduce the error you are seeing using the sample code you provided. The error could be caused by an invalid storage connection string. Could you please double check that your storage connection string has a valid format? -Mike Fisher, Microsoft Azure Storage |
I am using "UseDevelopmentStorage=true" for the emulator but this is irrelevant as the connection string isn't the cause. The simplest way to reproduce this issue is to take the Microsoft.WindowsAzure.Storage.TablesGettingStarted.v120 sample project and change the Use of MFC setting from "Use Standard Windows Libraries" to "Use MFC in a Static Library". The assertion is triggered at the line The assertion is not triggered if Use of MFC is set to "Shared DLL". |
Thank you for the detailed repo steps. I am seeing the same assertion using the sample project as you suggested. I do not see the assertion using a fresh MFC project (because it uses /MDd, see below…). The root cause of the problem is memory is being allocated in the Azure Storage library (or REST SDK library, which is a dependency of ours). Then the memory is being freed in your application. These are using different heaps, so they are getting confused. A solution is to compile your application with the /MT or /MTd option instead of /MD or /MDd. See: http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx. This will make a multithreaded module a DLL. |
The assertion is still triggered for me when compiled with either /MT or /MTd with the sample project. In fact the sample projects are configured to use /MT and /MTd by default. |
Sorry, I got those backwards. I meant to say, compile your application with the /MD or /MDd option instead of /MT or /MTd. |
@MFisherMSFT Thank you! |
@MFisherMSFT Thanks a lot. |
The following assertion error is triggered after updating to version 0.3, but it does not happen with the version 0.2 build.
Debug Assertion Failed!
Program: F:\0Main\Tools\AzureTester\Debug\AzureTester.exe
File: f:\dd\vctools\crt\crtw32\misc\dbgheap.c
Line: 1424
Expression: _pFirstBlock == pHead
The code that triggers this assertion is:
azure::storage::cloud_storage_account storage_account = azure::storage::cloud_storage_account::parse(storage_connection_string);
azure::storage::cloud_table_client table_client = storage_account.create_cloud_table_client();
azure::storage::cloud_table table = table_client.get_table_reference(U("testtable"));
and the only difference between this code and the one used in 0.2 is the change in the namespace from wa::storage to azure::storage. The assertion only appears in the debug build and not in the release build, but in release build it appears to cause failures down the line that results in exceptions that do not happen when using the 0.2 build. Library was downloaded via nuget, I'm using VS2013 on x64,
The text was updated successfully, but these errors were encountered: