Skip to content

Commit 986b81e

Browse files
author
Serha
committed
fix: Restore logger in native client wrappers to fix AccessViolationException (v4.0.1-beta)
CRITICAL HOTFIX for v4.0.0-beta regression Root Cause: - v4.0.0-beta removed StderrLogReceiver from Historical, Live, and LiveBlocking client wrappers - Passed nullptr to databento-cpp constructors instead of logger instance - databento-cpp tried to log messages without null-checking the logger pointer - Result: AccessViolationException crashes when logging attempted Symptoms: - Fatal crashes on ALL Historical API queries - Crashes on Live and LiveBlocking subscriptions - Particularly common when databento-cpp tried to log warnings or errors - Multiple user reports immediately after v4.0.0-beta release Fixes Applied: - historical_client_wrapper.cpp: Restored log_receiver member and initialization - live_client_wrapper.cpp: Restored log_receiver and SetLogReceiver() call - live_blocking_wrapper.cpp: Restored log_receiver and SetLogReceiver() call - Rebuilt databento_native.dll with all fixes Changes: - src/Databento.Native/src/historical_client_wrapper.cpp - src/Databento.Native/src/live_client_wrapper.cpp - src/Databento.Native/src/live_blocking_wrapper.cpp - src/Databento.Interop/runtimes/win-x64/native/databento_native.dll - src/Databento.Client/Databento.Client.csproj (version 4.0.0-beta → 4.0.1-beta) - CHANGELOG.md (added v4.0.1-beta entry) Testing: - TestsScratchpad.Internal now runs successfully - Logger output visible: "[Databento WARNING]" messages appear correctly - No crashes on queries that previously failed All users on v4.0.0-beta should upgrade immediately.
1 parent 74f4b54 commit 986b81e

6 files changed

Lines changed: 32 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ All notable changes to databento-dotnet will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [4.0.1-beta] - 2025-11-25
9+
10+
### Fixed
11+
12+
- **CRITICAL**: Fixed `AccessViolationException` crash in Historical, Live, and LiveBlocking clients
13+
- **Root Cause**: v4.0.0-beta removed logger from native client wrappers, passing `nullptr` to databento-cpp
14+
- **Symptoms**: Fatal crashes when databento-cpp tried to log messages (particularly on empty query results or warnings)
15+
- **Impact**: Affected ALL Historical API queries, Live subscriptions, and LiveBlocking operations in v4.0.0-beta
16+
- **Fix**: Restored `StderrLogReceiver` logger in all three client wrapper implementations
17+
- **User Reports**: Multiple users reported crashes immediately after upgrading to v4.0.0-beta
18+
- **Recommendation**: All users on v4.0.0-beta should upgrade to v4.0.1-beta immediately
19+
20+
---
21+
822
## [4.0.0-beta] - 2025-11-25
923

1024
### Changed (BREAKING)

src/Databento.Client/Databento.Client.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<!-- Package Information -->
1111
<PackageId>Databento.Client</PackageId>
12-
<Version>4.0.0-beta</Version>
12+
<Version>4.0.1-beta</Version>
1313
<Authors>Alparse</Authors>
1414
<Company>Databento</Company>
1515
<Product>databento-dotnet</Product>
@@ -20,7 +20,7 @@
2020
<RepositoryType>git</RepositoryType>
2121
<PackageProjectUrl>https://github.com/Alparse/databento-dotnet</PackageProjectUrl>
2222
<PackageReadmeFile>README.md</PackageReadmeFile>
23-
<PackageReleaseNotes>v4.0.0-beta: BREAKING CHANGE - RawInstrumentId changed from uint to ulong for 64-bit venue support (Eurex, etc.). Change uint to ulong in your code. New examples: IntradayReplay2, Get_Most_Recent_Market_Open, List_Available_Schemas. See MIGRATION_GUIDE_v4.md.</PackageReleaseNotes>
23+
<PackageReleaseNotes>v4.0.1-beta: CRITICAL HOTFIX - Fixed AccessViolationException crash in Historical, Live, and LiveBlocking clients by restoring logger. Regression from v4.0.0-beta. All users on v4.0.0-beta should upgrade immediately.</PackageReleaseNotes>
2424
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
2525

2626
<!-- XML Documentation -->
Binary file not shown.

src/Databento.Native/src/historical_client_wrapper.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ using databento_native::ValidateTimeRange;
3030
struct HistoricalClientWrapper {
3131
std::unique_ptr<db::Historical> client;
3232
std::string api_key;
33+
std::unique_ptr<databento_native::StderrLogReceiver> log_receiver;
3334

3435
explicit HistoricalClientWrapper(const std::string& key)
35-
: api_key(key) {
36+
: api_key(key),
37+
log_receiver(std::make_unique<databento_native::StderrLogReceiver>()) {
3638
client = std::make_unique<db::Historical>(
37-
nullptr,
39+
log_receiver.get(),
3840
key,
3941
db::HistoricalGateway::Bo1
4042
);

src/Databento.Native/src/live_blocking_wrapper.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ using databento_native::ValidateNonEmptyString;
2323
// ============================================================================
2424
struct LiveBlockingWrapper {
2525
std::unique_ptr<db::LiveBlocking> client;
26+
std::unique_ptr<databento_native::StderrLogReceiver> log_receiver;
2627
std::string dataset;
2728
std::string api_key;
2829
bool send_ts_out = false;
2930
db::VersionUpgradePolicy upgrade_policy = db::VersionUpgradePolicy::UpgradeToV3;
3031
int heartbeat_interval_secs = 30;
3132

3233
explicit LiveBlockingWrapper(const std::string& key)
33-
: api_key(key) {}
34+
: api_key(key),
35+
log_receiver(std::make_unique<databento_native::StderrLogReceiver>()) {}
3436

3537
explicit LiveBlockingWrapper(
3638
const std::string& key,
@@ -39,6 +41,7 @@ struct LiveBlockingWrapper {
3941
db::VersionUpgradePolicy policy,
4042
int heartbeat_secs)
4143
: api_key(key),
44+
log_receiver(std::make_unique<databento_native::StderrLogReceiver>()),
4245
dataset(ds),
4346
send_ts_out(ts_out),
4447
upgrade_policy(policy),
@@ -51,7 +54,8 @@ struct LiveBlockingWrapper {
5154
.SetKey(api_key)
5255
.SetDataset(dataset)
5356
.SetSendTsOut(send_ts_out)
54-
.SetUpgradePolicy(upgrade_policy);
57+
.SetUpgradePolicy(upgrade_policy)
58+
.SetLogReceiver(log_receiver.get());
5559

5660
if (heartbeat_interval_secs > 0) {
5761
builder.SetHeartbeatInterval(std::chrono::seconds(heartbeat_interval_secs));

src/Databento.Native/src/live_client_wrapper.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ using databento_native::ValidateSymbolArray;
2727
// ============================================================================
2828
struct LiveClientWrapper {
2929
std::unique_ptr<db::LiveThreaded> client;
30+
std::unique_ptr<databento_native::StderrLogReceiver> log_receiver;
3031
RecordCallback record_callback = nullptr;
3132
MetadataCallback metadata_callback = nullptr;
3233
ErrorCallback error_callback = nullptr;
@@ -41,7 +42,8 @@ struct LiveClientWrapper {
4142
int heartbeat_interval_secs = 30;
4243

4344
explicit LiveClientWrapper(const std::string& key)
44-
: api_key(key) {}
45+
: api_key(key),
46+
log_receiver(std::make_unique<databento_native::StderrLogReceiver>()) {}
4547

4648
explicit LiveClientWrapper(
4749
const std::string& key,
@@ -50,6 +52,7 @@ struct LiveClientWrapper {
5052
db::VersionUpgradePolicy policy,
5153
int heartbeat_secs)
5254
: api_key(key),
55+
log_receiver(std::make_unique<databento_native::StderrLogReceiver>()),
5356
dataset(ds),
5457
send_ts_out(ts_out),
5558
upgrade_policy(policy),
@@ -67,7 +70,8 @@ struct LiveClientWrapper {
6770
.SetKey(api_key)
6871
.SetDataset(dataset)
6972
.SetSendTsOut(send_ts_out)
70-
.SetUpgradePolicy(upgrade_policy);
73+
.SetUpgradePolicy(upgrade_policy)
74+
.SetLogReceiver(log_receiver.get());
7175

7276
if (heartbeat_interval_secs > 0) {
7377
builder.SetHeartbeatInterval(

0 commit comments

Comments
 (0)