Closed qarmin closed 3 years ago
Ubuntu 20.04
The error does look like it originated in binfarce. I'll take a look.
I've run cargo install cargo-bloat
and ran it on czkawka repository on commit 1829d19b2878420dd4c852be1459cf0bfd95aee8
- both cargo bloat
and cargo bloat --release
work for me on Ubuntu 18.04. Interesting.
The error in the backtrace you've provided points to the last unwrap()
in this line:
So ELF parsing has succeeded, but symbol extraction has failed. Interesting. Could you attach the contents of your target/
directory after running both cargo bloat
and cargo bloat --release
?
target folder which caused crash have 7,7 GB of data.
I moved it to trash, then created new target directory(by compiling program), next I renamed it and at the end I restored from trash original target directory.
But now I can't reproduce issue. I tried compile it, create doc etc. but nothing cause crash
The strangest is that when I run cargo bloat --release
, then almost everytime shows different results e.g.
rafal@rafalDesktop:~/Projekty/Rust/czkawka$ cargo bloat --release
Finished release [optimized] target(s) in 0.08s
Analyzing target/release/czkawka_gui
File .text Size Crate Name
0.9% 6.4% 36.5KiB czkawka_gui czkawka_gui::main::{{closure}}
0.6% 4.0% 22.6KiB czkawka_gui czkawka_gui::main
0.4% 3.0% 16.9KiB czkawka_core czkawka_core::duplicate::DuplicateFinder::find_duplicates
0.4% 2.9% 16.4KiB czkawka_gui czkawka_gui::main::{{closure}}
0.3% 1.9% 10.7KiB [Unknown] add_ranges
0.3% 1.8% 10.3KiB [Unknown] read_line_info
0.2% 1.7% 9.4KiB czkawka_core czkawka_core::big_file::BigFile::find_big_files
0.2% 1.6% 9.3KiB [Unknown] elf_add
0.2% 1.5% 8.4KiB czkawka_core czkawka_core::empty_folder::EmptyFolder::find_empty_folders
0.2% 1.4% 8.2KiB czkawka_core czkawka_core::temporary::Temporary::find_temporary_files
0.2% 1.4% 8.0KiB czkawka_core czkawka_core::empty_files::EmptyFiles::find_empty_files
0.2% 1.4% 7.7KiB std __rdos_backtrace_dwarf_add
0.2% 1.2% 7.0KiB [Unknown] read_attribute
0.1% 1.0% 5.4KiB czkawka_core <czkawka_core::duplicate::DuplicateFinder as czkawka_core::common_traits::SaveResults>::save_results_to_file
0.1% 0.9% 5.0KiB std core::num::flt2dec::strategy::dragon::format_shortest
0.1% 0.7% 4.0KiB std core::num::flt2dec::strategy::dragon::format_exact
0.1% 0.7% 3.8KiB czkawka_core <czkawka_core::empty_folder::EmptyFolder as czkawka_core::common_traits::SaveResults>::save_results_to_file
0.1% 0.7% 3.8KiB [Unknown] elf_zlib_inflate_and_verify
0.1% 0.6% 3.7KiB czkawka_core czkawka_core::common_extensions::Extensions::set_allowed_extensions
0.1% 0.6% 3.6KiB czkawka_core czkawka_core::common_directory::Directories::set_included_directory
8.0% 54.9% 312.7KiB And 1216 smaller methods. Use -n N to show more.
14.5% 100.0% 569.3KiB .text section size, the file size is 3.8MiB
rafal@rafalDesktop:~/Projekty/Rust/czkawka$ cargo bloat --release
Finished release [optimized] target(s) in 0.08s
Analyzing target/release/czkawka_gui_orbtk
File .text Size Crate Name
0.4% 1.4% 26.2KiB orbtk_widgets <orbtk_widgets::text_box::TextBox as orbtk_api::widget_base::template::Template>::template
0.4% 1.2% 22.7KiB orbtk_widgets <orbtk_widgets::button::Button as orbtk_api::widget_base::template::Template>::template
0.4% 1.2% 22.6KiB std std::sync::once::Once::call_once::{{closure}}
0.3% 1.2% 22.0KiB orbtk_widgets <orbtk_widgets::tab_widget::TabHeader as orbtk_api::widget_base::template::Template>::template
0.2% 0.8% 14.2KiB orbtk_widgets <orbtk_widgets::tab_widget::TabHeader as orbtk_api::widget_base::Widget>::build
0.2% 0.7% 13.7KiB czkawka_gui_orbtk czkawka_gui_orbtk::main::{{closure}}
0.2% 0.7% 12.8KiB orbtk_widgets <orbtk_widgets::button::Button as orbtk_api::widget_base::Widget>::build
0.2% 0.7% 12.2KiB minifb minifb::os::posix::wayland::Window::new
0.2% 0.6% 12.0KiB orbtk_widgets <orbtk_widgets::text_box::TextBox as orbtk_api::widget_base::Widget>::build
0.2% 0.6% 11.4KiB orbtk_api <orbtk_api::layout::grid::GridLayout as orbtk_api::layout::Layout>::arrange
0.2% 0.6% 10.7KiB [Unknown] add_ranges
0.2% 0.6% 10.3KiB [Unknown] read_line_info
0.2% 0.5% 9.8KiB minifb minifb::os::posix::x11::Window::new
0.2% 0.5% 9.6KiB orbtk_api orbtk_api::application::window_adapter::create_window
0.1% 0.5% 9.3KiB [Unknown] elf_add
0.1% 0.5% 8.8KiB orbtk_widgets <orbtk_widgets::behaviors::text_behavior::TextBehavior as orbtk_api::widget_base::Widget>::build
0.1% 0.5% 8.6KiB orbtk_api <orbtk_api::systems::event_state_system::EventStateSystem as dces::system::System<orbtk_tree::Tree,dces::component::string_component_store::StringComponentStore,orbtk_re...
0.1% 0.4% 8.3KiB orbtk_widgets <orbtk_widgets::window::Window as orbtk_api::widget_base::Widget>::build
0.1% 0.4% 7.7KiB std __rdos_backtrace_dwarf_add
0.1% 0.4% 7.7KiB orbtk_widgets <orbtk_widgets::tab_widget::TabWidget as orbtk_api::widget_base::Widget>::build
24.4% 83.6% 1.5MiB And 5343 smaller methods. Use -n N to show more.
29.1% 100.0% 1.8MiB .text section size, the file size is 6.2MiB
Looks like a binary selection bug. First time you got czkawka_gui
, next time czkawka_gui_orbtk
.
Looks like cargo can return artifacts in a random order.
Hi there,
I encountered into the same crash when I ran cargo bloat
on Xtensa target (it's not in upstream, so I use custom Rust toolchain). Same crate works OK when using thumbv (ARMv7) target.
Can you sent a produced binary?
Hi @RazrFalcon,
Attached minimal binary that reproduced the issue: dummy.zip
Hm... looks like this file doesn't have the .text
section. Only .rtc.text
. I'm not familiar with your target and I'm not sure how it should be handled.
And we definitely have to improve binfarce's error reporting.
I believe .flash.text
section contains a code. It is a target for embedded devices used ESP32 CPU.
I've created #64 for your issue.
I had this issue still, but after deleting my target/
and letting cargo bloat --release
build the release binary, it worked.
@lexxvir I've finally added --symbols-section
. Please test if it actually works as expected.
Hi @RazrFalcon !
Thanks a lot. I've just tested --symbols-section
and it works for me.
Glad to hear!
I had this issue still, but after deleting my
target/
and lettingcargo bloat --release
build the release binary, it worked.
Unfortunately it didn't work for me:
Finished release [optimized] target(s) in 0.15s
Error: parsing failed cause 'section .symtab is missing'.
@felipelalli Do you have strip = true
?
@felipelalli Do you have
strip = true
?
yes, just for release:
[profile.release]
opt-level = 'z' # Optimize for size
lto = true # Enable link-time optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations
panic = 'abort' # Abort on panic
strip = true # Strip symbols from binary*
will print this panic