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

[MySQL] panic in linked-hash-map #747

Closed
Json1949 opened this issue Oct 19, 2020 · 6 comments · Fixed by #867
Closed

[MySQL] panic in linked-hash-map #747

Json1949 opened this issue Oct 19, 2020 · 6 comments · Fixed by #867
Labels
bug:dependency A bug in a dependency, open until fixed by upgrade db:mysql Related to MySQL

Comments

@Json1949
Copy link

Json1949 commented Oct 19, 2020

let pool = MySqlPool::connect("mysql://root:123456@localhost/database")
    .await
    .unwrap();
let sql = "select * from accounts;";
let cursor = sqlx::query(sql).fetch_all(&pool).await?;
println!("{:?}", cursor);

the error message is

thread 'main' panicked at 'attempted to leave type linked_hash_map::Node<std::string::String, (u32, mysql::statement::MySqlStatementMetadata)> uninitialized, which is invalid', .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/mem/mod.rs:659:9

@abonander abonander changed the title thread 'main' panicked at 'attempted to leave type linked_hash_map::Node<std::string::String, (u32, mysql::statement::MySqlStatementMetadata)> uninitialized, which is invalid', /Users/zhouyongjian/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/mem/mod.rs:659:9 thread 'main' panicked at 'attempted to leave type linked_hash_map::Node<std::string::String, (u32, mysql::statement::MySqlStatementMetadata)> uninitialized, which is invalid' Oct 19, 2020
@abonander
Copy link
Collaborator

Can you please post more of the stack trace? It sounds like a bug in linked_hash_map.

@Json1949
Copy link
Author

Can you please post more of the stack trace? It sounds like a bug in linked_hash_map.

stack backtrace:
0: 0x107651684 - std::backtrace_rs::backtrace::libunwind::trace::habd846dbfba4dec3
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/../../backtrace/src/backtrace/libunwind.rs:100:5
1: 0x107651684 - std::backtrace_rs::backtrace::trace_unsynchronized::h40dc245c02c850cd
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x107651684 - std::sys_common::backtrace::_print_fmt::h67f54f72bef166ff
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/sys_common/backtrace.rs:67:5
3: 0x107651684 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h844c7066beb666ef
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/sys_common/backtrace.rs:46:22
4: 0x10766a330 - core::fmt::write::h0ce880d33cd2a300
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/core/src/fmt/mod.rs:1076:17
5: 0x10764b926 - std::io::Write::write_fmt::hac02242b4f0d94cf
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/io/mod.rs:1516:15
6: 0x107653329 - std::sys_common::backtrace::_print::h56a3f5ea1b98f7e0
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/sys_common/backtrace.rs:49:5
7: 0x107653329 - std::sys_common::backtrace::print::h547c70911beccdc9
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/sys_common/backtrace.rs:36:9
8: 0x107653329 - std::panicking::default_hook::{{closure}}::h96cc94daaa1c2cce
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/panicking.rs:208:50
9: 0x107652fed - std::panicking::default_hook::h4bcbdbb4632a8430
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/panicking.rs:227:9
10: 0x1076538fb - std::panicking::rust_panic_with_hook::haed354b0f2e751b0
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/panicking.rs:577:17
11: 0x10765347b - std::panicking::begin_panic_handler::{{closure}}::h6fdc9b95d4517185
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/panicking.rs:484:9
12: 0x107651b28 - std::sys_common::backtrace::__rust_end_short_backtrace::h21cee36b0bb256cd
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/sys_common/backtrace.rs:141:18
13: 0x10765343a - rust_begin_unwind
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/panicking.rs:483:5
14: 0x10767427f - core::panicking::panic_fmt::h33aee6f32da9c3a4
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/core/src/panicking.rs:85:14
15: 0x1076741d7 - core::panicking::panic::hbacf203cc1296275
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/core/src/panicking.rs:50:5
16: 0x10718c32a - core::mem::uninitialized::h32ddcd897981961e
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/mem/mod.rs:659:9
17: 0x10718c32a - linked_hash_map::LinkedHashMap<K,V,S>::ensure_guard_node::hd799f1f8938c4fcd
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/linked-hash-map-0.5.2/src/lib.rs:174:52
18: 0x10718c4cd - linked_hash_map::LinkedHashMap<K,V,S>::insert::hc965c7733bb105a8
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/linked-hash-map-0.5.2/src/lib.rs:304:9
19: 0x107188a36 - lru_cache::LruCache<K,V,S>::insert::h8d2f2aeaaf118b02
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/lru-cache-0.1.2/src/lib.rs:119:23
20: 0x1071cce6f - sqlx_core::common::statement_cache::StatementCache::insert::h209c2a1805670fed
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/common/statement_cache.rs:36:9
21: 0x1071bf703 - sqlx_core::mysql::connection::executor::::get_or_prepare::{{closure}}::h4598822153c09c3a
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/mysql/connection/executor.rs:77:36
22: 0x1071a3cdc - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h7fca1639d8595fb2
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
23: 0x1071c023e - sqlx_core::mysql::connection::executor::::run::{{closure}}::{{closure}}::{{closure}}::hf52db225d8a860b3
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/mysql/connection/executor.rs:104:38
24: 0x1071a36f6 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h4ef3cfeba6e43cec
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
25: 0x1071cbf8d - sqlx_core::ext::async_stream::TryAsyncStream::new::{{closure}}::h00f6066d25b0b6e3
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/ext/async_stream.rs:28:33
26: 0x1071a3f56 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h844e525fbd4f8c30
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
27: 0x1071f099a - <futures_util::future::future::fuse::Fuse as core::future::future::Future>::poll::h121844b9edd35b81
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-util-0.3.5/src/future/future/fuse.rs:81:37
28: 0x10718756d - <core::pin::Pin

as core::future::future::Future>::poll::h629ac43518d2cdf6
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/future.rs:119:9
29: 0x107186b6b - <&mut F as core::future::future::Future>::poll::hc3ce9c0657b4e780
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/future.rs:107:9
30: 0x1071ccba1 - <sqlx_core::ext::async_stream::TryAsyncStream as futures_core::stream::Stream>::poll_next::hb42bab1eb5e2cbd7
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/ext/async_stream.rs:51:17
31: 0x107187828 - <core::pin::Pin

as futures_core::stream::Stream>::poll_next::hb2a3b36b389a0085
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-core-0.3.5/src/stream.rs:121:9
32: 0x107187898 - <core::pin::Pin

as futures_core::stream::Stream>::poll_next::hbfcada9940b08362
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-core-0.3.5/src/stream.rs:121:9
33: 0x1071867fc - ::try_poll_next::h96e63ae72f6b36d4
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-core-0.3.5/src/stream.rs:193:9
34: 0x107181a44 - futures_util::stream::try_stream::TryStreamExt::try_poll_next_unpin::h9a66654e5a4aed8e
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-util-0.3.5/src/stream/try_stream/mod.rs:811:9
35: 0x107196f21 - <futures_util::stream::try_stream::try_next::TryNext as core::future::future::Future>::poll::ha757e3841459305f
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-util-0.3.5/src/stream/try_stream/try_next.rs:35:9
36: 0x107147a22 - sqlx_core::mysql::connection::executor::<impl sqlx_core::executor::Executor for &mut sqlx_core::mysql::connection::MySqlConnection>::fetch_many::{{closure}}::{{closure}}::h82cf627ada2141d1
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/mysql/connection/executor.rs:229:33
37: 0x10714b646 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h7058da5d37eb886f
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
38: 0x107166f2d - sqlx_core::ext::async_stream::TryAsyncStream::new::{{closure}}::h7b23171c6d4c8da7
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/ext/async_stream.rs:28:33
39: 0x10714b786 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h7bdcf9eb0c3813f3
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
40: 0x107146a4a - <futures_util::future::future::fuse::Fuse as core::future::future::Future>::poll::hecdbd394868942bf
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-util-0.3.5/src/future/future/fuse.rs:81:37
41: 0x10718756d - <core::pin::Pin

as core::future::future::Future>::poll::h629ac43518d2cdf6
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/future.rs:119:9
42: 0x107186b6b - <&mut F as core::future::future::Future>::poll::hc3ce9c0657b4e780
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/future.rs:107:9
43: 0x1071ccba1 - <sqlx_core::ext::async_stream::TryAsyncStream as futures_core::stream::Stream>::poll_next::hb42bab1eb5e2cbd7
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/ext/async_stream.rs:51:17
44: 0x1071877bd - <core::pin::Pin

as futures_core::stream::Stream>::poll_next::h802af018b71d1011
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-core-0.3.5/src/stream.rs:121:9
45: 0x10718679c - ::try_poll_next::h0b581bff04812d79
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-core-0.3.5/src/stream.rs:193:9
46: 0x1071482c4 - futures_util::stream::try_stream::TryStreamExt::try_poll_next_unpin::h66185ad1007e2eab
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-util-0.3.5/src/stream/try_stream/mod.rs:811:9
47: 0x107150f21 - <futures_util::stream::try_stream::try_next::TryNext as core::future::future::Future>::poll::h25083947aed14099
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-util-0.3.5/src/stream/try_stream/try_next.rs:35:9
48: 0x10714450e - sqlx_core::pool::executor::<impl sqlx_core::executor::Executor for &sqlx_core::pool::Pool>::fetch_many::{{closure}}::{{closure}}::h1b699a21fc71e738
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/pool/executor.rs:31:33
49: 0x10714b8c6 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h7cde9579c1b8b363
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
50: 0x10716755d - sqlx_core::ext::async_stream::TryAsyncStream::new::{{closure}}::hc1440a0e65881e9f
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/ext/async_stream.rs:28:33
51: 0x10714bfe6 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::hf924cbbbe25d49e8
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
52: 0x1071466e0 - <futures_util::future::future::fuse::Fuse as core::future::future::Future>::poll::h92a1fe69a3113931
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-util-0.3.5/src/future/future/fuse.rs:81:37
53: 0x10718756d - <core::pin::Pin

as core::future::future::Future>::poll::h629ac43518d2cdf6
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/future.rs:119:9
54: 0x107186b6b - <&mut F as core::future::future::Future>::poll::hc3ce9c0657b4e780
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/future.rs:107:9
55: 0x1071ccba1 - <sqlx_core::ext::async_stream::TryAsyncStream as futures_core::stream::Stream>::poll_next::hb42bab1eb5e2cbd7
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/ext/async_stream.rs:51:17
56: 0x1071877bd - <core::pin::Pin

as futures_core::stream::Stream>::poll_next::h802af018b71d1011
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-core-0.3.5/src/stream.rs:121:9
57: 0x10718679c - ::try_poll_next::h0b581bff04812d79
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-core-0.3.5/src/stream.rs:193:9
58: 0x107157dd7 - <futures_util::stream::try_stream::try_filter_map::TryFilterMap<St,Fut,F> as futures_core::stream::Stream>::poll_next::h1d953a6dddeecb06
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-util-0.3.5/src/stream/try_stream/try_filter_map.rs:75:47
59: 0x10714936d - <core::pin::Pin

as futures_core::stream::Stream>::poll_next::h58e02f7bf8dd4a60
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-core-0.3.5/src/stream.rs:121:9
60: 0x107148f4c - ::try_poll_next::hf4d9f3ee7bceb856
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-core-0.3.5/src/stream.rs:193:9
61: 0x107149421 - <futures_util::stream::try_stream::try_collect::TryCollect<St,C> as core::future::future::Future>::poll::hf6cad907aa7a6c61
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/futures-util-0.3.5/src/stream/try_stream/try_collect.rs:52:26
62: 0x10714926d - <core::pin::Pin

as core::future::future::Future>::poll::haf7d833ba6959768
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/future.rs:119:9
63: 0x1071643e2 - sqlx_core::query::Query<DB,A>::fetch_all::{{closure}}::hfcc8995ac14f43f5
at .cargo/git/checkouts/sqlx-f05f33ba4f5c3036/d97014f/sqlx-core/src/query.rs:199:9
64: 0x10714bbac - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::hcce49a973e3e350d
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
65: 0x107158abf - matcher::main::main::{{closure}}::h102583405654f977
at wzj-items/rust-matcher/src/main.rs:10:18
66: 0x10714bce3 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::he3f919adfa58c0d6
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
67: 0x107158617 - matcher::main::{{closure}}::h09361284d329c43e
at wzj-items/rust-matcher/src/main.rs:4:1
68: 0x10714ba03 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h883ce709b60a5573
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
69: 0x107140df7 - <async_std::task::builder::SupportTaskLocals as core::future::future::Future>::poll::{{closure}}::h6e382f4038054132
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/async-std-1.6.2/src/task/builder.rs:198:17
70: 0x10714e072 - async_std::task::task_locals_wrapper::TaskLocalsWrapper::set_current::{{closure}}::hb0c340321ed4bf8f
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/async-std-1.6.2/src/task/task_locals_wrapper.rs:60:13
71: 0x10715cbb3 - std::thread::local::LocalKey::try_with::h760f8d38db14462f
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:272:16
72: 0x10715c00e - std::thread::local::LocalKey::with::h107833b645fceaf3
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:248:9
73: 0x10714dcde - async_std::task::task_locals_wrapper::TaskLocalsWrapper::set_current::h73332c86c8c14bee
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/async-std-1.6.2/src/task/task_locals_wrapper.rs:55:9
74: 0x107140d43 - <async_std::task::builder::SupportTaskLocals as core::future::future::Future>::poll::h6e7cd3cc6a2a7989
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/async-std-1.6.2/src/task/builder.rs:196:13
75: 0x1071460c5 - smol::run::run::{{closure}}::{{closure}}::h5b088a5f83354585
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/smol-0.1.18/src/run.rs:119:43
76: 0x107159092 - scoped_tls::ScopedKey::set::h5dd769611b3def97
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/scoped-tls-1.0.0/src/lib.rs:137:9
77: 0x107146024 - smol::run::run::{{closure}}::h2afe1530f9ac30a3
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/smol-0.1.18/src/run.rs:116:9
78: 0x107156c9b - tokio::runtime::context::enter::h8bd4d276fb38b868
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/tokio-0.2.22/src/runtime/context.rs:72:5
79: 0x1071572ac - tokio::runtime::handle::Handle::enter::h747d5b335cd0961c
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/tokio-0.2.22/src/runtime/handle.rs:76:9
80: 0x1071577a2 - tokio::runtime::Runtime::enter::hac47791bf97e5079
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/tokio-0.2.22/src/runtime/mod.rs:486:9
81: 0x10714ec0a - smol::context::enter::{{closure}}::hc42ecaf0e1a3a278
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/smol-0.1.18/src/context.rs:27:17
82: 0x10715ce7b - std::thread::local::LocalKey::try_with::ha1d1583c60af9489
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:272:16
83: 0x10715c206 - std::thread::local::LocalKey::with::h58fe87960671f321
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:248:9
84: 0x10714e891 - smol::context::enter::h7a8cd4415b4e1f03
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/smol-0.1.18/src/context.rs:24:9
85: 0x107145ee1 - smol::run::run::hec420aad4917b0d7
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/smol-0.1.18/src/run.rs:115:5
86: 0x107141e1f - async_std::task::builder::Builder::blocking::{{closure}}::{{closure}}::hc66bf50f5aa68d4e
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/async-std-1.6.2/src/task/builder.rs:170:25
87: 0x10714de9d - async_std::task::task_locals_wrapper::TaskLocalsWrapper::set_current::{{closure}}::h38ab7a2e2822eca2
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/async-std-1.6.2/src/task/task_locals_wrapper.rs:60:13
88: 0x10715c6a2 - std::thread::local::LocalKey::try_with::h461b2ffb1eea8845
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:272:16
89: 0x10715c172 - std::thread::local::LocalKey::with::h4d7856f3cbb0a23a
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:248:9
90: 0x10714dd71 - async_std::task::task_locals_wrapper::TaskLocalsWrapper::set_current::hc097222b08ac59f8
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/async-std-1.6.2/src/task/task_locals_wrapper.rs:55:9
91: 0x107141ce7 - async_std::task::builder::Builder::blocking::{{closure}}::h2867c9bb4b647004
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/async-std-1.6.2/src/task/builder.rs:167:17
92: 0x10715ca42 - std::thread::local::LocalKey::try_with::h51730cf22fad0410
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:272:16
93: 0x10715c2a2 - std::thread::local::LocalKey::with::h662e72047f592d70
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:248:9
94: 0x107141ba8 - async_std::task::builder::Builder::blocking::h1014315380c198cc
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/async-std-1.6.2/src/task/builder.rs:160:9
95: 0x1071481e3 - async_std::task::block_on::block_on::h75574f113bb34ed1
at .cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-b667284cefd1bd08/async-std-1.6.2/src/task/block_on.rs:33:5
96: 0x107162d09 - matcher::main::h6ff127aa444e5111
at wzj-items/rust-matcher/src/main.rs:4:1
97: 0x10713d1a5 - core::ops::function::FnOnce::call_once::h10fb62aec5859f77
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
98: 0x107162b6c - std::sys_common::backtrace::__rust_begin_short_backtrace::h9f4d65a3199f11c8
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125:18
99: 0x107156528 - std::rt::lang_start::{{closure}}::hc945a4e0e37cb990
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/rt.rs:66:18
100: 0x107653d54 - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h8e7f1f8f54430f80
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/core/src/ops/function.rs:259:13
101: 0x107653d54 - std::panicking::try::do_call::h14055182fb11f767
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/panicking.rs:381:40
102: 0x107653d54 - std::panicking::try::h2a6baf4c457ae4d0
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/panicking.rs:345:19
103: 0x107653d54 - std::panic::catch_unwind::hbe726183f4d89556
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/panic.rs:382:14
104: 0x107653d54 - std::rt::lang_start_internal::he8007b277bc5e1b2
at /rustc/043eca7f0b34d12e61c44206beca740628647080/library/std/src/rt.rs:51:25
105: 0x107156501 - std::rt::lang_start::hfe31f9f69cee006e
at .rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/rt.rs:65:5
106: 0x107162d82 - _main

@Json1949
Copy link
Author

Can you please post more of the stack trace? It sounds like a bug in linked_hash_map.

If I re-create a new project, it can run successfully, and I copy someone else’s project and run it wrong.

@abonander
Copy link
Collaborator

It may not trigger all the time in every circumstance. The location of the panic strongly suggests a bug with linked-hash-map, not SQLx.

@abonander abonander added the bug:dependency A bug in a dependency, open until fixed by upgrade label Nov 19, 2020
@abonander abonander changed the title thread 'main' panicked at 'attempted to leave type linked_hash_map::Node<std::string::String, (u32, mysql::statement::MySqlStatementMetadata)> uninitialized, which is invalid' [MySQL] panic in linked-hash-map Nov 19, 2020
@abonander abonander added the db:mysql Related to MySQL label Nov 19, 2020
@chertov
Copy link
Contributor

chertov commented Dec 1, 2020

I have the same error with rust 1.48:

thread 'main' panicked at 'attempted to leave type `linked_hash_map::Node<std::string::String, (u32, std::sync::Arc<postgres::statement::PgStatementMetadata>)>` uninitialized, which is invalid'

https://github.com/rust-lang/rust/blob/master/RELEASES.md#L39
mem::uninitialized will now panic if any inner types inside a struct or enum disallow zero-initialization.

lru_cache and linked_hash_map is not maintained anymore
Some projects replaced it with hashlink
https://github.com/bluejekyll/trust-dns/pull/1301
rusqlite/rusqlite#811

@VersBinarii
Copy link
Contributor

VersBinarii commented Dec 1, 2020

I also just came across this issue on the rustc 1.48 with the postgres feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:dependency A bug in a dependency, open until fixed by upgrade db:mysql Related to MySQL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants