node-oracle icon indicating copy to clipboard operation
node-oracle copied to clipboard

Assertion `handle->InternalFieldCount() > 0' failed

Open danschumann opened this issue 11 years ago • 4 comments

So, a co-worker had this problem when passing an object into execute

// shipment_id was returned from query and was assumed to be a string or int
// in actuality, shipment_id = { SHIPMENT_ID: '123' }
// shipment_id was thought to be '123', hence why we pass it to execute
// to be crystal clear, shipment_id is an object ( our bug that was entirely too difficult to debug )
connection.execute(query, [ shipment_id ] );

// Yields a hard crash in node-gyp
Assertion `handle->InternalFieldCount() > 0' failed

It is a very unhelpful error, as we thought we were passing a string. It crashes the c code so there is no stack trace. Do all objects passed into args hard crash? If so, would it be possible to have a check to throw a javascript error that is more helpful?

It was on an update if that helps narrow it down.

danschumann avatar Jan 28 '14 16:01 danschumann

I have the same crash, but using prepared statement:

var sql = "INSERT INTO feed (message) VALUES (:1)";
var data = { message: "Some text message to insert"};
var stmt = oracleBinder.prepare(sql);
stmt.execute([data], function(err, count) { //error handle here });

Crash with the error message: node: /home/agora/.node-gyp/0.10.22/src/node_object_wrap.h:61: static T* node::ObjectWrap::Unwrap(v8::Handlev8::Object) [with T = OutParam]: Assertion `handle->InternalFieldCount() > 0' failed. Aborted

hmayer avatar Feb 25 '14 14:02 hmayer

I have the same with @hmayer ;

user999987 avatar Aug 13 '14 09:08 user999987

How can I do with this problem?

xbl avatar Aug 13 '14 09:08 xbl

Can you try

var sql = "INSERT INTO feed (message) VALUES (:1)";
var data = "Some text message to insert"; // NOT WRAPPED
var stmt = oracleBinder.prepare(sql);
stmt.execute([data], function(err, count) { //error handle here });

Yes, arguments checking is poor. It should not crash the process but return a nice JS exception instead.

bjouhier avatar Aug 13 '14 17:08 bjouhier