I have following C program
It takes the DB path as argument

For testing, I have placed the DB on a dir over the NFS

Now after the open call, I unshare the NFS from the NFS server to generate I/O 
errors
Once the exec starts receiving errors, it is leaking memory.. after 6 hours, 
its leaking upto 1G



-----vmem.c------
#include<stdio.h>
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include <errno.h>
#include <dirent.h>
#include <sqlite3.h>

cbproc(void *iotemp,
                int  argc,
                char **argv,
                char **colname)
{
return 0;
}


int main(int argc, char* argv[])
{
char dbpath[1024];
void* hdb;
int i,j,k;
char sqlcmd[1024];
char *errmsg = (char *) NULL;
int ret;

        sprintf(sqlcmd, "select * from iotemp ");
        strcpy(dbpath, argv[1]);

for(i=0;i<1;i++) {
ret = sqlite3_open(dbpath, (sqlite3 **) &hdb);
fprintf(stdout, "sqlite3_exec: return value = (%d)\n", ret);
if(ret) {
        fprintf(stderr, "sqlite3_open Error errno=(%d)", errno );
}

fprintf(stdout, "Sleeping for 50 sec\n");
sleep(50);

fprintf(stdout, "Sleeping DONE for 50 sec\n");
while(1) {
ret = sqlite3_exec((sqlite3 *) hdb, sqlcmd, cbproc, NULL, &errmsg );
fprintf(stdout, "sqlite3_exec: return value = (%d)\n", ret);
if(ret) {
        fprintf(stderr, "sqlite3_exec Error errno=(%d) (%s)", errno, errmsg);
} else {
        fprintf(stdout, "sqlite3_exec OK \n");
}
}
}

return 0;
}


      
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to