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

Display additional ("aux") information and stacks #81

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

jfrimmel
Copy link
Owner

This improves the output of cases like #74 by outputting the additional information present in the valgrind output. The results are looking like this:

       Error Invalid read of size 4
        Info main stack trace (user code at the bottom)
             at core::fmt::num::imp::<impl core::fmt::Display for i32>::fmt (num.rs:317)
             at core::fmt::num::<impl core::fmt::Debug for i32>::fmt (num.rs:195)
             at <&T as core::fmt::Debug>::fmt (mod.rs:2368)
             at {closure#0} (builders.rs:505)
             at {closure#0}<core::fmt::builders::{impl#6}::entry::{closure_env#0}> (builders.rs:430)
             at and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#5}::entry_with::{closure_env#0}<core::fmt::builders::{impl#6}::entry::{closure_env#0}>> (result.rs:1346)
             at entry_with<core::fmt::builders::{impl#6}::entry::{closure_env#0}> (builders.rs:416)
             at core::fmt::builders::DebugSet::entry (builders.rs:505)
             at core::fmt::builders::DebugList::entries (builders.rs:695)
             at <[T] as core::fmt::Debug>::fmt (mod.rs:2618)
             at <&mut T as core::fmt::Debug>::fmt (mod.rs:2372)
             at fmt (rt.rs:173)
             at core::fmt::write (mod.rs:1182)
             at write_fmt<std::io::stdio::StdoutLock> (mod.rs:1827)
             at <&std::io::stdio::Stdout as std::io::Write>::write_fmt (stdio.rs:787)
             at write_fmt (stdio.rs:761)
             at print_to<std::io::stdio::Stdout> (stdio.rs:1117)
             at std::io::stdio::_print (stdio.rs:1227)
             at issue_74::ex4 (issue-74.rs:34)
             at issue_74::main (issue-74.rs:66)
        Info Address 0x4aa3b28 is 0 bytes after a block of size 24 alloc'd
             at malloc (vg_replace_malloc.c:446)
             at alloc::alloc::alloc (alloc.rs:100)
             at alloc::alloc::Global::alloc_impl (alloc.rs:183)
             at <alloc::alloc::Global as core::alloc::Allocator>::allocate (alloc.rs:243)
             at alloc::raw_vec::RawVec<T,A>::try_allocate_in (raw_vec.rs:230)
             at with_capacity_in<i32, alloc::alloc::Global> (raw_vec.rs:158)
             at with_capacity_in<i32, alloc::alloc::Global> (mod.rs:699)
             at with_capacity<i32> (mod.rs:481)
             at <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter (spec_from_iter_nested.rs:54)
             at <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter (spec_from_iter.rs:33)
             at <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter (mod.rs:2977)
             at core::iter::traits::iterator::Iterator::collect (iterator.rs:2005)
             at issue_74::ex4 (issue-74.rs:27)
             at issue_74::main (issue-74.rs:66)
             at core::ops::function::FnOnce::call_once (function.rs:250)
     Summary Leaked 0 B total (1 other errors)

@jfrimmel jfrimmel merged commit fd17d94 into master Sep 17, 2024
9 checks passed
@jfrimmel jfrimmel deleted the better-error-output branch September 17, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant