Repository navigation
FATAL ERROR: v8::FromJust Maybe value is Nothing #6899
Description
Activity
Reproduced on 32 bit 0.12.7 nodejs
Instead of SEGV, console.log is undefined.
- Version: 0.12.7
- Platform: Linux 3.2.41-042stab111.12 SMP Thu Sep 17 11:38:20 MSK 2015 i686 GNU/Linux
- Subsystem: debian 7
$ node --version
v0.12.7
$ grep PRETTY /etc/os-release
PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
$ uname -a
Linux 3.2.41-042stab111.12 #1 SMP Thu Sep 17 11:38:20 MSK 2015 i686 GNU/Linux
$ node crash.js
/home/markus/c/crash.js:21
console.log("END");
^
TypeError: undefined is not a function
at pubs (/home/markus/c/crash.js:21:11)
at sendPacket (/home/markus/c/node_modules/mqtt/lib/client.js:41:7)
at MqttClient._sendPacket (/home/markus/c/node_modules/mqtt/lib/client.js:628:7)
at MqttClient.publish (/home/markus/c/node_modules/mqtt/lib/client.js:366:12)
at pubs (/home/markus/c/crash.js:18:9)
debug build stack trace:
#0 0x00007ffff6b79418 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007ffff6b7b01a in __GI_abort () at abort.c:89
#2 0x0000000001aaccb3 in node::OnFatalError (location=0x1dc0646 "v8::FromJust", message=0x1dc062e "Maybe value is Nothing.") at ../src/node.cc:2392
#3 0x000000000104bb41 in v8::Utils::ReportApiFailure (location=0x1dc0646 "v8::FromJust", message=0x1dc062e "Maybe value is Nothing.")
at ../deps/v8/src/api.cc:307
#4 0x0000000001046de9 in v8::Utils::ApiCheck (condition=false, location=0x1dc0646 "v8::FromJust", message=0x1dc062e "Maybe value is Nothing.")
at ../deps/v8/src/api.h:184
#5 0x000000000104cd84 in v8::V8::FromJustIsNothing () at ../deps/v8/src/api.cc:653
#6 0x00000000014ac433 in v8::Maybe<int>::FromJust (this=0x7ffffff08d70) at ../deps/v8/include/v8.h:6530
#7 0x0000000001aa907f in node::AppendExceptionLine (env=0x2a2d020, er=..., message=...) at ../src/node.cc:1524
#8 0x0000000001ad90e0 in node::ContextifyScript::DecorateErrorStack (env=0x2a2d020, try_catch=...) at ../src/node_contextify.cc:627
#9 0x0000000001ad8912 in node::ContextifyScript::New (args=...) at ../src/node_contextify.cc:511
#10 0x0000000001092eab in v8::internal::FunctionCallbackArguments::Call (this=0x7ffffff09e20,
f=0x1ad84c8 <node::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&)>) at ../deps/v8/src/arguments.cc:33
#11 0x000000000112afd5 in v8::internal::(anonymous namespace)::HandleApiCallHelper<true> (isolate=0x29efe60, args=...) at ../deps/v8/src/builtins.cc:3915
#12 0x000000000111be85 in v8::internal::Builtin_Impl_HandleApiCallConstruct (args=..., isolate=0x29efe60) at ../deps/v8/src/builtins.cc:3948
#13 0x000000000111bde4 in v8::internal::Builtin_HandleApiCallConstruct (args_length=4, args_object=0x7ffffff09ff8, isolate=0x29efe60)
at ../deps/v8/src/builtins.cc:3945
@addaleax I'd like to investigate further. How did you reproduce the crash ?
The OP's testcase does nothing when I execute it
@targos Hm, I’m looking into it too, and for me (x64, Linux) it reproduces it exactly as described above…
So, the Nothing is returned from Message::GetStartColumn
It can only happen when the execution of the JSFunction message_get_column_number throws an exception.
The function is defined here:
node/deps/v8/src/js/messages.js
Lines 208 to 215 in 7c3e920
| //Returns the offset of the given position within the containing line. | |
| function GetColumnNumber(message) { | |
| var script = %MessageGetScript(message); | |
| var start_position = %MessageGetStartPosition(message); | |
| var location = script.locationFromPosition(start_position, true); | |
| if (location == null) return -1; | |
| return location.column; | |
| } |
Minimal reproduction:
function a() {
try {
a();
} catch (e) {
console.log(e);
}
}
a();I think what’s going on is that once the RangeError is thrown, there’s not enough stack space left for lazily compiling the console module… I am not entirely sure what to do about that.
PR: #6907
24 remaining items
I just got this today with node 8.11.1. It happens when I do an infinite recursion in my graphQL resolver. The resolver is probably called as function and awaited.
I'll probably setup a small repro repo and report it as a new issue.
Just randomly hit this myself. No clue what I did to cause this.
The command that caused this was vitest run which is running my tests.
FATAL ERROR: v8::FromJust Maybe value is Nothing.
1: 00007FF6422194EF node_api_throw_syntax_error+174703
2: 00007FF6421A79C6 v8::internal::wasm::WasmCode::safepoint_table_offset+67350
3: 00007FF6421A889D node::OnFatalError+301
4: 00007FF642C25335 v8::api_internal::FromJustIsNothing+53
5: 00007FF6421902A2 v8::base::CPU::has_fpu+37538
6: 00007FF64227B297 uv_timer_stop+1207
7: 00007FF64227783B uv_async_send+331
8: 00007FF642276FCC uv_loop_init+1292
9: 00007FF64227716A uv_run+202
10: 00007FF642246065 node::SpinEventLoop+309
11: 00007FF6420DD200 v8::internal::wasm::SignatureMap::Freeze+36000
12: 00007FF6420D8918 v8::internal::wasm::SignatureMap::Freeze+17336
13: 00007FF64226783D uv_poll_stop+557
14: 00007FF643220D70 v8::internal::compiler::ToString+145936
15: 00007FFDEC273FED BaseThreadInitThunk+29
16: 00007FFDED2742A8 RtlUserThreadStart+40
Same here @OmgImAlexis
Using Vitejs 3.0.0 and Vitest 0.18.0
My tests seem to be passing, but there are 3 unhandled rejection errors.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error:
❯ post node_modules/.pnpm/vitest@0.18.0_happy-dom@6.0.3/node_modules/vitest/dist/worker.mjs:70:14
❯ node_modules/.pnpm/vitest@0.18.0_happy-dom@6.0.3/node_modules/vitest/dist/chunk-vite-node-utils.af8ead96.mjs:9149:11
❯ sendCall node_modules/.pnpm/vitest@0.18.0_happy-dom@6.0.3/node_modules/vitest/dist/chunk-vite-node-utils.af8ead96.mjs:9146:16
❯ node_modules/.pnpm/vitest@0.18.0_happy-dom@6.0.3/node_modules/vitest/dist/chunk-runtime-rpc.cc6a06a2.mjs:7:55
5| return new Proxy(rpc2, {
6| get(target, p, handler) {
7| const sendCall = Reflect.get(target, p, handler);
| ^
8| const safeSendCall = (...args) => withSafeTimers(() => sendCall(...args));
9| safeSendCall.asEvent = sendCall.asEvent;
❯ withSafeTimers node_modules/.pnpm/vitest@0.18.0_happy-dom@6.0.3/node_modules/vitest/dist/chunk-utils-global.1b22c4fd.mjs:472:20
❯ Proxy.safeSendCall node_modules/.pnpm/vitest@0.18.0_happy-dom@6.0.3/node_modules/vitest/dist/chunk-runtime-rpc.cc6a06a2.mjs:7:41
❯ process.<anonymous> node_modules/.pnpm/vitest@0.18.0_happy-dom@6.0.3/node_modules/vitest/dist/worker.mjs:34:11
❯ process.emit node:events:527:28
❯ emit node:internal/process/promises:140:20
FATAL ERROR: v8::FromJust Maybe value is Nothing.
1: 0xb09c10 node::Abort() [node]
2: 0xa1c193 node::FatalError(char const*, char const*) [node]
3: 0xcf8afa v8::Utils::ReportApiFailure(char const*, char const*) [node]
4: 0xb0da7d node::fs::FileHandle::CloseReq::Resolve() [node]
5: 0xb0dbd9 [node]
6: 0x156015d [node]
7: 0x1564936 [node]
8: 0x1577064 [node]
9: 0x1565288 uv_run [node]
10: 0xa43dd5 node::SpinEventLoop(node::Environment*) [node]
11: 0xbd3792 node::worker::Worker::Run() [node]
12: 0xbd3f28 [node]
13: 0x7fc9ba434e2d [/lib64/libc.so.6]
14: 0x7fc9ba4ba620 [/lib64/libc.so.6]
I meet the same question, too~
Just want to chime in with my vitest experience – I ran into the same obscure errors and was able to resolve them by fixing the following:
- making sure every file in my package had no circular imports (e.g. no import { foo } from "../index.js" in bar.js where bar is also exported in ../index.js)
- making sure every file in my package didn't use directory imports (e.g. no import { foo } from '../' or some other implicit index file) and included file extensions (e.g. import { foo } from './foo.js')
- making sure every dependency was installed (e.g. I had changed lodash to lodash.throttle but hadn't npm installed during my debugging madness–this also produced incomprehensible errors)
I was able to debug/verify the changes by editing the files in node_modules directly until they worked (and updated the package src afterward – this was just faster for me than doing the build for each change)
I also encountered this problem when using vitest again
This year's commenters: you're commenting on an old report that just happens to have the same generic error message in it. It's almost certainly not the same bug though, too much water has passed under too many bridges for that.
See #43304 for a more recent report. There's an excellent chance it's already fixed in the latest release.
I'm still getting the same issue, that post you linked to states it's fixed but using a newer version of node still throws this.
Just update vitest to the latest version, it worked for me
@Radinax I've updated to 0.22.1 (just a tip "the latest version" isn't helpful as that changes on every update). The issue still occurs.
Yes, I was facing this issue with Vitest 0.25.8 and node v18.0.0 in NX.
I managed to fix this issue by cleaning the npm cache and downgrading to node version 16,
npm cache clean --force
nvm use 16
I'm going to lock this. This is one of those issues that show up high in search rankings but as I mentioned in #6899 (comment), it's a generic error message - in 2023 you're not hitting the bug that was found and fixed in 2016.
If you're still seeing that error message with recent releases (and note: v18.0.0 does not count as recent, that would be v18.14.0 at the time of writing), then please open new issues with steps to reproduce, preferably without involving third-party dependencies.
People coming here from search engines, read #6899 (comment)
segmentation fault when simple mqtt client tries to send 40kb data to broker.
4.x versions of node crash with "console.log is not a function"
Program does not crash when i remove the // before the first console.log.
Seems to work under 32 bit.
steps to reproduce: