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

local directories are leaked to binary #185

Open
iHnR opened this issue Jun 19, 2023 · 1 comment
Open

local directories are leaked to binary #185

iHnR opened this issue Jun 19, 2023 · 1 comment

Comments

@iHnR
Copy link

iHnR commented Jun 19, 2023

Details

system: pop-os 22.04
cargo version: cargo 1.70.0 (ec8a8a0ca 2023-04-25)
jack version: 0.11.4

Description

I found by peeking inside the compiled binary for my files that my full user path is exposed in several places. This also happens when building in --release mode.

I understand these could be present in the debug build but should probably not be there in the release build.

I believe it's a jack problem as I don't have this issue with other libraries.

Reproduce

  1. run cargo new <project-name> && cd <project-name> && cargo add jack
  2. Add the following to main.rs.
use jack;

fn main() {
    // Define the jack device
    let (_client, _status) =
        match jack::Client::new("SimpleSynth", jack::ClientOptions::NO_START_SERVER) {
            Ok((_client, _status)) => (_client, _status),
            Err(some_error) => panic!("{some_error}"),
        };
}
  1. Run cargo build --release
  2. run strings target/release/<project-name> | grep <username>

Examples

Here are the lines I found in my executable. (username replaced)

called `Result::unwrap()` on an `Err` value/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jack-0.11.4/src/client/client_impl.rsfailed to parse JACK error: jack::client::client_impl
UnknownErrorRingbufferCreateFailedClientIsNoLongerAliveWeakFunctionNotFoundTimeErrorSetBufferSizeErrorPortRegistrationErrorPortNamingErrorPortMonitorErrorPortDisconnectionErrorPortConnectionErrorPortAlreadyConnectedPortAliasErrorNotEnoughSpaceInvalidDeactivationFreewheelErrorClientErrorClientDeactivationErrorClientActivationErrorCallbackRegistrationErrorCallbackDeregistrationErrorLibraryErrorPoisonError/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lazy_static-1.4.0/src/inline_lazy.rs | FAILUREINVALID_OPTIONNAME_NOT_UNIQUESERVER_STARTEDSERVER_FAILEDSERVER_ERRORNO_SUCH_CLIENTLOAD_FAILUREINIT_FAILURESHM_FAILUREVERSION_ERRORBACKEND_ERRORCLIENT_ZOMBIE0x(empty)
/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lazy_static-1.4.0/src/inline_lazy.rs
called `Result::unwrap()` on an `Err` valueLoading jack from .libjack.so.0jack_sys/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jack-sys-0.5.1/src/lib.rs/home/<username>/Documents/Programming/Rust/show_problem/target/release/build/jack-sys-a0cf6b8b22143969/out/functions.rsjack_release_timebasejack_get_cycle_timesjack_set_sync_callbackjack_set_sync_timeoutjack_set_timebase_callbackjack_transport_locatejack_transport_queryjack_get_current_transport_framejack_client_has_session_callbackjack_ringbuffer_get_write_vectorjack_transport_repositionjack_transport_startjack_transport_stopjack_get_transport_infojack_set_transport_infojack_client_openjack_is_realtimejack_thread_waitjack_on_shutdownjack_client_newjack_client_closejack_client_name_sizejack_get_client_namejack_get_uuid_for_client_namejack_get_client_name_by_uuidjack_internal_client_newjack_internal_client_closejack_activatejack_deactivatejack_get_client_pidjack_cycle_waitjack_cycle_signaljack_set_process_threadjack_set_thread_init_callbackjack_on_info_shutdownjack_set_process_callbackjack_set_freewheel_callbackjack_set_buffer_size_callbackjack_get_sample_ratejack_set_sample_rate_callbackjack_set_client_registration_callbackjack_set_port_registration_callbackjack_set_port_connect_callbackjack_set_port_rename_callbackjack_set_graph_order_callbackjack_set_xrun_callbackjack_set_latency_callbackjack_set_freewheeljack_set_buffer_sizejack_get_buffer_sizejack_engine_takeover_timebasejack_cpu_loadjack_port_registerjack_port_unregisterjack_port_get_bufferjack_port_uuidjack_port_namejack_port_short_namejack_port_flagsjack_port_typejack_port_type_idjack_port_is_minejack_port_connectedjack_port_connected_tojack_port_get_connectionsjack_port_get_all_connectionsjack_port_tiejack_port_untiejack_port_set_namejack_port_set_aliasjack_port_unset_aliasjack_port_get_aliasesjack_port_request_monitorjack_port_request_monitor_by_namejack_port_ensure_monitorjack_port_monitoring_inputjack_connectjack_disconnectjack_port_disconnectjack_port_name_sizejack_port_type_sizejack_port_type_get_buffer_sizejack_port_set_latencyjack_port_get_latency_rangejack_port_set_latency_rangejack_recompute_total_latenciesjack_port_get_latencyjack_port_get_total_latencyjack_recompute_total_latencyjack_get_portsjack_port_by_namejack_port_by_idjack_frames_since_cycle_startjack_frame_timejack_last_frame_timejack_frames_to_timejack_time_to_framesjack_get_timejack_set_error_functionjack_set_info_functionjack_freejack_client_real_time_priorityjack_client_max_real_time_priorityjack_set_session_callbackjack_session_replyjack_session_event_freejack_client_get_uuidjack_session_notifyjack_session_commands_freejack_reserve_client_namejackctl_setup_signalsjackctl_wait_signalsjackctl_server_createjackctl_server_destroyjackctl_server_openjackctl_server_startjackctl_server_stopjackctl_server_closejackctl_server_get_drivers_listjackctl_server_get_parametersjackctl_server_get_internals_listjackctl_server_load_internaljackctl_server_unload_internaljackctl_server_add_slavejackctl_server_remove_slavejackctl_server_switch_masterjackctl_driver_get_namejackctl_driver_get_typejackctl_driver_get_parametersjackctl_driver_params_parsejackctl_internal_get_namejackctl_internal_get_parametersjackctl_parameter_get_namejackctl_parameter_get_short_descriptionjackctl_parameter_get_long_descriptionjackctl_parameter_get_typejackctl_parameter_get_idjackctl_parameter_is_setjackctl_parameter_resetjackctl_parameter_get_valuejackctl_parameter_set_valuejackctl_parameter_get_default_valuejackctl_parameter_has_range_constraintjackctl_parameter_has_enum_constraintjackctl_parameter_get_enum_constraints_countjackctl_parameter_get_enum_constraint_valuejackctl_parameter_get_enum_constraint_descriptionjackctl_parameter_get_range_constraintjackctl_parameter_constraint_is_strictjackctl_parameter_constraint_is_fake_valuejack_set_propertyjack_get_propertyjack_free_descriptionjack_get_propertiesjack_get_all_propertiesjack_remove_propertyjack_remove_propertiesjack_remove_all_propertiesjack_set_property_change_callbackjack_get_internal_client_namejack_internal_client_handlejack_internal_client_loadjack_internal_client_unloadjack_get_max_delayed_usecsjack_get_xrun_delayed_usecsjack_reset_max_delayed_usecsjack_midi_get_event_countjack_midi_event_getjack_midi_clear_bufferjack_midi_max_event_sizejack_midi_event_reservejack_midi_event_writejack_midi_get_lost_event_countjack_ringbuffer_createjack_ringbuffer_freejack_ringbuffer_get_read_vectorjack_ringbuffer_readjack_ringbuffer_peekjack_ringbuffer_read_advancejack_ringbuffer_read_spacejack_ringbuffer_mlockjack_ringbuffer_resetjack_ringbuffer_writejack_ringbuffer_write_advancejack_ringbuffer_write_spacejack_uuid_to_indexjack_uuid_comparejack_uuid_copyjack_uuid_clearjack_uuid_parsejack_uuid_unparsejack_uuid_empty/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lazy_static-1.4.0/src/inline_lazy.rs
/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/log-0.4.19/src/lib.rskey-value support is experimental and must be enabled using the `kv_unstable` feature
@wmedrano
Copy link
Member

