Skip to content
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

Querying a TIME type from NodeJS crashes the Javascript Interpreter #5125

Closed
2 tasks done
jwills opened this issue Oct 29, 2022 · 0 comments · Fixed by #5130
Closed
2 tasks done

Querying a TIME type from NodeJS crashes the Javascript Interpreter #5125

jwills opened this issue Oct 29, 2022 · 0 comments · Fixed by #5130

Comments

@jwills
Copy link
Contributor

jwills commented Oct 29, 2022

What happens?

Javascript does not have support for a built-in TIME data type, so if you try to query for a TIME column from Node you are supposed to get a Javascript exception about the data type being unsupported, but instead, the interpreter crashes like so:

> Uncaught Error: Data type is not supported TIME
> node[76445]: ../src/node_util.cc:242:static void node::util::WeakReference::DecRef(const FunctionCallbackInfo<v8::Value> &): Assertion `(weak_ref->reference_count_) >= (1)' failed.
 1: 0x10728a4e8 node::Abort() [/usr/local/Cellar/node/18.10.0/bin/node]
 2: 0x10728a4d3 node::Abort() [/usr/local/Cellar/node/18.10.0/bin/node]
 3: 0x10731a7b4 node::util::GuessHandleType(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/Cellar/node/18.10.0/bin/node]
 4: 0x107436c37 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/usr/local/Cellar/node/18.10.0/bin/node]
 5: 0x107436a1d v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/usr/local/Cellar/node/18.10.0/bin/node]
 6: 0x1074364a5 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/usr/local/Cellar/node/18.10.0/bin/node]
 7: 0x1070dfef9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/usr/local/Cellar/node/18.10.0/bin/node]

To Reproduce

Here's some NodeJS code to run that can easily reproduce the issue:

const { Database } = require('duckdb');
const db = new Database('/tmp/test.db');
db.all("SELECT CAST('11:10:10' as TIME) as time", function(err, res) {
  if (err) {
    console.log("An error!");
  }
  console.log(res[0].time);
});

OS:

OS X

DuckDB Version:

0.5.1

DuckDB Client:

NodeJS

Full Name:

Josh Wills

Affiliation:

WeaveGrid

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant