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

Add tests about anyhow and backtrace #26

Merged
merged 4 commits into from
Aug 31, 2022
Merged

Conversation

fzyzcjy
Copy link
Contributor

@fzyzcjy fzyzcjy commented Aug 31, 2022

Partially related to fzyzcjy/flutter_rust_bridge#582

@fzyzcjy fzyzcjy marked this pull request as draft August 31, 2022 09:07
@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Aug 31, 2022

Valgrind errors reproduced using on-stock valgrind:

https://github.com/sunshine-protocol/allo-isolate/runs/8109974892?check_suite_focus=true

Run valgrind --error-exitcode=1 --leak-check=full ./target/debug/examples/containers
==2809== Memcheck, a memory error detector
==2809== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2809== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==2809== Command: ./target/debug/examples/containers
==2809== 
==2809== Syscall param statx(file_name) points to unaddressable byte(s)
==2809==    at 0x496788E: statx (statx.c:29)
==2809==    by 0x273020: statx (weak.rs:176)
==2809==    by 0x273020: std::sys::unix::fs::try_statx (fs.rs:161)
==2809==    by 0x26A[47](https://github.com/sunshine-protocol/allo-isolate/runs/8109974892?check_suite_focus=true#step:6:48)9: file_attr (fs.rs:955)
==2809==    by 0x26A479: std::fs::File::metadata (fs.rs:550)
==2809==    by 0x1A2651: backtrace::symbolize::gimli::mmap (gimli.rs:138)
==2809==    by 0x1A3DA2: backtrace::symbolize::gimli::elf::<impl backtrace::symbolize::gimli::Mapping>::new (elf.rs:21)
==2809==    by 0x1A2D99: backtrace::symbolize::gimli::Cache::mapping_for_lib (gimli.rs:320)
==2809==    by 0x1A3240: backtrace::symbolize::gimli::resolve::{{closure}} (gimli.rs:354)
==2809==    by 0x1A2982: backtrace::symbolize::gimli::Cache::with_global (gimli.rs:266)
==2809==    by 0x1A30E3: backtrace::symbolize::gimli::resolve (gimli.rs:346)
==2809==    by 0x18FB2A: backtrace::symbolize::resolve_frame_unsynchronized (mod.rs:178)
==2809==    by 0x18F92A: backtrace::symbolize::resolve_frame (mod.rs:105)
==2809==    by 0x199[48](https://github.com/sunshine-protocol/allo-isolate/runs/8109974892?check_suite_focus=true#step:6:49)4: backtrace::capture::Backtrace::resolve (capture.rs:232)
==2809==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==2809== 
==2809== Syscall param statx(buf) points to unaddressable byte(s)
==2809==    at 0x[49](https://github.com/sunshine-protocol/allo-isolate/runs/8109974892?check_suite_focus=true#step:6:50)6788E: statx (statx.c:29)
==2809==    by 0x273020: statx (weak.rs:176)
==2809==    by 0x273020: std::sys::unix::fs::try_statx (fs.rs:161)
==2809==    by 0x26A479: file_attr (fs.rs:955)
==2809==    by 0x26A479: std::fs::File::metadata (fs.rs:5[50](https://github.com/sunshine-protocol/allo-isolate/runs/8109974892?check_suite_focus=true#step:6:51))
==2809==    by 0x1A26[51](https://github.com/sunshine-protocol/allo-isolate/runs/8109974892?check_suite_focus=true#step:6:52): backtrace::symbolize::gimli::mmap (gimli.rs:138)
==2809==    by 0x1A3DA2: backtrace::symbolize::gimli::elf::<impl backtrace::symbolize::gimli::Mapping>::new (elf.rs:21)
==2809==    by 0x1A2D99: backtrace::symbolize::gimli::Cache::mapping_for_lib (gimli.rs:320)
==2809==    by 0x1A3240: backtrace::symbolize::gimli::resolve::{{closure}} (gimli.rs:354)
==2809==    by 0x1A2982: backtrace::symbolize::gimli::Cache::with_global (gimli.rs:266)
==2809==    by 0x1A30E3: backtrace::symbolize::gimli::resolve (gimli.rs:346)
==2809==    by 0x18FB2A: backtrace::symbolize::resolve_frame_unsynchronized (mod.rs:178)
==2809==    by 0x18F92A: backtrace::symbolize::resolve_frame (mod.rs:105)
==2809==    by 0x199484: backtrace::capture::Backtrace::resolve (capture.rs:232)
==2809==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==2809== 
all done!
==2809== 
==2809== HEAP SUMMARY:
==2809==     in use at exit: 45,782,816 bytes in 45,807 blocks
==2809==   total heap usage: 108,896 allocs, 63,089 frees, 72,[57](https://github.com/sunshine-protocol/allo-isolate/runs/8109974892?check_suite_focus=true#step:6:58)8,746 bytes allocated
==2809== 
==[28](https://github.com/sunshine-protocol/allo-isolate/runs/8109974892?check_suite_focus=true#step:6:29)09== LEAK SUMMARY:
==2809==    definitely lost: 0 bytes in 0 blocks
==2809==    indirectly lost: 0 bytes in 0 blocks
==2809==      possibly lost: 0 bytes in 0 blocks
==2809==    still reachable: 45,782,816 bytes in 45,807 blocks
==2809==         suppressed: 0 bytes in 0 blocks
==2809== Reachable blocks (those to which a pointer was found) are not shown.
==2809== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==2809== 
==2809== For lists of detected and suppressed errors, rerun with: -s
==2809== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Error: Process completed with exit code 1.

@fzyzcjy fzyzcjy marked this pull request as ready for review August 31, 2022 09:19
@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Aug 31, 2022

With latest valgrind, no longer have "Syscall param statx(file_name) points to unaddressable byte(s)" error.

Copy link
Owner

@shekohex shekohex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shekohex shekohex merged commit ba1d3ee into shekohex:master Aug 31, 2022
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.

2 participants