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

Nullable::Emplace doesn't set m_hasValue = true #5172

Closed
tudor opened this issue Nov 18, 2023 · 0 comments · Fixed by #5178
Closed

Nullable::Emplace doesn't set m_hasValue = true #5172

tudor opened this issue Nov 18, 2023 · 0 comments · Fixed by #5178
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@tudor
Copy link

tudor commented Nov 18, 2023

Describe the bug
Azure::Nullable::Emplace creates an object as m_value but forgets to set m_hasValue = true.

Code Snippet

Azure::Nullable<int> x;
x.Emplace(42);
assert(x.HasValue());

Expected behavior
Emplace should actually engage the Nullable object, just like std::optional::emplace.

Setup (please complete the following information):
The bug still exists in trunk at the time of my writing:

::new (static_cast<void*>(&m_value)) T(std::forward<U>(Args)...);

@github-actions github-actions bot added Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 18, 2023
azure-sdk added a commit to azure-sdk/vcpkg that referenced this issue Jan 11, 2024
## 1.11.0 (2024-01-11)

### Features Added

- Added 'OPTIONS' HTTP method to `Azure::Core::Http::HttpMethod` enum.
- Added TLS 1.3 support to WinHTTP transport.
- Environment Log Level Listener now logs the ThreadID for the thread originating the trace.
- [[microsoft#4983]](Azure/azure-sdk-for-cpp#4983) Added support for setting `CURLOPT_CAPATH` libcurl option on Linux. (A community contribution, courtesy of _[phoebusm](https://github.com/phoebusm)_)

### Bugs Fixed

- [[microsoft#5172]](Azure/azure-sdk-for-cpp#5172) `Azure::Nullable::Emplace()` does not set `HasValue()` to `true`.
- [[microsoft#5130]](Azure/azure-sdk-for-cpp#5130) `Url::AppendPath()` and `Url::SetPath()` may end up with a double slash at the beginning of a path.
- [[microsoft#5007]](Azure/azure-sdk-for-cpp#5007) Some versions of GCC no longer include stdint.h in cstdint.

### Other Changes

- [[microsoft#4756]] (Azure/azure-sdk-for-cpp#4756) `BearerTokenAuthenticationPolicy` now uses shared mutex lock for read operations.

### Acknowledgments

Thank you to our developer community members who helped to make Azure Core better with their contributions to this release:

- Phoebus Mak _([GitHub](https://github.com/phoebusm))_
JavierMatosD pushed a commit to microsoft/vcpkg that referenced this issue Jan 12, 2024
* [azure-messaging-eventhubs-cpp] Update to 1.0.0-beta.5
## 1.0.0-beta.5 (2024-01-11)

### Breaking Changes

- EventHub `ConsumerClient` and `ProcessorClient` objects now return pointers to `EventData` objects instead of `EventData` objects by value.

* [azure-core-amqp-cpp] Update to 1.0.0-beta.6
## 1.0.0-beta.6 (2024-01-11)

### Features Added

- AMQP Value reference counts are now atomic, this fixes several AMQP related crashes.

### Breaking Changes

- `MessageReceiver` returns a pointer to the received message instead of a copy.

### Bugs Fixed

- Fixed several memory leaks.
- AMQP Link Credits now work as expected.
- Integrated the fix for NVD - CVE-2024-21646.

* [azure-core-cpp] Update to 1.11.0
## 1.11.0 (2024-01-11)

### Features Added

- Added 'OPTIONS' HTTP method to `Azure::Core::Http::HttpMethod` enum.
- Added TLS 1.3 support to WinHTTP transport.
- Environment Log Level Listener now logs the ThreadID for the thread originating the trace.
- [[#4983]](Azure/azure-sdk-for-cpp#4983) Added support for setting `CURLOPT_CAPATH` libcurl option on Linux. (A community contribution, courtesy of _[phoebusm](https://github.com/phoebusm)_)

### Bugs Fixed

- [[#5172]](Azure/azure-sdk-for-cpp#5172) `Azure::Nullable::Emplace()` does not set `HasValue()` to `true`.
- [[#5130]](Azure/azure-sdk-for-cpp#5130) `Url::AppendPath()` and `Url::SetPath()` may end up with a double slash at the beginning of a path.
- [[#5007]](Azure/azure-sdk-for-cpp#5007) Some versions of GCC no longer include stdint.h in cstdint.

### Other Changes

- [[#4756]] (Azure/azure-sdk-for-cpp#4756) `BearerTokenAuthenticationPolicy` now uses shared mutex lock for read operations.

### Acknowledgments

Thank you to our developer community members who helped to make Azure Core better with their contributions to this release:

- Phoebus Mak _([GitHub](https://github.com/phoebusm))_
Osyotr pushed a commit to Osyotr/vcpkg that referenced this issue Jan 23, 2024
* [azure-messaging-eventhubs-cpp] Update to 1.0.0-beta.5
## 1.0.0-beta.5 (2024-01-11)

### Breaking Changes

- EventHub `ConsumerClient` and `ProcessorClient` objects now return pointers to `EventData` objects instead of `EventData` objects by value.

* [azure-core-amqp-cpp] Update to 1.0.0-beta.6
## 1.0.0-beta.6 (2024-01-11)

### Features Added

- AMQP Value reference counts are now atomic, this fixes several AMQP related crashes.

### Breaking Changes

- `MessageReceiver` returns a pointer to the received message instead of a copy.

### Bugs Fixed

- Fixed several memory leaks.
- AMQP Link Credits now work as expected.
- Integrated the fix for NVD - CVE-2024-21646.

* [azure-core-cpp] Update to 1.11.0
## 1.11.0 (2024-01-11)

### Features Added

- Added 'OPTIONS' HTTP method to `Azure::Core::Http::HttpMethod` enum.
- Added TLS 1.3 support to WinHTTP transport.
- Environment Log Level Listener now logs the ThreadID for the thread originating the trace.
- [[microsoft#4983]](Azure/azure-sdk-for-cpp#4983) Added support for setting `CURLOPT_CAPATH` libcurl option on Linux. (A community contribution, courtesy of _[phoebusm](https://github.com/phoebusm)_)

### Bugs Fixed

- [[microsoft#5172]](Azure/azure-sdk-for-cpp#5172) `Azure::Nullable::Emplace()` does not set `HasValue()` to `true`.
- [[microsoft#5130]](Azure/azure-sdk-for-cpp#5130) `Url::AppendPath()` and `Url::SetPath()` may end up with a double slash at the beginning of a path.
- [[microsoft#5007]](Azure/azure-sdk-for-cpp#5007) Some versions of GCC no longer include stdint.h in cstdint.

### Other Changes

- [[microsoft#4756]] (Azure/azure-sdk-for-cpp#4756) `BearerTokenAuthenticationPolicy` now uses shared mutex lock for read operations.

### Acknowledgments

Thank you to our developer community members who helped to make Azure Core better with their contributions to this release:

- Phoebus Mak _([GitHub](https://github.com/phoebusm))_
TomKatom pushed a commit to TomKatom/vcpkg that referenced this issue Feb 23, 2024
* [azure-messaging-eventhubs-cpp] Update to 1.0.0-beta.5
## 1.0.0-beta.5 (2024-01-11)

### Breaking Changes

- EventHub `ConsumerClient` and `ProcessorClient` objects now return pointers to `EventData` objects instead of `EventData` objects by value.

* [azure-core-amqp-cpp] Update to 1.0.0-beta.6
## 1.0.0-beta.6 (2024-01-11)

### Features Added

- AMQP Value reference counts are now atomic, this fixes several AMQP related crashes.

### Breaking Changes

- `MessageReceiver` returns a pointer to the received message instead of a copy.

### Bugs Fixed

- Fixed several memory leaks.
- AMQP Link Credits now work as expected.
- Integrated the fix for NVD - CVE-2024-21646.

* [azure-core-cpp] Update to 1.11.0
## 1.11.0 (2024-01-11)

### Features Added

- Added 'OPTIONS' HTTP method to `Azure::Core::Http::HttpMethod` enum.
- Added TLS 1.3 support to WinHTTP transport.
- Environment Log Level Listener now logs the ThreadID for the thread originating the trace.
- [[microsoft#4983]](Azure/azure-sdk-for-cpp#4983) Added support for setting `CURLOPT_CAPATH` libcurl option on Linux. (A community contribution, courtesy of _[phoebusm](https://github.com/phoebusm)_)

### Bugs Fixed

- [[microsoft#5172]](Azure/azure-sdk-for-cpp#5172) `Azure::Nullable::Emplace()` does not set `HasValue()` to `true`.
- [[microsoft#5130]](Azure/azure-sdk-for-cpp#5130) `Url::AppendPath()` and `Url::SetPath()` may end up with a double slash at the beginning of a path.
- [[microsoft#5007]](Azure/azure-sdk-for-cpp#5007) Some versions of GCC no longer include stdint.h in cstdint.

### Other Changes

- [[microsoft#4756]] (Azure/azure-sdk-for-cpp#4756) `BearerTokenAuthenticationPolicy` now uses shared mutex lock for read operations.

### Acknowledgments

Thank you to our developer community members who helped to make Azure Core better with their contributions to this release:

- Phoebus Mak _([GitHub](https://github.com/phoebusm))_
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant