-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
leak in dbi->fetch_one and potentially other places #111
Comments
Yes, you are right, Thanks |
That seems to be at least partially open in 1.0.18a (which is ok, I've just checked the lines referenced above to update this). |
Yes, v1.0.18a is just a few hotfixes and a couple more things I could include "for free". In more detail: the library initialization code was sometimes causing a hard crash in Gix-IDE (but had no apparent ill-effect on GixSQL itself). Since the two are connected, I had to update GixSQL to release a new version of Gix-IDE, and I threw in a couple more things (the |
I have some started some work here: this will probably best be implemented with a smart pointer and a custom deleter, but this will need some refactoring in all the drivers, so I am leaving it for post-1.0.19. |
May I suggest to use milestones on GH? |
You are right. I am planning on releasing Gix-IDE 1.1.1 and GixSQL 1.0.19a in the first days of the next week. GixSQL v1.0.19a will be only a "re-alignment" version for some quick modifications that went into the version that will be shipping with Gix-IDE 1.1.1 (mostly internal stuff that Gix-IDE needs to generate metadata but that make no difference to the preprocessor itself). I have just added a new milestone (v1.0.20) that for now hasn't a "due date". I want to perform some more triage before actually adding issues but I am planning to include #53, #109, #111, #120, #124, #125. Obviously feel free to make suggestions. |
#126, if done outside of automation (this can come later), is not really something to "directly" relate to code changes, but as the suite does exist I highly suggest to execute them (at least locally adding docs/help scripts to run them in the repo) to look out for issues. Fixing and implementing those are likely quite useful; if in question, then a "backlog" milestone helps, if issues in there are re-considered on each version planning for at least partial work in the next milestone Three things that may not have an issue (not sure) that may be placed to a backlog, too:
|
I spotted a couple of places where this can be fixed, but since there are probably others, I am probably going to do what needed to be done anyway and start refactoring the interfaces and container objects to use smart pointers and C++-style allocation. This, by itself, should already solve several problems (I launched valgrind on some tests and it wasn't really happy) and make possible problems easier to spot. By the way: I have (internally) modified the current test suite (still no NIST, but that will be coming too) to run under Linux: the main test runner is still written in C# under .Net Core, but, at least on Ubuntu, that's just a couple of "apt install" commands away and makes it possible to run tests with a GitHub Actions runner. |
This sounds very promising and like the right approach! There's quite a lot in the 1.0.20 milestone already, do you have a rough ETA?
That sounds like good progress. Is executing the testsuite documented anywhere (I haven't looked hard)? |
No, not really, but I will begin working on it (actually I already have) and depending on how the work is progressing I'll try to establish one as soon as I can,
Good, I'll try that
No, but now that I am going to use it in a CI setting and make its existence "official", I intend to document it. There were/are also a few things that were mainly thought for Visual Studio usage and with a certain DB setup (basically the one I use) and that I am trying to "generalize". |
The test suite can now be run with valgrind (and DrMemory on Windows). As soon as I have something more solid (and some docs) I will start to publish on GitHub the v1.0.20dev branch I have started working on. I have also done some preliminary work, replacing a lot of the C-style allocation stuff with smart pointers. For now this is only in the main runtime library and in the PostgreSQL driver, just to be able to run some tests but obviously I will have to extend this to all the drivers, since all tests are passing and valgrind now seems way happier (see below, this is a basic test run with a cursor).
|
I've pushed the v1.0.20 branch on GitHub: all the drivers now use smart pointers, so a lot of memory leaks should have been eradicated. The |
This should be solved with the latest commit on the v1.0.20dev branch (dd46a20), now the tests all pass and show no definitely/possibly lost blocks in valgrind. I am marking this as ready. I need to do some triaging, then I will probably close this and #124 in preparation for v1.0.20.
|
I don't know enough of the library (possibly also not about c++ either) and am primarily wondering here.
I've only checked ODBC and PG so far and the question applies to both.
Taking the following example -
gixsql/runtime/libgixsql-odbc/DbInterfaceODBC.cpp
Lines 353 to 388 in 6394c17
Would there be the need for
delete wk_rs;
before all of thosereturn DBERR_SQL_ERROR;
?Should
csr->getPrivateData
be called and freed each time before it is set, like ingixsql/runtime/libgixsql-odbc/DbInterfaceODBC.cpp
Lines 404 to 407 in 6394c17
or should
setPrivateData
do this itself?The code for PG looks suspicious here, because the private data is not freed:
gixsql/runtime/libgixsql-pgsql/DbInterfacePGSQL.cpp
Lines 369 to 375 in 6394c17
The text was updated successfully, but these errors were encountered: