__acrt_first_block == исключение заголовка при доступе к хранилищу Azure

Я очень плохо знаком с C ++ и испытываю проблемы с использованием библиотеки azure-storage-cpp для доступа к контейнерам хранения.

Вот мой код, который должен перечислять информацию о контейнерах.

bool AzureProducer::execute()
{
// Define the connection-string with your values.
const utility::string_t
storage_connection_string(U("my redacted connection string here"));

// Retrieve storage account from connection string.
azure::storage::cloud_storage_account storage_account = azure::storage::cloud_storage_account::parse(storage_connection_string);

// Create the blob client.
azure::storage::cloud_blob_client blob_client = storage_account.create_cloud_blob_client();

// Retrieve a reference to a previously created container.
azure::storage::container_result_iterator iterator = blob_client.list_containers();

azure::storage::container_result_iterator end_of_results;
for (auto it = iterator; it != end_of_results; ++it)
{
ucout << U("Container, Name = ") << it->name() << ", URI = " << it->uri().primary_uri().to_string() << std::endl;
}

return mExitFlag;
}

Когда я запускаю код в режиме отладки, он перечисляет контейнеры, как и ожидалось, в окне консоли, но выдает следующее исключение:

Ошибка отладки!

Файл: minkernel \ crts \ ucrt \ src \ appcrt \ heap \ debug_heap.cpp

Линия: 996

Выражение: __acrt_first_block == заголовок

Я недавно опубликовал этот вопрос относительно того, как добавить библиотеку Azure (CMake не может определить язык компоновщика для цели: ошибка Azurestorage) который работал отлично. Проблема сейчас в том, чтобы заставить код работать правильно. Я подозреваю, что что-то не так с тем, как я освобождаю память. Вот трассировка стека, которую я вижу в VS:

wastoraged.dll!std::_Wrap_alloc<std::allocator<std::_Container_proxy> >::deallocate(std::_Container_proxy * _Ptr, unsigned __int64 _Count) Line 988 C++
wastoraged.dll!std::_String_alloc<std::_String_base_types<wchar_t,std::allocator<wchar_t> > >::_Free_proxy() Line 661   C++
wastoraged.dll!std::_String_alloc<std::_String_base_types<wchar_t,std::allocator<wchar_t> > >::~_String_alloc<std::_String_base_types<wchar_t,std::allocator<wchar_t> > >() Line 628    C++
wastoraged.dll!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::~basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >() Line 1018 C++
wastoraged.dll!azure::storage::storage_extended_error::~storage_extended_error()    C++
wastoraged.dll!azure::storage::request_result::~request_result()    C++
wastoraged.dll!azure::storage::request_result::`scalar deleting destructor'(unsigned int)   C++
wastoraged.dll!std::allocator<azure::storage::request_result>::destroy<azure::storage::request_result>(azure::storage::request_result * _Ptr) Line 745  C++
wastoraged.dll!std::allocator_traits<std::allocator<azure::storage::request_result> >::destroy<azure::storage::request_result>(std::allocator<azure::storage::request_result> & _Al, azure::storage::request_result * _Ptr) Line 865    C++
wastoraged.dll!std::_Wrap_alloc<std::allocator<azure::storage::request_result> >::destroy<azure::storage::request_result>(azure::storage::request_result * _Ptr) Line 1004  C++
wastoraged.dll!std::_Destroy_range1<std::allocator<azure::storage::request_result>,azure::storage::request_result * __ptr64>(azure::storage::request_result * _First, azure::storage::request_result * _Last, std::_Wrap_alloc<std::allocator<azure::storage::request_result> > & _Al, std::integral_constant<bool,0> __formal) Line 1101   C++
wastoraged.dll!std::_Destroy_range<std::allocator<azure::storage::request_result>,azure::storage::request_result * __ptr64>(azure::storage::request_result * _First, azure::storage::request_result * _Last, std::_Wrap_alloc<std::allocator<azure::storage::request_result> > & _Al) Line 1121 C++
wastoraged.dll!std::<azure::storage::request_result,std::allocator<azure::storage::request_result> >::_Destroy(azure::storage::request_result * _First, azure::storage::request_result * _Last) Line 1582   C++
wastoraged.dll!std::<azure::storage::request_result,std::allocator<azure::storage::request_result> >::_Tidy() Line 1641 C++
wastoraged.dll!std::<azure::storage::request_result,std::allocator<azure::storage::request_result> >::~<azure::storage::request_result,std::allocator<azure::storage::request_result> >() Line 976  C++
wastoraged.dll!azure::storage::_operation_context::~_operation_context()    C++
wastoraged.dll!azure::storage::_operation_context::`scalar deleting destructor'(unsigned int)   C++
wastoraged.dll!std::_Ref_count_obj<azure::storage::_operation_context>::_Destroy() Line 913 C++
wastoraged.dll!std::_Ref_count_base::_Decref() Line 113 C++
wastoraged.dll!std::_Ptr_base<azure::storage::_operation_context>::_Decref() Line 339   C++
wastoraged.dll!std::shared_ptr<azure::storage::_operation_context>::~shared_ptr<azure::storage::_operation_context>() Line 567  C++
wastoraged.dll!azure::storage::operation_context::~operation_context()  C++
wastoraged.dll!azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64)::~azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64)()  C++
wastoraged.dll!std::_Compressed_pair<std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),1>::~_Compressed_pair<std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),1>() C++
wastoraged.dll!std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64>::~_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64>() Line 169  C++
wastoraged.dll!std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64>::`scalar deleting destructor'(unsigned int)    C++
wastoraged.dll!std::allocator<std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64> >::destroy<std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64> >(std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const &,unsigned __int64> * _Ptr) Line 745   C++
wastoraged.dll!std::allocator_traits<std::allocator<std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64> > >::destroy<std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64> >(std::allocator<std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const &,unsigned __int64> > & _Al, std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const &,unsigned __int64> * _Ptr) Line 865 C++
wastoraged.dll!std::_Wrap_alloc<std::allocator<std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64> > >::destroy<std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64> >(std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const &,unsigned __int64> * _Ptr) Line 1004   C++
wastoraged.dll!std::_Func_impl<azure::storage::result_segment<azure::storage::cloud_blob_container> <lambda>(const azure::storage::continuation_token &, unsigned __int64),std::allocator<int>,azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64>::_Delete_this(bool _Deallocate) Line 229   C++
MyProgram.exe!std::_Func_class<azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64>::_Tidy() Line 387  C++
MyProgram.exe!std::_Func_class<azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64>::~_Func_class<azure::storage::result_segment<azure::storage::cloud_blob_container>,azure::storage::continuation_token const & __ptr64,unsigned __int64>() Line 285 C++
MyProgram.exe!std::function<azure::storage::result_segment<azure::storage::cloud_blob_container> __cdecl(azure::storage::continuation_token const & __ptr64,unsigned __int64)>::~function<azure::storage::result_segment<azure::storage::cloud_blob_container> __cdecl(azure::storage::continuation_token const & __ptr64,unsigned __int64)>() Line 528 C++
MyProgram.exe!azure::storage::result_iterator<azure::storage::cloud_blob_container>::~result_iterator<azure::storage::cloud_blob_container>()   C++
MyProgram.exe!AzureProducer::execute()  C++

Есть идеи, что я делаю не так?

Я использую VS 2015 на Windows 10.

1

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]