[GH-ISSUE #1385] malloc failure on trace! macro in v0.19 #663

Closed
opened 2026-03-15 23:44:14 +03:00 by kerem · 1 comment
Owner

Originally created by @jmagnuson on GitHub (Feb 23, 2021).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1385

Describe the bug

When running a stripped, release builds of our application which uses trust-dns-resolver 0.19.6, creating the Backtrace object via trace! results in a memory allocation failure and subsequent SIGABRT.

Adding some printlns starting at AsyncResolver::lookup_ip:

Cloning client_cache
Creating default DnsRequestOptions
Calling LookupIpFuture::lookup
Creating empty query
Creating backtrack trace
memory allocation of 268435456 bytes failed

basically ending at:

github.com/bluejekyll/trust-dns@ac8bc7fa03/crates/proto/src/error.rs (L50)

To Reproduce

Was only able to reproduce using release builds, on ARM target, for my application. This may mean there is more to the issue with regard to backtrace's interactions with release builds, but I haven't yet isolated it.

Expected behavior

Either no abort, or the option to disable backtrace generation on memory-constrained systems.

System:

  • OS: linux
  • Architecture: armv7
  • Version 4.9
  • rustc version: 1.50

Version:
Crate: resolver
Version: 0.19.6

Additional context
Optional usage of backtrace was introduced in https://github.com/bluejekyll/trust-dns/pull/1246. This would need to be backported from 0.20 into 0.19, but would be a workable solution for my use-case.

Originally created by @jmagnuson on GitHub (Feb 23, 2021). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1385 **Describe the bug** When running a stripped, release builds of our application which uses `trust-dns-resolver` 0.19.6, creating the `Backtrace` object via `trace!` results in a memory allocation failure and subsequent `SIGABRT`. Adding some `println`s starting at `AsyncResolver::lookup_ip`: ``` Cloning client_cache Creating default DnsRequestOptions Calling LookupIpFuture::lookup Creating empty query Creating backtrack trace memory allocation of 268435456 bytes failed ``` basically ending at: https://github.com/bluejekyll/trust-dns/blob/ac8bc7fa03f0ddd36762079e9e25cbb3023faf2d/crates/proto/src/error.rs#L50 **To Reproduce** Was only able to reproduce using release builds, on ARM target, for my application. This may mean there is more to the issue with regard to `backtrace`'s interactions with release builds, but I haven't yet isolated it. **Expected behavior** Either no abort, or the option to disable backtrace generation on memory-constrained systems. **System:** - OS: linux - Architecture: armv7 - Version 4.9 - rustc version: 1.50 **Version:** Crate: resolver Version: 0.19.6 **Additional context** Optional usage of `backtrace` was introduced in https://github.com/bluejekyll/trust-dns/pull/1246. This would need to be backported from 0.20 into 0.19, but would be a workable solution for my use-case.
kerem closed this issue 2026-03-15 23:44:20 +03:00
Author
Owner

@jmagnuson commented on GitHub (Mar 9, 2021):

A solution in #1387 has been merged, closing.

<!-- gh-comment-id:794555999 --> @jmagnuson commented on GitHub (Mar 9, 2021): A solution in #1387 has been merged, closing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#663
No description provided.