sigaloid / vial

🧪 a micro micro-framework for rust

Home Page:http://vial.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OOM

sigaloid opened this issue · comments

==136775== 2,147,483,648 bytes in 1 blocks are still reachable in loss record 26 of 26
==136775==    at 0x484383F: realloc (vg_replace_malloc.c:1192)
==136775==    by 0x1211DF: _ZN5alloc7raw_vec11finish_grow17h598b8ccf9d58ee21E.llvm.14717338833749814861 (in /home/matt/rust/vial-test/target/release/vial-test)
==136775==    by 0x111E63: alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle (in /home/matt/rust/vial-test/target/release/vial-test)
==136775==    by 0x126E64: vial::util::percent_decode (in /home/matt/rust/vial-test/target/release/vial-test)
==136775==    by 0x126CD1: vial::util::decode_form_value (in /home/matt/rust/vial-test/target/release/vial-test)
==136775==    by 0x123C27: vial::request::Request::parse_form (in /home/matt/rust/vial-test/target/release/vial-test)
==136775==    by 0x123131: vial::request::Request::from_reader (in /home/matt/rust/vial-test/target/release/vial-test)
==136775==    by 0x11C228: vial::server::Server::handle_request (in /home/matt/rust/vial-test/target/release/vial-test)
==136775==    by 0x11852B: <F as threadpool::FnBox>::call_box (in /home/matt/rust/vial-test/target/release/vial-test)
==136775==    by 0x12F890: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/matt/rust/vial-test/target/release/vial-test)
==136775==    by 0x1311AE: core::ops::function::FnOnce::call_once{{vtable-shim}} (in /home/matt/rust/vial-test/target/release/vial-test)
==136775==    by 0x153F42: call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> (boxed.rs:1636)
==136775==    by 0x153F42: call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> (boxed.rs:1636)
==136775==    by 0x153F42: std::sys::unix::thread::Thread::new::thread_start (thread.rs:106)

oom-91eb3df9f830d384521bcfaf3aeaf0df099f2522.txt
Sending this (with cat file | nc localhost 7667) to any vial server causes a rapid memory increase. Technically might not be an OOM but it does cause massive amounts of allocation. Probably that darned loop in percent_decode, in src/util.rs. for _ in 0..512 incomign