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

Testing test/dataTypes.js leads to core dump #131

Closed
abmusse opened this issue Jan 25, 2021 · 1 comment
Closed

Testing test/dataTypes.js leads to core dump #131

abmusse opened this issue Jan 25, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@abmusse
Copy link
Member

abmusse commented Jan 25, 2021

  • Node.js version: v14.15.4
  • idb-connector version: latest master branch
  • IBM i version:: V7R2

Describe the bug

In the process of running the test suite I ran into a core dump:

$ npm test 
 
> idb-connector@1.2.10 test ~/nodejs-idb-connector
> ln -sf ./build-tmp-napi-v3 ./build && ./node_modules/mocha/bin/mocha --timeout 5s



...

  Data Type Test
    ✓ runs SQLExecute and to bind varbinary (1-D array)


#
# Fatal error in , line 0
# Check failed: result.second.
#
#
#
#FailureMessage Object: fffffffffffb2d0
Trace/BPT trap (core dumped)
(gdb) bt
#0  uv_kill (pid=0, signum=5) at ../deps/uv/src/unix/process.c:583
#1  0x00000001013c6cb8 in node::Kill(v8::FunctionCallbackInfo<v8::Value> const&) ()
#2  0x000000010014824c in 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) ()
#3  0x0000000100147dc4 in v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) ()
#4  0x0000000100ed6228 in v8_Default_embedded_blob_data_ ()

To Reproduce
Initial I ran into SQLSTATE=55019 SQLCODE=-7008 from test/dataTypes.js stating BLOBTEST, BINARYTEST, and VARBINTEST tables are not valid for operation

$ npm test 

> idb-connector@1.2.10 test ~/nodejs-idb-connector
> ln -sf ./build-tmp-napi-v3 ./build && ./node_modules/mocha/bin/mocha --timeout 5s

...

  86 passing (8s)
  9 failing

  1) Data Type Test
       runs SQLExecute and to bind varbinary (1-D array):
     Uncaught Error: SQLSTATE=55019 SQLCODE=-7008 VARBINTEST in SCHEMA not valid for operation.
  

  2) Data Type Test
       runs SQLExecute and to bind varbinary (bindParameters):
     Uncaught Error: SQLSTATE=55019 SQLCODE=-7008 VARBINTEST in SCHEMA not valid for operation.
  

  3) Data Type Test
       bind parameters blob/binary/varbinary
         runs SQLExecute and to bind blob:
     Uncaught Error: SQLSTATE=55019 SQLCODE=-7008 BLOBTEST in SCHEMA not valid for operation.
  

  4) Data Type Test
       bind parameters blob/binary/varbinary
         runs SQLExecute and to bind blob (1-D array):
     Uncaught Error: SQLSTATE=55019 SQLCODE=-7008 BLOBTEST in SCHEMA not valid for operation.
  

  5) Data Type Test
       bind parameters blob/binary/varbinary
         runs SQLExecute and to bind blob (bindParameters):
     Uncaught Error: SQLSTATE=55019 SQLCODE=-7008 BLOBTEST in SCHEMA not valid for operation.
  

  6) Data Type Test
       bind parameters blob/binary/varbinary
         runs SQLExecute and to bind binary:
     Uncaught Error: SQLSTATE=55019 SQLCODE=-7008 BINARYTEST in SCHEMA not valid for operation.
  

  7) Data Type Test
       bind parameters blob/binary/varbinary
         runs SQLExecute and to bind binary (1-D array):
     Uncaught Error: SQLSTATE=55019 SQLCODE=-7008 BINARYTEST in SCHEMA not valid for operation.
  

  8) Data Type Test
       bind parameters blob/binary/varbinary
         runs SQLExecute and to bind binary (bindParameters):
     Uncaught Error: SQLSTATE=55019 SQLCODE=-7008 BINARYTEST in SCHEMA not valid for operation.
  

  9) Data Type Test
       bind parameters blob/binary/varbinary
         runs SQLExecute and to bind varbinary:
     Uncaught Error: SQLSTATE=55019 SQLCODE=-7008 VARBINTEST in SCHEMA not valid for operation.
 

So I added with NC to each insert statement and re-ran the test cases

diff --git a/test/dataTypes.js b/test/dataTypes.js
--- a/test/dataTypes.js
+++ b/test/dataTypes.js
@@ -103,7 +103,7 @@ describe('Data Type Test', () => {
     it('runs SQLExecute and to bind blob', (done) => {
       const user = (process.env.USER).toUpperCase();
       // Table which only contains one BLOB(512k) Field
-      const sql = `INSERT INTO ${user}.BLOBTEST(BLOB_COLUMN) VALUES(?)`;
+      const sql = `INSERT INTO ${user}.BLOBTEST(BLOB_COLUMN) VALUES(?) with NC`;
       fs.readFile(`${__dirname}/../README.md`, (error, buffer) => {
         if (error) {
           throw error;
@@ -133,7 +133,7 @@ describe('Data Type Test', () => {
     it('runs SQLExecute and to bind blob (1-D array)', (done) => {
       const user = (process.env.USER).toUpperCase();
       // Table which only contains one BLOB(512k) Field
-      const sql = `INSERT INTO ${user}.BLOBTEST(BLOB_COLUMN) VALUES(?)`;
+      const sql = `INSERT INTO ${user}.BLOBTEST(BLOB_COLUMN) VALUES(?) with NC`;
       fs.readFile(`${__dirname}/../README.md`, (error, buffer) => {
         if (error) {
           throw error;
@@ -163,7 +163,7 @@ describe('Data Type Test', () => {
     it('runs SQLExecute and to bind blob (bindParameters)', (done) => {
       const user = (process.env.USER).toUpperCase();
       // Table which only contains one BLOB(512k) Field
-      const sql = `INSERT INTO ${user}.BLOBTEST(BLOB_COLUMN) VALUES(?)`;
+      const sql = `INSERT INTO ${user}.BLOBTEST(BLOB_COLUMN) VALUES(?) with NC`;
       fs.readFile(`${__dirname}/../README.md`, (error, buffer) => {
         if (error) {
           throw error;
@@ -193,7 +193,7 @@ describe('Data Type Test', () => {
     it('runs SQLExecute and to bind binary', (done) => {
       const user = (process.env.USER).toUpperCase();
       // Table which only contains one BLOB(10) Field
-      const sql = `INSERT INTO ${user}.BINARYTEST(BINARY_COLUMN) VALUES(?)`;
+      const sql = `INSERT INTO ${user}.BINARYTEST(BINARY_COLUMN) VALUES(?) with NC`;
       fs.readFile(`${__dirname}/../README.md`, (error, buffer) => {
         if (error) {
           throw error;
@@ -222,7 +222,7 @@ describe('Data Type Test', () => {
     it('runs SQLExecute and to bind binary (1-D array)', (done) => {
       const user = (process.env.USER).toUpperCase();
       // Table which only contains one BLOB(10) Field
-      const sql = `INSERT INTO ${user}.BINARYTEST(BINARY_COLUMN) VALUES(?)`;
+      const sql = `INSERT INTO ${user}.BINARYTEST(BINARY_COLUMN) VALUES(?) with NC`;
       fs.readFile(`${__dirname}/../README.md`, (error, buffer) => {
         if (error) {
           throw error;
@@ -251,7 +251,7 @@ describe('Data Type Test', () => {
     it('runs SQLExecute and to bind binary (bindParameters)', (done) => {
       const user = (process.env.USER).toUpperCase();
       // Table which only contains one BLOB(10) Field
-      const sql = `INSERT INTO ${user}.BINARYTEST(BINARY_COLUMN) VALUES(?)`;
+      const sql = `INSERT INTO ${user}.BINARYTEST(BINARY_COLUMN) VALUES(?) with NC`;
       fs.readFile(`${__dirname}/../README.md`, (error, buffer) => {
         if (error) {
           throw error;
@@ -280,7 +280,7 @@ describe('Data Type Test', () => {
     it('runs SQLExecute and to bind varbinary', (done) => {
       const user = (process.env.USER).toUpperCase();
       // Table which only contains one VARBINARY(10) Field
-      const sql = `INSERT INTO ${user}.VARBINTEST(VARBINARY_COLUMN) VALUES(?)`;
+      const sql = `INSERT INTO ${user}.VARBINTEST(VARBINARY_COLUMN) VALUES(?) with NC`;
       fs.readFile(`${__dirname}/../README.md`, (error, buffer) => {
         if (error) {
           throw error;
@@ -311,7 +311,7 @@ describe('Data Type Test', () => {
   it('runs SQLExecute and to bind varbinary (1-D array)', (done) => {
     const user = (process.env.USER).toUpperCase();
     // Table which only contains one VARBINARY(10) Field
-    const sql = `INSERT INTO ${user}.VARBINTEST(VARBINARY_COLUMN) VALUES(?)`;
+    const sql = `INSERT INTO ${user}.VARBINTEST(VARBINARY_COLUMN) VALUES(?) with NC`;
     fs.readFile(`${__dirname}/../README.md`, (error, buffer) => {
       if (error) {
         throw error;
@@ -340,7 +340,7 @@ describe('Data Type Test', () => {
   it('runs SQLExecute and to bind varbinary (bindParameters)', (done) => {
     const user = (process.env.USER).toUpperCase();
     // Table which only contains one VARBINARY(10) Field
-    const sql = `INSERT INTO ${user}.VARBINTEST(VARBINARY_COLUMN) VALUES(?)`;
+    const sql = `INSERT INTO ${user}.VARBINTEST(VARBINARY_COLUMN) VALUES(?) with NC`;
     fs.readFile(`${__dirname}/../README.md`, (error, buffer) => {
       if (error) {
         throw error;
$ npm test 
 
> idb-connector@1.2.10 test ~/nodejs-idb-connector
> ln -sf ./build-tmp-napi-v3 ./build && ./node_modules/mocha/bin/mocha --timeout 5s



...

  Data Type Test
    ✓ runs SQLExecute and to bind varbinary (1-D array)


#
# Fatal error in , line 0
# Check failed: result.second.
#
#
#
#FailureMessage Object: fffffffffffb2d0
Trace/BPT trap (core dumped)

In the process of running the insert into binary types table we get a core dump shown above

Did a search of the error message and found nodejs/node#32463. Maybe this could be related.

Expected behavior
Test suite should run successfully

@dmabupt

Have you encountered this before?

@abmusse abmusse added the bug Something isn't working label Jan 25, 2021
@dmabupt
Copy link
Contributor

dmabupt commented Apr 26, 2021

I have skipped these tests. We can reopen it until we got a V8 fix for them. b02cd36

@dmabupt dmabupt closed this as completed Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants