asfernandes / node-firebird-drivers

Node.js Firebird Drivers
MIT License
53 stars 17 forks source link

Now error 3221225477 #13

Closed gsbelarus closed 4 years ago

gsbelarus commented 5 years ago

This is Access violation some where in the code of driver. We have a big problem because of unstable work of driver. Is it possible to compile it with extended debug information and source map, so when error arise we could see reference to the sources and stack trace?

Or if you provide us with instructions we could setup MS Visual Studio and try to find this bug by ourselves.

We use node 11, windows 2012 server, fb 3.0.4.

asfernandes commented 5 years ago

Test case?

gsbelarus commented 5 years ago

The error is definitely here. I see it every day. Now, I'm trying to figure out how to make a reproducible case. The problem is that database is huge (around150 GB) and application is rather complex. I will try to extract a sequence of SQLs which leads to driver's crash and test it against smaller database. If an error will appear on that database I will pack it and send to you. notice: @sywka

sywka commented 5 years ago

While looking for the error found such a thing

Example

it("Error code: 3221225477", async () => {
    const path = resolve("./TEST.FDB");
    if (existsSync(path)) {
        unlinkSync(path);
    }
    const client = createNativeClient(getDefaultLibraryFilename());
    const attachment = await client.createDatabase(path, {username: "SYSDBA", password: "masterkey"});
    const transaction = await attachment.startTransaction();

    attachment.execute(transaction, "DROP TABLE TEST").catch(console.log);  // don't wait for the end

    await transaction.commit();
    await attachment.dropDatabase();  // if don't wait for the end then will crash process too
    await client.dispose();
});

I still don't know whether this is the cause of our error, but in any case, this should generate an js error, not a process error.

asfernandes commented 5 years ago

The driver really don't yet protect from this kind of programming error. I believe many functions will have a natural protection in fbclient, but in this case, you're unloading the client library while some of its code is running.

asfernandes commented 4 years ago

This seems to be fixed in #15.