wmedrano commented Sep 12, 2024

Is this possibly a Rust issue when depending on a crate? I get the following for a completely unrelated Rust binary.

cd /tmp
git clone https://github.com/blahgeek/emacs-lsp-booster.git
cd emacs-lsp-booster
cargo build --release
strings target/release/emacs-lsp-booster | rg $USER
Fatal internal error. Please consider filing a bug report at https://github.com/clap-rs/clap/issues/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/parser/matches/arg_matches.rs/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/io/mod.rsstream did not contain valid UTF-8failed to fill whole buffer/builddir/build/BUILD/rustc-1.80.1-src/library/core/src/ops/function.rsdescription() is deprecated; use DisplayFromUtf8Errorbyteserrorinvalid utf-8ParseIntErrorkindcodeNoneSomehelpZeroautoTERMdumbbluecyan#[0 sizeunitenum or i128u128Unix
/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/util/flat_map.rsinternal error: entered unreachable code/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/sync/mpmc/zero.rs/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/sync/mpmc/waker.rs/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/sync/mpmc/context.rscalled `Result::unwrap()` on an `Err` value
internal error: entered unreachable code/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.108/src/ser.rs\"\\\b\f\n\r\tmessagejsonrpcidmethodparamsresulterror00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
internal error: entered unreachable code/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.108/src/de.rsjsonrpcidmethodparamsstruct LspRequest with 4 elements
/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/builder/ext.rs
internal error: entered unreachable code/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/sync/mpmc/array.rs/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/sync/mpmc/waker.rscalled `Result::unwrap()` on an `Err` valuePoisonErrorMismatch between definition and access of ``. /home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/parser/error.rs/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/collections/btree/map/entry.rs/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/collections/btree/node.rsassertion failed: edge.height == self.height - 1assertion failed: src.len() == dst.len()assertion failed: edge.height == self.node.height - 1internal error: entered unreachable code/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/sync/mpmc/mod.rs/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/sync/mpmc/list.rs/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/sync/mpmc/waker.rscalled `Result::unwrap()` on an `Err` value
SetLoggerError/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/env_logger-0.10.1/src/lib.rs
Builder::init should not be called after logger initializedattempt to re-use consumed buildercalled `Result::unwrap()` on an `Err` value/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/env_logger-0.10.1/src/fmt/writer/termcolor/extern_impl.rsregex: thread ID allocation space exhausted/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/regex-automata-0.4.3/src/util/pool.rs/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/env_logger-0.10.1/src/filter/mod.rsattempt to re-use consumed builder
internal error: entered unreachable code/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/termcolor-1.4.0/src/lib.rsattempt to re-use consumed builder/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/env_logger-0.10.1/src/fmt/writer/mod.rs
failed to write whole buffer/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/io/mod.rsa formatting trait implementation returned an error when the underlying stream did not/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/env_logger-0.10.1/src/fmt/mod.rs
failed to write the buffered dataIndex out of bounds/builddir/build/BUILD/rustc-1.80.1-src/library/core/src/slice/sort.rsassertion failed: end >= start && end <= lenassertion failed: offset != 0 && offset <= len/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/regex-automata-0.4.3/src/util/pool.rs()PoisonError/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/regex-automata-0.4.3/src/util/pool.rs
failed to write whole buffer/builddir/build/BUILD/rustc-1.80.1-src/library/std/src/io/mod.rscannot lock a buffered standard stream/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/termcolor-1.4.0/src/lib.rs
SystemTimeErrorUtf8Errorvalid_up_toerror_len/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/humantime-2.1.0/src/date.rsall times should be after the epochConversion to utf8 failed
a Display implementation returned an error unexpectedly/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/string.rsError/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smallvec-1.11.2/src/lib.rsassertion failed: index <= len:Supported LispObject: src/bytecode.rs\a\b\t\n\v\f\r\d\e\ \\^ []Too many constants! not implementedinternal error: entered unreachable codeassertion failed: chunks_len < (1 << 16)no entry found for keyIndex out of bounds/builddir/build/BUILD/rustc-1.80.1-src/library/core/src/slice/sort.rsassertion failed: end >= start && end <= lenassertion failed: offset != 0 && offset <= len
called `Result::unwrap()` on an `Err` valueCapacityOverflow1 element in map elements in map`start` or `end`floating point `layout/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smallvec-1.11.2/src/lib.rscapacity overflow
a Display implementation returned an error unexpectedly/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/string.rs/builddir/build/BUILD/rustc-1.80.1-src/library/core/src/str/pattern.rsErrorassertion failed: self.is_char_boundary(new_len)EOF while parsing a listEOF while parsing an objectEOF while parsing a stringEOF while parsing a valueexpected `:`expected `,` or `]`expected `,` or `}`expected identexpected valueexpected `"`invalid escapeinvalid numbernumber out of rangeinvalid unicode code pointcontrol character (\u0000-\u001F) found while parsing a stringkey must be a stringinvalid value: expected key to be a number in quotesfloat key must be finite (got NaN or +/-inf)lone leading surrogate in hex escapetrailing commatrailing charactersunexpected end of hex escaperecursion limit exceeded at line Error(, column: )invalid type: null, expected invalid type: , expected /home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.108/src/error.rs0123456789abcdefuuuuuuuubtnufruuuuuuuuuuuuuuuuuu
/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.108/src/read.rs
a Display implementation returned an error unexpectedly/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/string.rscalled `Result::unwrap()` on an `Err` valueError/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/builder/command.rs |--|-{}
false0/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/builder/arg.rs Fatal internal error. Please consider filing a bug report at https://github.com/clap-rs/clap/issues--- [=[=
...][<>/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/builder/ext.rs/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/parser/arg_matcher.rs
a Display implementation returned an error unexpectedly/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/string.rsErrorFatal internal error. Please consider filing a bug report at https://github.com/clap-rs/clap/issues/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/parser/matches/matched_arg.rs/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/mkeymap.rsCOMMAND
Usage: <>[OPTIONS][]/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/output/usage.rs--[--
()/builddir/build/BUILD/rustc-1.80.1-src/library/core/src/str/pattern.rsmid > len/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anstream-0.6.5/src/adapter/strip.rs/builddir/build/BUILD/rustc-1.80.1-src/library/core/src/str/mod.rs
Mismatch between definition and access of ``. /home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/parser/error.rsCould not downcast to , need to downcast to Unknown argument or group id.  Make sure you are using the argument id and not the short or long flags
/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/parser/matches/arg_matches.rsFatal internal error. Please consider filing a bug report at https://github.com/clap-rs/clap/issues/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/util/flat_map.rs
a Display implementation returned an error unexpectedly/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/string.rsError/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/parser/validator.rsFatal internal error. Please consider filing a bug report at https://github.com/clap-rs/clap/issues/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/builder/arg.rs/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/util/graph.rs
/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/error/mod.rsto pass '' as a value, use ''--  subcommand '' exists; to use it, remove the '--' before itinnerTypeIdta Display implementation returned an error unexpectedly/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/string.rsErrorEmptyInvalidDigitPosOverflowNegOverflowParseIntErrorcannot parse integer from empty stringinvalid digit found in stringnumber too large to fit in target typenumber too small to fit in target typenumber would be zero for non-zero typeTryFromIntErrorout of range integral type conversion attempted is not in false
:ArgumentsOptions, -- Only called with possible value/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/output/help_template.rs
a Display implementation returned an error unexpectedly/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/string.rsErrorinternal error: entered unreachable code/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/parser/parser.rsinternal error: entered unreachable code: `to_long` always has the flag specifiedFatal internal error. Please consider filing a bug report at https://github.com/clap-rs/clap/issues=-/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.12/src/builder/arg.rs
false--<>/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/strsim-0.10.0/src/lib.rs
mid > len/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anstream-0.6.5/src/adapter/strip.rs
CLICOLOR_FORCECImid > len/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_lex-0.6.0/src/ext.rscalled `Result::unwrap()` on an `Err` valueUtf8Errorvalid_up_toerror_len/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_lex-0.6.0/src/lib.rs
[58;2;/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anstyle-1.0.4/src/color.rs
OFFERRORDEBUGTRACEkey-value support is experimental and must be enabled using the `kv_unstable` feature/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/log-0.4.20/src/__private_api.rs/builddir/build/BUILD/rustc-1.80.1-src/library/core/src/slice/index.rsassertion failed: self.is_char_boundary(n)/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/string.rs/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/vec/mod.rs:        a Display implementation returned an error unexpectedly/builddir/build/BUILD/rustc-1.80.1-src/library/alloc/src/string.rsErrorassertion failed: self.is_char_boundary(new_len)backtrace capture failed/home/<username>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.78/src/error.rs: 

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

No branches or pull requests

2 participants