-
Notifications
You must be signed in to change notification settings - Fork 102
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
Concurrency bugs caused by multiple linked-in versions of libloading #32
Comments
Having a separate version 0.1 crate that contains a mutex shared by all versions of libloading would help here. Maybe there is a better solution? |
Perhaps we should be inspired by the And their locks are simple |
I see nothing in log crate which would be resistant to this issue – namely, it seems to me that it would be trivial to have two different global loggers set up in a binary that links to two different versions of In |
Why don't you use the |
There quite a few reasons that make using
|
The way to do this would be to create a separate
I see. This sounds like more of a concern. I tried to find more info on this, but couldn't really find anything. Is there a cargo issue discussing this? |
It still successfully prevents valid use-cases on platforms that do implement the The only downside is that currently it requires a C compiler to stay in stable-land. Need for the C compiler can be removed later once the linkage attribute is stabilized in rustc.
There is likely no cargo issue about this. There is retep998/winapi-rs#238 related to this, though. |
It reverts the following change of rust_libloading: nagisa/rust_libloading@d870a38 See also: nagisa/rust_libloading#32 The build error log of rust_libloading: 0:01.78 Internal error occurred: Command "/build/ebisu-bsp/build/tmp/hosttools/gcc" "-std=gnu99" "-O2" "-ffunction-sections" "-fdata-sections " "-fPIC" "-MD" "-MP" "-MF" ".deps/force-cargo-library-build.pp" "-m64" "-o" "/build/ebisu-bsp/build/tmp/work/aarch64-poky-linux/firefox/60.4. 0esr-r0/firefox-60.4.0/firefox-build-dir/toolkit/library/release/build/libloading-4bfcbe83545248d4/out/src/os/unix/global_static.o" "-c" "src/ os/unix/global_static.c" with args "gcc" did not execute successfully (status code exit code: 1). 0:01.78 0:01.78 ', /build/ebisu-bsp/build/tmp/work/aarch64-poky-linux/firefox/60.4.0esr-r0/firefox-60.4.0/third_party/rust/cc/src/lib.rs:2260:5 0:01.78 stack backtrace: 0:01.78 0: 0x5605d756ef8e - std::sys::unix::backtrace::tracing:imp:unwind_backtrace::he02ced09d6ef9634 0:01.78 at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49 0:01.78 1: 0x5605d7577a26 - std::sys_common::backtrace::print::h899c99cf51528fce 0:01.78 at libstd/sys_common/backtrace.rs:71 0:01.78 at libstd/sys_common/backtrace.rs:59 0:01.78 2: 0x5605d755d70b - std::panicking::default_hook::{{closure}}::h1293938f39991188 0:01.78 at libstd/panicking.rs:211 0:01.78 3: 0x5605d755d3e3 - std::panicking::default_hook::h21d85e0fe60e7542 0:01.78 at libstd/panicking.rs:227 0:01.78 4: 0x5605d755dd2e - std::panicking::rust_panic_with_hook::heef4f32e5b81276f 0:01.78 at libstd/panicking.rs:463 0:01.78 5: 0x5605d755d8cc - std::panicking::begin_panic_fmt::h7b91617991a35914 0:01.78 at libstd/panicking.rs:350 0:01.78 6: 0x5605d755a111 - cc::fail::hb8a3db7ae214ddd8 0:01.78 7: 0x5605d754eb1e - cc::Build::compile::hec719bba1d1593cd 0:01.78 8: 0x5605d7540c01 - build_script_build::main::h83038a714584dca2 0:01.78 9: 0x5605d753fd92 - std::rt::lang_start::{{closure}}::hc8b1f864a05e672f 0:01.78 10: 0x5605d755d812 - std::panicking::try::do_call::h9ce18ce7a2108605 0:01.78 at libstd/rt.rs:59 0:01.78 at libstd/panicking.rs:310 0:01.78 11: 0x5605d757eab9 - __rust_maybe_catch_panic 0:01.78 at libpanic_unwind/lib.rs:105 0:01.78 12: 0x5605d75666c5 - std::rt::lang_start_internal::h93415d3576bc8676 0:01.78 at libstd/panicking.rs:289 0:01.78 at libstd/panic.rs:374 0:01.78 at libstd/rt.rs:58 0:01.78 13: 0x5605d7540d93 - main 0:01.78 14: 0x7fbd1ab7e82f - __libc_start_main 0:01.78 15: 0x5605d753f978 - _start 0:01.78 16: 0x0 - <unknown> Signed-off-by: Takuro Ashie <ashie@clear-code.com>
It reverts the following change of rust_libloading: nagisa/rust_libloading@d870a38 See also: nagisa/rust_libloading#32 The build error log of rust_libloading: 0:01.78 Internal error occurred: Command "/build/ebisu-bsp/build/tmp/hosttools/gcc" "-std=gnu99" "-O2" "-ffunction-sections" "-fdata-sections " "-fPIC" "-MD" "-MP" "-MF" ".deps/force-cargo-library-build.pp" "-m64" "-o" "/build/ebisu-bsp/build/tmp/work/aarch64-poky-linux/firefox/60.4. 0esr-r0/firefox-60.4.0/firefox-build-dir/toolkit/library/release/build/libloading-4bfcbe83545248d4/out/src/os/unix/global_static.o" "-c" "src/ os/unix/global_static.c" with args "gcc" did not execute successfully (status code exit code: 1). 0:01.78 0:01.78 ', /build/ebisu-bsp/build/tmp/work/aarch64-poky-linux/firefox/60.4.0esr-r0/firefox-60.4.0/third_party/rust/cc/src/lib.rs:2260:5 0:01.78 stack backtrace: 0:01.78 0: 0x5605d756ef8e - std::sys::unix::backtrace::tracing:imp:unwind_backtrace::he02ced09d6ef9634 0:01.78 at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49 0:01.78 1: 0x5605d7577a26 - std::sys_common::backtrace::print::h899c99cf51528fce 0:01.78 at libstd/sys_common/backtrace.rs:71 0:01.78 at libstd/sys_common/backtrace.rs:59 0:01.78 2: 0x5605d755d70b - std::panicking::default_hook::{{closure}}::h1293938f39991188 0:01.78 at libstd/panicking.rs:211 0:01.78 3: 0x5605d755d3e3 - std::panicking::default_hook::h21d85e0fe60e7542 0:01.78 at libstd/panicking.rs:227 0:01.78 4: 0x5605d755dd2e - std::panicking::rust_panic_with_hook::heef4f32e5b81276f 0:01.78 at libstd/panicking.rs:463 0:01.78 5: 0x5605d755d8cc - std::panicking::begin_panic_fmt::h7b91617991a35914 0:01.78 at libstd/panicking.rs:350 0:01.78 6: 0x5605d755a111 - cc::fail::hb8a3db7ae214ddd8 0:01.78 7: 0x5605d754eb1e - cc::Build::compile::hec719bba1d1593cd 0:01.78 8: 0x5605d7540c01 - build_script_build::main::h83038a714584dca2 0:01.78 9: 0x5605d753fd92 - std::rt::lang_start::{{closure}}::hc8b1f864a05e672f 0:01.78 10: 0x5605d755d812 - std::panicking::try::do_call::h9ce18ce7a2108605 0:01.78 at libstd/rt.rs:59 0:01.78 at libstd/panicking.rs:310 0:01.78 11: 0x5605d757eab9 - __rust_maybe_catch_panic 0:01.78 at libpanic_unwind/lib.rs:105 0:01.78 12: 0x5605d75666c5 - std::rt::lang_start_internal::h93415d3576bc8676 0:01.78 at libstd/panicking.rs:289 0:01.78 at libstd/panic.rs:374 0:01.78 at libstd/rt.rs:58 0:01.78 13: 0x5605d7540d93 - main 0:01.78 14: 0x7fbd1ab7e82f - __libc_start_main 0:01.78 15: 0x5605d753f978 - _start 0:01.78 16: 0x0 - <unknown> Signed-off-by: Takuro Ashie <ashie@clear-code.com>
It is possible for multiple versions of libloading to be linked into a binary. In that case static mutexes, such as one used to guard uses of
dlerror
have no effect.The text was updated successfully, but these errors were encountered: