profile
viewpoint
Dmitry Zakablukov dmitry-zakablukov Tver, Russia

dmitry-zakablukov/backtrace-rs 0

Backtraces in Rust

dmitry-zakablukov/conan 0

Conan - The open-source C/C++ package manager

dmitry-zakablukov/conan-package-tools 0

Conan Package Tools. Helps with massive package creation and CI integration (Travis CI, Appveyor...)

dmitry-zakablukov/flow-typed 0

A central repository for Flow library definitions

dmitry-zakablukov/libcaes 0

Library to support cross-platform AES encryption

dmitry-zakablukov/libcpath 0

Library for cross-platform C path functions

dmitry-zakablukov/libhmac 0

Library to support various Hash-based Message Authentication Codes (HMAC)

dmitry-zakablukov/neon 0

Rust bindings for writing safe and fast native Node.js modules.

dmitry-zakablukov/snafu 0

Easily assign underlying errors into domain-specific errors while adding context

issue closedshepmaster/snafu

Useless backtrace with missing pdb file on Windows

Good day!

Let's consider the following code:

use snafu::{Backtrace, Snafu, ErrorCompat};

#[derive(Debug, Snafu)]
pub enum Error {
    #[snafu(display("Test error"))]
    TestError {
        backtrace: Backtrace,
    }
}

type Result<T> = std::result::Result<T, Error>;

fn func() -> Result<()> {
    Err(TestError.build())
}

fn main() {
    if let Err(error) = func() {
        if let Some(bt) = ErrorCompat::backtrace(&error) {
            println!("{:?}", bt);
        }
    }
}

This code prints a valid backtrace when a PDB file is not renamed/deleted from the file system:

Backtrace(   0: backtrace::backtrace::trace
   1: backtrace::capture::Backtrace::new
   2: <alloc::vec::Vec<T> as core::ops::drop::Drop>::drop
   3: <alloc::vec::Vec<T> as core::ops::drop::Drop>::drop
   4: std::rt::lang_start_internal::{{closure}}
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\/src\libstd\rt.rs:52
   5: std::panicking::try::do_call
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\/src\libstd\panicking.rs:331
   6: std::panicking::try
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\/src\libstd\panicking.rs:274
   7: std::panic::catch_unwind
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\/src\libstd\panic.rs:394
   8: std::rt::lang_start_internal
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\/src\libstd\rt.rs:51
   9: main
  10: invoke_main
             at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  11: __scrt_common_main_seh
             at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  12: BaseThreadInitThunk
  13: RtlUserThreadStart
)

But if the PDB file was deleted, or renamed, or .cargo/config is as follows:

[target.'cfg(windows)']
rustflags = ["-C", "link-args=/PDBALTPATH:missing.pdb"]

then the example will output the following:

Backtrace(   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: BaseThreadInitThunk
   8: RtlUserThreadStart
)

Missing PDB file is a common use case in a production environment. So my question are:

  1. Can the ip address be added to the backtrace output? See ip() documentation here: https://docs.rs/backtrace/0.3.50/backtrace/struct.BacktraceFrame.html#method.ip
  2. (this is not SNAFU specific question) How to get a module base address? Ip address is a relative to the base address, as far as I know. So without a base address there is no much use from ip addresses.

closed time in 6 days

dmitry-zakablukov

PR closed shepmaster/snafu

Expose raw backtrace

Good day!

I would like to expose raw backtrace from shim::Backtrace. This is required for custom backtrace formatting. So I added a raw() method for shim::Backtrace struct.

+6 -1

4 comments

2 changed files

dmitry-zakablukov

pr closed time in 6 days

pull request commentshepmaster/snafu

Expose raw backtrace

@shepmaster , thank you for clarification! Indeed, backtraces-impl-backtrace-crate feature flag and specific backtrace crate version in my project solved my problem.

dmitry-zakablukov

comment created time in 6 days

pull request commentshepmaster/snafu

Expose raw backtrace

This is already provided. You need to use the backtraces-impl-backtrace-crate feature flag.

Oh, I see. Then can you please update a backtrace crate to version 0.3.51 or higher? v0.3.51 contains some specific changes I need in my code.

dmitry-zakablukov

comment created time in 6 days

issue commentshepmaster/snafu

Useless backtrace with missing pdb file on Windows

