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

core dump when doing many queries on same connection or when opening many connections. #229

Closed
sagiegurari opened this issue Nov 3, 2014 · 3 comments

Comments

@sagiegurari
Copy link

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);

@sagiegurari
Copy link
Author

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
#5 0x0000000100c97134 in __normal_iterator (this=0x7fff5fbf6798, __i=@0x0) at stl_iterator.h:653
#6 0x0000000100c9710d in __normal_iterator (this=0x7fff5fbf6798, __i=@0x0) at stl_iterator.h:653
#7 0x0000000100c95154 in std::vector<output_t*, std::allocator<output_t*> >::begin (this=0x0) at stl_vector.h:331
#8 0x0000000100c92b78 in Connection::handleResult (baton=0x100d17d50, argv=@0x7fff5fbf7210) at ../src/connection.cpp:775
#9 0x0000000100ca4dd6 in Statement::EIO_AfterExecute (req=0x100d17e50, status=0) at ../src/statement.cpp:107
#10 0x00000001001319d2 in uv__work_done ()
#11 0x0000000100128a28 in uv__async_event ()
#12 0x0000000100128b99 in uv__async_io ()
#13 0x000000010013525d in uv__io_poll ()
#14 0x0000000100128fc3 in uv_run ()

@barakedry
Copy link

Made a pull requests that solves the issue
#233

@sagiegurari
Copy link
Author

#233 fixes the issue.

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

2 participants