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

Crash in ODBCResult::UV_AfterFetchAll #78

Open
lee-houghton opened this issue Nov 25, 2014 · 1 comment
Open

Crash in ODBCResult::UV_AfterFetchAll #78

lee-houghton opened this issue Nov 25, 2014 · 1 comment

Comments

@lee-houghton
Copy link

I've been trying to narrow down the cause of some production crashes for a while:

#
# Fatal error in ../deps/v8/src/api.h, line 297
# CHECK(allow_empty_handle || that != __null) failed
#

I finally got a backtrace:

#0  0x000000000095cbae in v8::internal::OS::Abort() ()
#1  0x000000000072490e in V8_Fatal ()
#2  0x00000000006f62b3 in v8::Object::Set(v8::Handle<v8::Value>, v8::Handle<v8::Value>, v8::PropertyAttribute) ()
#3  0x00007fabe2f6cc6a in ODBCResult::UV_AfterFetchAll (work_req=0x7fabd91f7c00, status=<optimized out>) at ../src/odbc_result.cpp:544
#4  0x00000000009c40d1 in uv__work_done ()
#5  0x00000000009ba249 in ?? ()
#6  0x00000000009ba313 in ?? ()
#7  0x00000000009c6f1c in uv__io_poll ()
#8  0x00000000009babac in uv_run ()
#9  0x00000000009692c2 in node::Start(int, char**) ()
#10 0x00007fabe3192eed in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#11 0x00000000005c0c21 in _start ()

This line 544 actually refers to the master branch in my repository: https://github.com/lee-houghton/node-odbc/blob/master/src/odbc_result.cpp#L544

From the looks of it GetRecordTuple() is returning an empty handle. Presumably this is because GetColumnValue() returned an empty handle due to calling ThrowException. Unfortunately ThrowException is probably a bad thing to do here. Even if UV_AfterFetchAll handled this case, it will result in an exception being thrown when control returns to JavaScript, rather than passed as the err parameter of the callback.

I'm working on a patch for this which will involve properly passing exceptions all the way through to the callback, but it will be for my master branch.

lee-houghton referenced this issue in lee-houghton/node-odbc Nov 25, 2014
…t been able to reliably reproduce the problem, so I'm unable to test if this has fixed it. But, it at least doesn't crash under normal usage...
@lee-houghton
Copy link
Author

The last two commits apparently didn't fully fix it - I had to do this as well: 2606202

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