@shepmaster , I have opened a PR #256 to implement a custom backtrace formatting I need.

dmitry-zakablukov

comment created time in 6 days

PR opened shepmaster/snafu

Expose raw backtrace

Good day!

I would like to expose raw backtrace from shim::Backtrace. This is required for custom backtrace formatting. So I added a raw() method for shim::Backtrace struct.

+6 -1

0 comment

2 changed files

pr created time in 6 days

push eventdmitry-zakablukov/snafu

Dmitry Zakablukov

commit sha b01140a001784695827124a7f3ec4fdafe95da1b

Backtrace crate updated to v0.3.53

view details

push time in 6 days

push eventpassware/libusb-sys

Dmitry Zakablukov

commit sha cf788e58179e3a0e5f0374a79a49b67a8a20f0dc

[PKM-210] Libusb v1.0.24-beta

view details

Dmitry Zakablukov

commit sha 64813edc1fd914b116dfc67f2b370090a5e13d9e

[PKM-210] Specifying remote and channel for custom libusb package

view details

Dmitry Zakablukov

commit sha 3e03941380500da2e4b99d207b404a84c10574c8

Merge pull request #1 from passware/feature/cases/PKM-210 Libusb v1.0.24-beta

view details

push time in 23 days

PR opened passware/libusb-sys

Custom версия libusb
+1 -1

0 comment

1 changed file

pr created time in 23 days

push eventpassware/libusb-sys

Dmitry Zakablukov

commit sha 64813edc1fd914b116dfc67f2b370090a5e13d9e

[PKM-210] Specifying remote and channel for custom libusb package

view details

push time in 23 days

push eventpassware/libusb-sys

Dmitry Zakablukov

commit sha cf788e58179e3a0e5f0374a79a49b67a8a20f0dc

[PKM-210] Libusb v1.0.24-beta

view details

push time in 23 days

create barnchpassware/libusb-sys

branch : feature/cases/PKM-210

created branch time in 23 days

pull request commentrust-lang/backtrace-rs

Feature: module base address added to the Frame

@alexcrichton , thank you!

dmitry-zakablukov

comment created time in 25 days

pull request commentrust-lang/backtrace-rs

Feature: module base address added to the Frame

@alexcrichton , may I ask you when the next version of backtrace crate will be released? The latest one (0.3.50) doesn't contain my changes.

dmitry-zakablukov

comment created time in a month

push eventdmitry-zakablukov/backtrace-rs

eggyal

commit sha 4b8f2be2a6079860e4f39c7c3133c17be705b173

