Azure / Azure/azure-sdk-for-cpp
Can't run example blob due to BlobContainerClient crashing in LogOptions set(const set& _Right)
- Dominant language
- C++
- Stars
- 205
- Forks
- 172
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 37
Description
**Describe the bug**
Unhandled exception thrown: read access violation.
_Right_scary->_Myhead was 0x1.
***Exception or Stack Trace***
```
template <_Strategy _Strat>
void _Copy(const _Tree& _Right) { // copy or move entire tree from _Right
const auto _Scary = _Get_scary();
const auto _Right_scary = _Right._Get_scary();
_Scary->_Myhead->_Parent = _Copy_nodes<_Strat>(_Right_scary->_Myhead->_Parent, _Scary->_Myhead); <---- exception here
Disassembly of the call to the copy above:
pvcl_test.exe!Azure::Core::Http::Policies::LogOptions::LogOptions(void):
00007FF6B3B0BBD0 mov qword ptr [rsp+8],rcx
00007FF6B3B0BBD5 push rdi
00007FF6B3B0BBD6 sub rsp,30h
00007FF6B3B0BBDA mov rax,qword ptr [this]
00007FF6B3B0BBDF mov qword ptr [rsp+20h],rax
00007FF6B3B0BBE4 mov rdx,qword ptr [__imp_Azure::Core::Http::Policies::_detail::g_defaultAllowedHttpQueryParameters (07FF6B48F9448h)]
00007FF6B3B0BBEB mov rcx,qword ptr [rsp+20h]
00007FF6B3B0BBF0 call std::set,std::allocator >,std::less,std::allocator > >,std::allocator,std::allocator > > >::set,std::allocator >,std::less,std::allocator > >,std::allocator,std::allocator > > > (07FF6B39AA80Dh)
Executing this call from the example:
auto containerClient = BlobContainerClient::CreateFromConnectionString(GetConnectionString(), "sandbox");
azure_test.exe!std::_Tree,std::allocator,0>>::_Copy<0>(const std::_Tree,std::allocator,0>> & _Right) Line 1633 C++
azure_test.exe!std::_Tree,std::allocator,0>>::_Tree,std::allocator,0>>>>(const std::_Tree,std::allocator,0>> & _Right, std::allocator> && _Al) Line 898 C++
azure_test.exe!std::set,std::allocator>::set,std::allocator>(const std::set,std::allocator> & _Right) Line 87 C++
azure_test.exe!Azure::Core::Http::Policies::LogOptions::LogOptions() C++
azure_test.exe!Azure::Core::_internal::ClientOptions::ClientOptions() Line 56 C++
[External Code]
```
**To Reproduce**
Build and run the example from here: https://github.com/Azure/azure-sdk-for-cpp or here: https://github.com/Azure/azure-sdk-for-cpp/blob/main/sdk/storage/azure-storage-blobs/samples/blob_getting_started.cpp
I tried this with both examples, both produce the same results. The `LogOptions` have some issue when the `ClientOptions() = default;` is called creating a `BlobContainerClient`
***Code Snippet***
auto containerClient = BlobContainerClient::CreateFromConnectionString(GetConnectionString(), "sandbox");
**Expected behavior**
Don't crash
**Setup (please complete the following information):**
- OS: Windows
- IDE : MSVC 2022
- Revision: 576379156e82da642f8d1834220876759f13534d
Author: Timur Chernykh <45117783+t43rr7@users.noreply.github.com>
Date: 7/5/2024 11:07:14 AM
Message:
[libcgroup] added new port (#39647)
Contributor guide
Assessment
This issue has not been assessed yet.