core dump when doing many queries on same connection or when opening many connections.
We have an issue on all platforms (Linux, mac and windows) when running the npm oracle and doing many queries on same connection. This test queries a simple table with 2 columns (varchar and clob) with little data and it has only 1 row. The test breaks on different platforms after some queries (on Linux the fastest). Any help would be much appreciated.
thanks.
var oracle = require('oracle'); var connectData = { "tns": "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.20.30.148)(PORT=1521))(CONNECT_DATA=(SID=SOMESID)))", "user": "ABC", "password": "123" };
var loops = 200; var i; var done = 0; var connected = 0;
oracle.connect(connectData, function (error, connection) { if (error) { console.error('error connecting'); } else { connected++; console.log('connected', connected);
for (i = 0; i < loops; i++) {
console.log('querying', i);
var statement = connection.prepare('SELECT JSON FROM MY_TABLE');
statement.execute([], function (errorObject2, result) {
if (errorObject2) {
console.error('error connecting');
} else {
done++;
console.log('query done.....', done);
}
});
}
}
});
setInterval(function () { console.log('test'); }, 10000);
I ran gdb and I see the following. It fails only after many queries are fired (around 100), and not for example if i run only 10 queries. it is as if the memory gets corrupted or something and that response vector is not valid anymore. since it happens in all platforms, i believe there is some unsafe handling of the response.
#0 0x00007fff8fd5bc7e in __kill ()
(gdb) bt
#0 0x00007fff8fd5bc7e in __kill ()
#1 0x00000001063aceed in skgesigOSCrash ()
#2 0x00000001063e28b6 in kpeDbgSignalHandler ()
#3 0x00000001063ad63f in skgesig_sigactionHandler ()
#4
Made a pull requests that solves the issue https://github.com/joeferner/node-oracle/pull/233
#233 fixes the issue.