Include source column numbers, where available (#367) * Provide access to source column numbers of symbol locations, in addition to filename and line numbers (where available - currently only gimli). * Print column numbers in backtraces, if available. * cargo fmt * Fixed breaking-change to public API, by delegating to new print_raw_with_column (as suggested by @alexcrichton in review https://github.com/rust-lang/backtrace-rs/pull/367#discussion_r463038434) * Added tests for column numbers * Reflect actual conditional compilation logic in smoke test guards

view details

Dmitry Zakablukov

commit sha 70ad093aafd615af52e03aa12ba6caedefcb1436

Feature: module base address added to the Frame (#368) * Module base address added to the Frame * Test added for module base address of the Frame * Process handle cached

view details

Tamir Duberstein

commit sha 37ec940f69c2043c6e2a3953d071b456ea279287

Delegate, don't duplicate (#369) Duplication introduced in 4b8f2be2.

view details

Glenn Smith

commit sha 9a61574950a1ad9f54e34a97f22e881a8335a842

Fix compilation error on i686-apple-darwin targets (#371) symbolize::gimli::macho::Object expects syms to be a Vec<(..., u64)> but on i686 it gets initialized with a Vec<(..., u32)>. This just adds a cast to u64 to the syms generator so it typechecks.

view details

push time in a month

push eventdmitry-zakablukov/snafu

Jake Goulding

commit sha 0202c8237a611dc91065c295be82bdd4824ec761

Correct a non-fully-qualified usage of `Option`

view details

Jake Goulding

commit sha 2a261c2d402fb70a6d3a65d73c4a867e90dcf6bc

Increase memory for the doc-test builder I don't know why it takes more now, but whatever.

view details

Jake Goulding

commit sha 22e30ab80b85048a1b1f86636ad5bc3cd58aabfc

Check formatting in all files, even outside the workspace

view details

Jake Goulding

commit sha aa7adab2fce8781fcb9ee31bc386c53431083f49

Merge pull request #252 from shepmaster/maint

view details

Henning Kowalk

commit sha 30d5e821ae1cbc86cf23911f260f4d08a69eb50e

Allow optional trailing commas in `ensure!` Fixes #243

view details

Jake Goulding

commit sha 77299abfa5cbd396f401aaaec75de7e0f17e3e8c

Test that ensure supports trailing commas

view details

Jake Goulding

commit sha d2226382b833a45129ce3aae1cb87bf4d5c92bf9

Merge pull request #251 from Henning-K/patch-1

view details

Jake Goulding

commit sha 53ea99aee3dde01c33478e139bc1c5ae23e946d8

Refactor tuple struct code to a new function

view details

Jake Goulding

commit sha cb70325c9e609178177a40a86a86d6eba7bcc306

MVP for macro expansion of a struct error

view details

Jake Goulding

commit sha 27655fac4acffa5622bab82db5b1803ca3b3a439

Support struct errors that don't have a source

view details

Jake Goulding

commit sha 7f7a607e1cb22aa35ef3b9704320b1ddb4334446

Refactor code to parse a container of fields This will allow us to share most of the code for enum variants and structs.

view details

Jake Goulding

commit sha 278ebd368c693c7d035493f682d883fd75db0c44

Replace struct parsing code with shared field container function

view details

Jake Goulding

commit sha c5f3649c99f6bbabf99495a4292f565d2a871121

Support empty structs and default display implementations This will allow us to write more concise tests

view details

Jake Goulding

commit sha 5eda1047453190af32918707445c92309f809fd7

Support struct errors with backtraces

view details

Jake Goulding

commit sha 89cdfb75439ed1f84928883ece4e18a1ecb4d420

Support visibility annotations for struct errors

view details

Jake Goulding

commit sha 60304a00107a40579f4520459ad072c41da17d87

Support generic lifetime parameters on struct errors

view details

Jake Goulding

commit sha b1e1b0560608689123e2d55d30ea9763fd572882

Support generic type parameters on struct errors

view details

Jake Goulding

commit sha 71bf27c0306f6d73e32bc0dca61525e7108ca775

Support generic bounds on struct errors

view details

Jake Goulding

commit sha d43d0f6bcc5a03cffa920487145a377a36fa03ac

Support generic type defaults on struct errors

view details

Jake Goulding

commit sha f6dde865e910c0ef17ea56482ebe574327577ca0

Support source attributes for struct errors

view details

push time in a month

push eventdmitry-zakablukov/snafu

Jake Goulding

commit sha 0202c8237a611dc91065c295be82bdd4824ec761

Correct a non-fully-qualified usage of `Option`

view details

Jake Goulding

commit sha 2a261c2d402fb70a6d3a65d73c4a867e90dcf6bc

Increase memory for the doc-test builder I don't know why it takes more now, but whatever.

view details

Jake Goulding

commit sha 22e30ab80b85048a1b1f86636ad5bc3cd58aabfc

Check formatting in all files, even outside the workspace

view details

Jake Goulding

commit sha aa7adab2fce8781fcb9ee31bc386c53431083f49

Merge pull request #252 from shepmaster/maint

view details

Henning Kowalk

commit sha 30d5e821ae1cbc86cf23911f260f4d08a69eb50e

Allow optional trailing commas in `ensure!` Fixes #243

view details

Jake Goulding

commit sha 77299abfa5cbd396f401aaaec75de7e0f17e3e8c

Test that ensure supports trailing commas

view details

Jake Goulding

commit sha d2226382b833a45129ce3aae1cb87bf4d5c92bf9

Merge pull request #251 from Henning-K/patch-1

view details

Jake Goulding

commit sha 53ea99aee3dde01c33478e139bc1c5ae23e946d8

Refactor tuple struct code to a new function

view details

Jake Goulding

commit sha cb70325c9e609178177a40a86a86d6eba7bcc306

MVP for macro expansion of a struct error

view details

Jake Goulding

commit sha 27655fac4acffa5622bab82db5b1803ca3b3a439

Support struct errors that don't have a source

view details

Jake Goulding

commit sha 7f7a607e1cb22aa35ef3b9704320b1ddb4334446

Refactor code to parse a container of fields This will allow us to share most of the code for enum variants and structs.

view details

Jake Goulding

commit sha 278ebd368c693c7d035493f682d883fd75db0c44

Replace struct parsing code with shared field container function

view details

Jake Goulding

commit sha c5f3649c99f6bbabf99495a4292f565d2a871121

Support empty structs and default display implementations This will allow us to write more concise tests

view details

Jake Goulding

commit sha 5eda1047453190af32918707445c92309f809fd7

Support struct errors with backtraces

view details

Jake Goulding

commit sha 89cdfb75439ed1f84928883ece4e18a1ecb4d420

Support visibility annotations for struct errors

view details

Jake Goulding

commit sha 60304a00107a40579f4520459ad072c41da17d87

Support generic lifetime parameters on struct errors

view details

Jake Goulding

commit sha b1e1b0560608689123e2d55d30ea9763fd572882

Support generic type parameters on struct errors

view details

Jake Goulding

commit sha 71bf27c0306f6d73e32bc0dca61525e7108ca775

Support generic bounds on struct errors

view details

Jake Goulding

commit sha d43d0f6bcc5a03cffa920487145a377a36fa03ac

Support generic type defaults on struct errors

view details

Jake Goulding

commit sha f6dde865e910c0ef17ea56482ebe574327577ca0

Support source attributes for struct errors

view details

push time in a month

pull request commentconan-io/conan

Visual Studio props file generation fixed

Sounds very promising! Looking forward to customizable generators.

dmitry-zakablukov

comment created time in a month

pull request commentconan-io/conan

Visual Studio props file generation fixed

@memsharded , it it the first: our project has non-trivial configuration names.

For example, libssh2 has the following configuration names: "libssh2 - Win32 OpenSSL DLL Release", "libssh2 - Win32 OpenSSL DLL Debug", etc.

So, msbuild generator does know nothing about a project configuration names, but it generates a props file with lines

<ImportGroup Label="Configurations">
    <Import Condition="'$(Configuration)' == 'Release' And '$(Platform)' == 'x64' And '$(PlatformToolset)' == 'v141'" Project="conan_libssh2_release_x64_v141.props"/>
</ImportGroup>

To make this work for libssh2 project, msbuild generator should have generated a props file with lines

<ImportGroup Label="Configurations">
    <Import Condition="'$(Configuration)' == 'libssh2 - Win32 OpenSSL DLL Release' And '$(Platform)' == 'x64' And '$(PlatformToolset)' == 'v141'" Project="conan_libssh2_SOME_CONFIG_NAME_x64_v141.props"/>
</ImportGroup>

On the other hand, visual_studio generator does not include any conditions in a generated props file.

dmitry-zakablukov

comment created time in a month

pull request commentconan-io/conan

Visual Studio props file generation fixed

@memsharded , can you please tell me, how to specify Configuration in command line? I see

conan install . -s build_type=Release --install-folder=deps

in your reply. But this command will generate props file with Configuration = Release. But what should I do to support configuration "Release-static"?

dmitry-zakablukov

comment created time in a month

pull request commentconan-io/conan

Visual Studio props file generation fixed

Hello, @memsharded !

Yes, sorry for delay, I have tested a new msbuild generator.

In short, the generator is suitable for us, but only if we will be able to control a condition to include a props file. In details: msbuild generator creates conan_deps.props file, which includes conan_zlib.props, which contains the following lines:

	<ImportGroup Label="Configurations">
		<Import Condition="'$(Configuration)' == 'Release' And '$(Platform)' == 'x64' And '$(PlatformToolset)' == 'v141'" Project="conan_zlib_release_x64_v141.props"/>
	</ImportGroup>

But our problem is that we have a separate project "ConanInstall", which runs a script to install all dependencies for other projects. And this project have it's own Configuration. For example, "ConanInstall" project has configuration "Release", but "Zlib" project has configuration "Release-static". This results in build fail, because condition to include "conan_zlib_release_x64_v141.props" is not satisfied.

I think we can drop "ConanInstall" project and make other projects to install their dependencies by themselves. This should solve our problem.

But my question is why was the import condition added in the first place? If the props file is to be generated every time a project been build, then in my opinion there should be no condition to include conan_zlib_release_x64_v141.props.

dmitry-zakablukov

comment created time in a month

issue openedrust-lang/rust

Source file names are included into a release binary even if abort upon panic is enabled

Good day!

I have found, that if a library contains code that may panic (slices, unwraps, etc.), then a filename of such source file will be included in a binary. Release build doesn't change this behavior, neither debug symbols stripping do.

I have tried to turn on "abort" for panic in release profile. Even though this resulted in a smaller binary size, it doesn't wipe out source file names from the binary.

Here is a small reproducible code.

// "engine" library, file lib.rs

pub fn print_message() {
    let mut input = String::new();
    std::io::stdin().read_line(&mut input).unwrap();
}
// "main" program, file main.rs

fn main() {
    engine::print_message();
}
// main Cargo.toml

[package]
name = "symbols_test"
version = "0.1.0"
authors = ["Name Soname <test@mail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[profile.release]
panic = "abort"

[dependencies]
engine = { path = "../engine" }

If I build this example with a command cargo build --release on Windows, then a symbols_test.exe will contain a string engine\src\lib.rs.

==============================

So what should I do, if I want to distribute my program to the clients and do not want them to find out file names of my source files (which are a business secret)? How to strip source file names from the binary?

created time in 3 months

issue closedrust-lang/backtrace-rs

Instruction pointer address: absolute or relative?

Good day!

What kind of address Frame::ip() returns: absolute or relative to the image base address? If the address is absolute, then the image base address is required to decode backtrace using a PDB file (on Windows). But I see no public methods to get the image base address.

closed time in 3 months

dmitry-zakablukov

issue commentrust-lang/backtrace-rs

Instruction pointer address: absolute or relative?

PR was merged, so I close the issue.

dmitry-zakablukov

comment created time in 3 months

create barnchdmitry-zakablukov/snafu

branch : feature/expose_raw_backtrace

created branch time in 3 months

pull request commentrust-lang/backtrace-rs

Feature: module base address added to the Frame

@alexcrichton , it may be done with dladdr() function: https://man7.org/linux/man-pages/man3/dladdr.3.html Dl_info structure has dli_fbase field.

It should be tested for executable files though, but I think they have fixed load address.

dmitry-zakablukov

comment created time in 3 months

push eventdmitry-zakablukov/backtrace-rs

Dmitry Zakablukov

commit sha d5c9861e3ae3dd906eb8f5d919ff3dd4dc46aa5e

Process handle cached

view details

push time in 3 months

issue commentrust-lang/backtrace-rs

Instruction pointer address: absolute or relative?

PR is opened: #368 module_name() method is not implemented, because the crate doesn't use String and, in my opinion, base address of the module should be sufficient to get module name in a caller.

dmitry-zakablukov

comment created time in 3 months

PR opened rust-lang/backtrace-rs

Feature: module base address added to the Frame

The base address of the module is required on the Windows to decode a backtrace when a PDB file is moved or missing:

<address_in_pdb> = <instruction_pointer_address> - <module_base_address>

The struct Frame is extended with the following method:

pub fn module_base_address(&self) -> Option<*mut c_void>;

The method returns an Option, because only dbghelp::Frame::module_base_address() is implemented in this PR. And I'm not sure if the proposed method can be implemented for libunwind::Frame.

+106 -26

0 comment

7 changed files

pr created time in 3 months

push eventdmitry-zakablukov/backtrace-rs

Dmitry Zakablukov

commit sha 24484b13abf4f43fdd8a093b103b0f4aa04b21d9

Test added for module base address of the Frame

view details

push time in 3 months

push eventdmitry-zakablukov/backtrace-rs

Dmitry Zakablukov

commit sha cf45a2878c668d6c24a7d45c693b10ed70e68a13

Module base address added to the Frame

view details

push time in 3 months

create barnchdmitry-zakablukov/backtrace-rs

branch : feature/image_base_address

created branch time in 3 months

issue commentrust-lang/backtrace-rs

Instruction pointer address: absolute or relative?

Ok, then I'll try to make a pr to achieve this.

dmitry-zakablukov

comment created time in 3 months

pull request commentconan-io/conan

Visual Studio props file generation fixed

Hi @memsharded !

Thank you, I will try the new generator soon and write a comment about our experience with it.

dmitry-zakablukov

comment created time in 3 months

issue commentrust-lang/backtrace-rs

Instruction pointer address: absolute or relative?

@alexcrichton , then how about to extend the Frame trait as follows?

impl Frame {
    ...
    
    /// Returns the base address of the module to which a frame belongs.
    pub fn module_base_address(&self) -> Option<*mut c_void>;
    
    /// Returns the name of the module to which a frame belongs.
    pub fn module_name(&self) -> Option<String>;
}

These functions return an option, because some Frame implementations may not be able to provide such an information. But I know for sure that dbghelp can provide module base address at least.

The proposed api will allow to decode a backtrace on Windows when the PDB file with a debug info is missing.

dmitry-zakablukov

comment created time in 3 months

issue commentrust-lang/backtrace-rs

Instruction pointer address: absolute or relative?

@alexcrichton , is there way to get the image base address from the backtrace crate?

dmitry-zakablukov

comment created time in 3 months

issue openedrust-lang/backtrace-rs

Instruction pointer address: absolute or relative?

Good day!

What kind of address Frame::ip() returns: absolute or relative to the image base address? If the address is absolute, then the image base address is required to decode backtrace using a PDB file (on Windows). But I see no public methods to get the image base address.

created time in 3 months

fork dmitry-zakablukov/snafu

Easily assign underlying errors into domain-specific errors while adding context

https://docs.rs/snafu/

fork in 3 months

issue commentshepmaster/snafu

Useless backtrace with missing pdb file on Windows

You haven't included the information about which backtrace provider feature flag you are using. You link to the backtrace crate; does that mean that's what you are using?

Sorry, I didn't know that any backtrace provider can be used. I simply used snafu crate with the feature backtraces. I suppose the snafu crate uses this crate: https://docs.rs/backtrace/0.3.50/backtrace/index.html

Can it be? Maybe. Depending on the backtrace provider you are using, it might not be under the control of this crate however. What benefit do you see it providing in this case?

Frame addresses and base address are sufficient to decode backtrace using a PDB file. If ip addresses are equal to the frame addresses, then a half of my problem can be solved.

dmitry-zakablukov

comment created time in 3 months

issue openedshepmaster/snafu

Wrong backtrace with missing pdb file on Windows

Good day!

Let's consider the following code:

use snafu::{Backtrace, Snafu, ErrorCompat};

#[derive(Debug, Snafu)]
pub enum Error {
    #[snafu(display("Test error"))]
    TestError {
        backtrace: Backtrace,
    }
}

type Result<T> = std::result::Result<T, Error>;

fn func() -> Result<()> {
    Err(TestError.build())
}

fn main() {
    if let Err(error) = func() {
        if let Some(bt) = ErrorCompat::backtrace(&error) {
            println!("{:?}", bt);
        }
    }
}

This code prints a valid backtrace when a PDB file is not renamed/deleted from the file system:

Backtrace(   0: backtrace::backtrace::trace
   1: backtrace::capture::Backtrace::new
   2: <alloc::vec::Vec<T> as core::ops::drop::Drop>::drop
   3: <alloc::vec::Vec<T> as core::ops::drop::Drop>::drop
   4: std::rt::lang_start_internal::{{closure}}
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\/src\libstd\rt.rs:52
   5: std::panicking::try::do_call
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\/src\libstd\panicking.rs:331
   6: std::panicking::try
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\/src\libstd\panicking.rs:274
   7: std::panic::catch_unwind
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\/src\libstd\panic.rs:394
   8: std::rt::lang_start_internal
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7\/src\libstd\rt.rs:51
   9: main
  10: invoke_main
             at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  11: __scrt_common_main_seh
             at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  12: BaseThreadInitThunk
  13: RtlUserThreadStart
)

But if the PDB file was deleted, or renamed, or .cargo/config is as follows:

[target.'cfg(windows)']
rustflags = ["-C", "link-args=/PDBALTPATH:missing.pdb"]

then the example will output the following:

Backtrace(   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: BaseThreadInitThunk
   8: RtlUserThreadStart
)

Missing PDB file is a common use case in a production environment. So my question are:

  1. Can the ip address be added to the backtrace output? See ip() documentation here: https://docs.rs/backtrace/0.3.50/backtrace/struct.BacktraceFrame.html#method.ip
  2. (this is not SNAFU specific question) How to get a module base address? Ip address is a relative to the base address, as far as I know. So without a base address there is no much use from ip addresses.

created time in 3 months

more