Picodata crash: capacity overflow
When running some PGJDBC tests a strange error appeared:
2024-06-10 00:58:45.842 [243051] main/121/<rust> I> spawning a new fiber for postgres client connection
2024-06-10 00:58:45.844 [243051] main/5764/<rust> I> processed startup
2024-06-10 00:58:45.846 [243051] main/5764/<rust> I> client authenticated
2024-06-10 00:58:45.846 [243051] main/5764/<rust> I> entering the message handling loop
picodata> thread 'main' panicked at library/alloc/src/raw_vec.rs:25:5:
capacity overflow
stack backtrace:
0: rust_begin_unwind
at /builddir/build/BUILD/rustc-1.78.0-src/library/std/src/panicking.rs:645:5
1: core::panicking::panic_fmt
at /builddir/build/BUILD/rustc-1.78.0-src/library/core/src/panicking.rs:72:14
2: alloc::raw_vec::capacity_overflow
at /builddir/build/BUILD/rustc-1.78.0-src/library/alloc/src/raw_vec.rs:25:5
3: alloc::raw_vec::handle_reserve
at /builddir/build/BUILD/rustc-1.78.0-src/library/alloc/src/raw_vec.rs:566:34
4: alloc::raw_vec::RawVec<T,A>::with_capacity_in
at /builddir/build/BUILD/rustc-1.78.0-src/library/alloc/src/raw_vec.rs:155:9
5: alloc::vec::Vec<T,A>::with_capacity_in
at /builddir/build/BUILD/rustc-1.78.0-src/library/alloc/src/vec/mod.rs:688:20
6: alloc::vec::Vec<T>::with_capacity
at /builddir/build/BUILD/rustc-1.78.0-src/library/alloc/src/vec/mod.rs:481:9
7: <pgwire::messages::extendedquery::Parse as pgwire::messages::Message>::decode_body
at /home/fedora/.cargo/git/checkouts/pgwire-6a4e112c8a834c05/6e653e8/src/messages/extendedquery.rs:47:29
8: pgwire::messages::Message::decode::{{closure}}
at /home/fedora/.cargo/git/checkouts/pgwire-6a4e112c8a834c05/6e653e8/src/messages/mod.rs:52:13
9: pgwire::messages::codec::decode_packet
at /home/fedora/.cargo/git/checkouts/pgwire-6a4e112c8a834c05/6e653e8/src/messages/codec.rs:69:20
10: pgwire::messages::Message::decode
at /home/fedora/.cargo/git/checkouts/pgwire-6a4e112c8a834c05/6e653e8/src/messages/mod.rs:51:9
11: pgwire::messages::PgWireFrontendMessage::decode
at /home/fedora/.cargo/git/checkouts/pgwire-6a4e112c8a834c05/6e653e8/src/messages/mod.rs:138:21
12: picodata::pgproto::stream::PgStream<S>::try_decode_message
at ./src/pgproto/stream.rs:93:20
13: picodata::pgproto::stream::PgStream<S>::read_message
at ./src/pgproto/stream.rs:115:40
14: picodata::pgproto::client::PgClient<S>::process_message
at ./src/pgproto/client.rs:83:23
15: picodata::pgproto::client::PgClient<S>::process_messages_loop
at ./src/pgproto/client.rs:212:19
16: picodata::pgproto::do_handle_client
at ./src/pgproto.rs:66:5
17: picodata::pgproto::handle_client::{{closure}}
at ./src/pgproto.rs:49:19
18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
at /builddir/build/BUILD/rustc-1.78.0-src/library/alloc/src/boxed.rs:2020:9
19: tarantool::fiber::Fyber<F,T>::trampoline_for_ffi
at ./tarantool/tarantool/src/fiber.rs:821:17
20: fiber_cxx_invoke
at ./tarantool-sys/src/lib/core/fiber.h:1283:11
21: fiber_loop
at ./tarantool-sys/src/lib/core/fiber.c:1085:18
22: coro_init
at ./tarantool-sys/third_party/coro/coro.c:108:3
I'm not sure what is the cause but crashing is not a good sign anyway. Most likely the SQL query was too long.