-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
oracledb 2 core dumps #718
Comments
Looking at the two builds, it looks like it is segfaulting within the "Update - LOB data" test. Do you have the SQL required to build the test schema separately? Or do I have to use the docker file provided? |
The tables, test data and test sqls are in the test itself at: |
The test uses the following to create the tables and data |
I see few tests are using same table by mistake... maybe thats the reason.
|
I'll give that a whirl. And yes, even bad code should not result in a segfault! |
finished to retest. it wasn't it. still core dumps. |
Ok. Thanks. Will let you know what I discover. |
@anthony-tuininga thanks. |
Reran with the updated version of the dpi and got the following (sometimes core dump but now i got some error message that might help more): Error: DPI-1002: invalid dpiLob handle
|
Yes, I get the same results -- sometimes core dumps and sometimes the error DPI-1002: invalid dpiLob handle. Investigations ongoing.... |
Ok. I tracked it down. The problem doesn't actually occur in the test that is failing! It is actually due to a corruption that is taking place earlier in a DML returning statement that returns LOBs. There is a possibility that additional buffer space will need to be allocated and the old space will have been freed. ODPI-C has the ability to manage that so here is the patch that I have developed. It will need to be reviewed but in my tests the problem goes away and you can continue testing your own code with v2. Let me know how it goes. --- a/src/njs/src/njsConnection.cpp
+++ b/src/njs/src/njsConnection.cpp
@@ -300,11 +300,16 @@ bool njsConnection::ProcessLOBs(njsBaton *baton, njsVariable *vars,
default:
continue;
}
- if (baton->isReturning && var->bindDir == NJS_BIND_OUT)
+ if (baton->isReturning && var->bindDir == NJS_BIND_OUT) {
+ if (dpiVar_getData(var->dpiVarHandle, &numElements,
+ &var->dpiVarData) < 0) {
+ baton->GetDPIError();
+ return false;
+ }
numElements = (uint32_t) baton->rowsAffected;
- else if (!var->isArray)
+ } else if (!var->isArray) {
numElements = baseNumElements;
- else {
+ } else {
if (dpiVar_getNumElementsInArray(var->dpiVarHandle,
&numElements) < 0) {
baton->GetDPIError(); |
thanks a lot. will rerunning npm install now on dev2 bring this new patch? |
Not yet. @cjbj will do that after it is reviewed, I believe. You can patch it yourself, however, if you don't want to wait. :-) |
that would be a bit hard since at the moment I only have travis and docker solution for testing. |
Ok. I guess you'll have to wait a bit, then. :-( |
…umber of rows returned exceeds the number of rows originally allocated (#718).
Patch applied. Please confirm that this issue has been fixed, @sagiegurari . Thanks! |
looks like it is working now. https://travis-ci.org/sagiegurari/misc-test/builds/244789515 Thanks a lot 👍 |
I have few tests that I run using simple-oracledb to check that nothing is broken for every new version of oracledb.
I tried it with oracledb 2 and it core dumps.
You can see it at:
https://travis-ci.org/sagiegurari/misc-test/builds/244591174#L463
Test Code at (it tests many different capabilities, insert/delete/update/select/LOBs and so on..):
https://github.com/sagiegurari/simple-oracledb/blob/master/test/spec/integration-spec.js
The build does the following:
You can see the above test definition for travis at (still playing with it to try it with oracle 12 docker image):
https://github.com/sagiegurari/misc-test/tree/oracle-docker
I have not investigated why it core dumps and which test exactly core dumps.
which latest oracledb version 1.13.1 the tests pass correctly:
https://travis-ci.org/sagiegurari/misc-test/builds/184018541
The text was updated successfully, but these errors were encountered: