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

[BUG] Segmentation fault with callProcedure #415

Open
midbel opened this issue Jan 6, 2025 · 0 comments
Open

[BUG] Segmentation fault with callProcedure #415

midbel opened this issue Jan 6, 2025 · 0 comments

Comments

@midbel
Copy link

midbel commented Jan 6, 2025

Describe your system

  • odbc Package Version: 2.4.8
  • ODBC Driver: unixODBC
  • Database Name: DB2 on ibmi 7.4
  • Database Version:
  • Database OS:
  • Node.js Version: 22
  • Node.js OS: linux ubuntu

Describe the bug
calling function callProcedure on an open connection ends with a Segmentation fault. We've also tried with a prepared statement and the call to the same procedure works. Our procedure take only a varchar as a INOUT parameter. We've try with a char(500) as an IN parameter and a second OUT parameter, but the segmentation fault still appears. The input parameter is JSON string and we're expecting to retrieve a JSON object as string from the INOUT parameter.

the connection used is obtained from a pool

Expected behavior
no segmentation fault occurs when using the callProcedure function

To Reproduce
Steps to reproduce the behavior:

  1. Connect to database with options '...'
  2. Create database table '...'
  3. Run query '...'

Code
we used the following code to reproduce the issue

import odbc from 'odbc';


(async () => {
    const dsn = "<connection string>"
    let conn;
    try {
        conn = await odbc.connect(dsn);
        console.log("conn", conn.odbcConnection)
        console.log("connected", conn.connected)
        const data = {action: 'CR', data:{numcli: 103, price: 10}};
        console.log("data", data);

        const res = await conn.callProcedure(null, 'SCHEMA', 'TEST_PROC', [JSON.stringify(data)])
        console.log(res2)
    } catch (err) {
        console.error('oups something wrong happens!');
        console.error(err);
    } finally {
        if (conn) {
            await conn.close()
        }
    }
})();

Additional context
the application runs into a docker container with node-22-slim as base image

@midbel midbel changed the title [BUG] [BUG] Segmentation fault with callProcedure Jan 6, 2025
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

No branches or pull requests

1 participant