Hi,

I just discovered, that there may be a little memory leak in libsqlite version 0.8.6 (2.3.18). I compiled a small test application (see below) with gcc and the tool ccmalloc (http://www2.inf.ethz.ch/personal/biere/projects/ccmalloc/). ccmalloc reported a memory leak of 128 bytes (see the report below).

Is this a feature or a bug ?

Thanks for your help
Marcel

My test application (compiled with g++ version 2.95.4 / debian stable / ccmalloc version 0.4.0):
---
#include <stdlib.h>
#include <sqlite.h>


int main (void) {
        sqlite * db;
        db = sqlite_open("test.db", 0, NULL);
        sqlite_close(db);

        return 0;
}
---

Report of ccmalloc:

.---------------.
|ccmalloc report|
=======================================================
| total # of|   allocated | deallocated |     garbage |
+-----------+-------------+-------------+-------------+
|      bytes|       48231 |       48103 |         128 |
+-----------+-------------+-------------+-------------+
|allocations|         238 |         236 |           2 |
+-----------------------------------------------------+
| number of checks: 1                                 |
| number of counts: 474                               |
| retrieving function names for addresses ... done.   |
| reading file info from gdb ... done.                |
| sorting by number of not reclaimed bytes ... done.  |
| number of call chains: 2                            |
| number of ignored call chains: 0                    |
| number of reported call chains: 2                   |
| number of internal call chains: 2                   |
| number of library call chains: 0                    |
=======================================================
|
* 50.0% = 64 Bytes of garbage allocated in 1 allocation
|       | 1 allocated (64 Bytes = 0.1% of total allocated)
|       |
|       @ [
|       |   +0x080cdb68
|       | ]
|       |
|       |       0x400a314f in <__libc_start_main>
|       |
|       |       0x08049647 in <main>
|       |
|       |       0x0804a122 in <sqlite_open>
|       |                  at ./src/main.c:494
|       |
|       |       0x0804ad82 in <sqliteBtreeFactory>
|       |                  at ./src/main.c:1134
|       |
|       |       0x0805c202 in <sqliteBtreeOpen>
|       |                  at ./src/btree.c:711
|       |
|       |       0x0806af4d in <sqlitepager_open>
|       |                  at ./src/pager.c:938
|       |
|       |       0x0804b0c3 in <sqliteOsOpenReadWrite>
|       |                  at ./src/os.c:476
|       |
|       |       0x0804aeee in <findLockInfo>
|       |                  at ./src/os.c:320
|       |
|       |       0x08068870 in <sqliteHashInsert>
|       |                  at ./src/hash.c:328
|       |
|       |       0x080684bf in <rehash>
|       |                  at ./src/hash.c:172
|       |
|       |       0x0804dd54 in <sqliteMalloc>
|       |                  at ./src/util.c:254
|       |
|       `-----> 0x080861f2 in <malloc>
|                          at src/wrapper.c:318
|
* 50.0% = 64 Bytes of garbage allocated in 1 allocation
|       | 1 allocated (64 Bytes = 0.1% of total allocated)
|       |
|       @ [
|       |   +0x080ce0e0
|       | ]
|       |
|       |       0x400a314f in <__libc_start_main>
|       |
|       |       0x08049647 in <main>
|       |
|       |       0x0804a122 in <sqlite_open>
|       |                  at ./src/main.c:494
|       |
|       |       0x0804ad82 in <sqliteBtreeFactory>
|       |                  at ./src/main.c:1134
|       |
|       |       0x0805c202 in <sqliteBtreeOpen>
|       |                  at ./src/btree.c:711
|       |
|       |       0x0806af4d in <sqlitepager_open>
|       |                  at ./src/pager.c:938
|       |
|       |       0x0804b0c3 in <sqliteOsOpenReadWrite>
|       |                  at ./src/os.c:476
|       |
|       |       0x0804afc1 in <findLockInfo>
|       |                  at ./src/os.c:343
|       |
|       |       0x08068870 in <sqliteHashInsert>
|       |                  at ./src/hash.c:328
|       |
|       |       0x080684bf in <rehash>
|       |                  at ./src/hash.c:172
|       |
|       |       0x0804dd54 in <sqliteMalloc>
|       |                  at ./src/util.c:254
|       |
|       `-----> 0x080861f2 in <malloc>
|                          at src/wrapper.c:318
|
`------------------------------------------------------


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to