hirofa / utils Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
In a complex use case where there are nested promise calls, the runtime is crashing with the following panics. Do you think these can be handled without panicking? I'm trying to create a simple, reproducible code sample, but unable to get it to panic.
thread panic occurred: panicked at 'no such elem',
.cargo/registry/src/github.com-1ecc6299db9ec823/
hirofa_utils-0.5.7/src/auto_id_map.rs:132:29
thread panic occurred: panicked at 'send failed: SendError { .. }',
.cargo/registry/src/github.com-1ecc6299db9ec823/
hirofa_utils-0.5.7/src/eventloop.rs:297:3
my error:
running 6 tests
test auto_id_map::tests::test_aim ... ok
test eventloop::tests::test ... ok
test eventloop::tests::test_sync ... ok
test js_utils::facades::values::tests::test_jsvf ... ok
==5283== Thread 2 task_manager::te:
==5283== Syscall param statx(file_name) points to unaddressable byte(s)
==5283== at 0x4AFD9FE: statx (statx.c:29)
==5283== by 0x2DA930: statx (weak.rs:136)
==5283== by 0x2DA930: std::sys::unix::fs::try_statx (fs.rs:139)
==5283== by 0x2CC035: file_attr (fs.rs:776)
==5283== by 0x2CC035: metadata (fs.rs:493)
==5283== by 0x2CC035: buffer_capacity_required (fs.rs:609)
==5283== by 0x2CC035: <std::fs::File as std::io::Read>::read_to_string (fs.rs:645)
==5283== by 0x27536E: num_cpus::linux::Cgroup::param (linux.rs:214)
==5283== by 0x275219: num_cpus::linux::Cgroup::quota_us (linux.rs:203)
==5283== by 0x2750A2: num_cpus::linux::Cgroup::cpu_quota (linux.rs:188)
==5283== by 0x274CB1: num_cpus::linux::load_cgroups (linux.rs:149)
==5283== by 0x27494D: num_cpus::linux::init_cgroups (linux.rs:129)
==5283== by 0x27D3A8: core::ops::function::FnOnce::call_once (function.rs:227)
==5283== by 0x27ED7A: std::sync::once::Once::call_once::{{closure}} (once.rs:262)
==5283== by 0x136C27: std::sync::once::Once::call_inner (once.rs:419)
==5283== by 0x27ED05: std::sync::once::Once::call_once (once.rs:262)
==5283== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5283==
==5283== Syscall param statx(buf) points to unaddressable byte(s)
==5283== at 0x4AFD9FE: statx (statx.c:29)
==5283== by 0x2DA930: statx (weak.rs:136)
==5283== by 0x2DA930: std::sys::unix::fs::try_statx (fs.rs:139)
==5283== by 0x2CC035: file_attr (fs.rs:776)
==5283== by 0x2CC035: metadata (fs.rs:493)
==5283== by 0x2CC035: buffer_capacity_required (fs.rs:609)
==5283== by 0x2CC035: <std::fs::File as std::io::Read>::read_to_string (fs.rs:645)
==5283== by 0x27536E: num_cpus::linux::Cgroup::param (linux.rs:214)
==5283== by 0x275219: num_cpus::linux::Cgroup::quota_us (linux.rs:203)
==5283== by 0x2750A2: num_cpus::linux::Cgroup::cpu_quota (linux.rs:188)
==5283== by 0x274CB1: num_cpus::linux::load_cgroups (linux.rs:149)
==5283== by 0x27494D: num_cpus::linux::init_cgroups (linux.rs:129)
==5283== by 0x27D3A8: core::ops::function::FnOnce::call_once (function.rs:227)
==5283== by 0x27ED7A: std::sync::once::Once::call_once::{{closure}} (once.rs:262)
==5283== by 0x136C27: std::sync::once::Once::call_inner (once.rs:419)
==5283== by 0x27ED05: std::sync::once::Once::call_once (once.rs:262)
==5283== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5283==
test cache::tests::test_cache ... ok
test task_manager::tests::test ... ok
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 9.45s
==5283==
==5283== HEAP SUMMARY:
==5283== in use at exit: 1,056 bytes in 2 blocks
==5283== total heap usage: 577 allocs, 575 frees, 97,207 bytes allocated
==5283==
==5283== LEAK SUMMARY:
==5283== definitely lost: 0 bytes in 0 blocks
==5283== indirectly lost: 0 bytes in 0 blocks
==5283== possibly lost: 0 bytes in 0 blocks
==5283== still reachable: 1,056 bytes in 2 blocks
==5283== suppressed: 0 bytes in 0 blocks
==5283== Reachable blocks (those to which a pointer was found) are not shown.
==5283== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==5283==
==5283== For lists of detected and suppressed errors, rerun with: -s
==5283== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Error: Process completed with exit code 123.
look sthe same as this issue, but i'm not going to build valgrind from source in my CI, todo check in 3 or 4 months if valgrinbd 3.19 is released and fixes this...
https://users.rust-lang.org/t/simple-fs-read-to-string-program-causes-valgrind-memcheck-errors/68722
for spidermonkey_runtime
use a AtmicUsize of my own and incr/decr in each job?
is now fixed at 250ms
todo, how to deal with interval timing, recalc based on wanted starttime, actual starttime, or endtime?
see HiRoFa/quickjs_es_runtime#72
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.