-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Panicking on opening too many files #2243
Comments
I have the same problem with Deno.run. Deno version: 0.4.0 (async ()=> {
try{
const process= Deno.run( 'my command' );
const status= process.status();
const output= process.output();
await process.status();
if( (await status).success )
return process.output();
else
throw new Error();
}finally{
process.close();
}
})(); The processes should be closed finally. But after several request, deno crashes with: Uncaught Other: Too many open files (os error 24)
at DenoError (js/errors.ts:22:5)
at maybeError (js/errors.ts:33:12)
at maybeThrowError (js/errors.ts:39:15)
at sendSync (js/dispatch.ts:114:5)
at run (js/process.ts:189:19)
at my file where Deno.run() called |
@Fenzland I think this is a different problem (since in my case the process crashed under |
I haven't accouted this. Maybe several hundreds requests. |
I've got this from trying to import a module that has a ton of files, my import Three from 'https://unpkg.com/three@0.85.2/src/Three.js?module'
console.log(Three) |
Is this issue still remaining? I tried with a small ulimit number and it seems throwing js errors. $ ulimit -n 50
$ cat test.ts
window.onload = function () {
for (let i = 0; i < 100; i++) {
Deno.open(`foo${i}`, 'w')
}
}
$ deno test.ts -A
error: Uncaught Other: Too many open files (os error 24)
► js/errors.ts:33:12
at DenoError (js/errors.ts:22:5)
at maybeError (js/errors.ts:33:12)
at handleAsyncMsgFromRust (js/dispatch.ts:41:17)
at handleAsyncMsgFromRust (shared_queue.js:157:9) |
🙁 [tomohito.nakayama@shorthair deno (master=)]$ uname
Darwin
[tomohito.nakayama@shorthair deno (master=)]$ cat test.ts
window.onload = function () {
for (let i = 0; i < 100; i++) {
Deno.open(`foo${i}`, 'w')
}
}
[tomohito.nakayama@shorthair deno (master=)]$ ./target/debug/deno test.ts -A
Compile file:///Users/tomohito.nakayama/dev/deno/test.ts
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 24, kind: Other, message: "Too many open files" }', src/libcore/result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
thread 'tokio-runtime-worker-0' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libcore/result.rs:999:5
fatal runtime error: failed to initiate panic, error 5
Abort trap: 6
[tomohito.nakayama@shorthair deno (master=)]$ |
tmnk@calico:~/dev/deno$ RUST_BACKTRACE=1 ./target/debug/deno test.ts
Compile file:///home/tmnk/dev/deno/test.ts
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 24, kind: Other, message: "Too many open files" }', src/libcore/result.rs:999:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:59
at src/libstd/panicking.rs:197
3: std::panicking::default_hook
at src/libstd/panicking.rs:211
4: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:474
5: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:381
6: rust_begin_unwind
at src/libstd/panicking.rs:308
7: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
8: core::result::unwrap_failed
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/macros.rs:18
9: core::result::Result<T,E>::unwrap
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/result.rs:800
10: deno_bin::tokio_util::create_threadpool_runtime
at ../../cli/tokio_util.rs:14
11: deno_bin::tokio_util::block_on::{{closure}}
at ../../cli/tokio_util.rs:53
thread 'tokio-runtime-worker-0' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libcore/result.rs:999:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:59
at src/libstd/panicking.rs:197
3: std::panicking::default_hook
at src/libstd/panicking.rs:211
4: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:474
5: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:381
6: rust_begin_unwind
at src/libstd/panicking.rs:308
7: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
8: core::result::unwrap_failed
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/macros.rs:18
9: core::result::Result<T,E>::unwrap
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/result.rs:800
10: deno_bin::tokio_util::block_on
at ../../cli/tokio_util.rs:57
11: deno_bin::ops::op_fetch_source_file
at ../../cli/ops.rs:534
12: deno_bin::ops::dispatch_all_legacy
at ../../cli/ops.rs:125
13: deno_bin::ops::dispatch_all
at ../../cli/ops.rs:93
14: deno_bin::state::ThreadSafeState::dispatch
at ../../cli/state.rs:113
15: deno_bin::worker::Worker::new::{{closure}}
at ../../cli/worker.rs:37
16: deno::isolate::Isolate::pre_dispatch
at ../../core/isolate.rs:332
17: _ZN4deno4SendERKN2v820FunctionCallbackInfoINS0_5ValueEEE
at ./../../core/libdeno/binding.cc:248
18: _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE
at ../../third_party/v8/src/api/api-arguments-inl.h:158
19: _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE
at ./../../third_party/v8/src/builtins/builtins-api.cc:111
20: _ZN2v88internalL26Builtin_Impl_HandleApiCallENS0_16BuiltinArgumentsEPNS0_7IsolateE
at ./../../third_party/v8/src/builtins/builtins-api.cc:141
21: _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE
at ./../../third_party/v8/src/builtins/builtins-api.cc:129
22: <unknown>
fatal runtime error: failed to initiate panic, error 5
Aborted tmnk@calico:~/dev/deno$ cat /proc/version
Linux version 4.19.57-microsoft-standard (oe-user@oe-host) (gcc version 7.3.0 (GCC)) #1 SMP Wed Jul 3 20:47:25 UTC 2019 |
Seeing stacktrace of Rust layer, Not a problem of deno, but a problem of Rust ? 🤔 |
I'll be tackling this issue this week |
It seems v0.17.0 doesn't panic anymore.
|
Yes, I think issues described here are now resolved 🎉 |
🎉
|
Deno panics and hard crash on opening too many files, aka fildes count exceeding
ulimit -n
. Ideally it should throw a user space error instead.(Might have been a Tokio problem though)
The text was updated successfully, but these errors were encountered: