[pacman-dev] [PATCH] pacman: don't die on "up to date" databases
http://frugalware.org/~vmiklos/patches/libpacman-proposed/20051222/up2datedb... $ sudo pacman.static -S cabextract :: Synchronizing package databases... frugalware-current [----------------] 100% 97K 91.5K/s 00:00:01 error: failed to synchronize frugalware-current (database is up to date) extra-current [----------------] 100% 124K 40.0K/s 00:00:03 error: failed to synchronize extra-current (database is up to date) i think here checking if the db was really updated is a feature not an error udv / greetings, VMiklos -- Developer of Frugalware Linux, to make things frugal - http://frugalware.org
Hi, I've started running valgrind over pacman3 and this first patch fixes one of the memleaks that shows up with doing pacman -Q. In this case, pmhandle_t wasn't being properly freed. cheers, Essien Index: lib/libalpm/handle.c =================================================================== RCS file: /home/cvs-pacman/pacman-lib/lib/libalpm/handle.c,v retrieving revision 1.12 diff -u -r1.12 handle.c --- lib/libalpm/handle.c 10 Oct 2005 20:41:35 -0000 1.12 +++ lib/libalpm/handle.c 22 Dec 2005 16:17:16 -0000 @@ -84,12 +84,15 @@ } /* free memory */ + db_close(handle->db_local); /*verify no problems, like double free (basically, is this the right way to handle pmdb_t free/close?*/ FREETRANS(handle->trans); FREE(handle->root); FREE(handle->dbpath); + FREE(handle->cachedir); FREE(handle->logfile); FREELIST(handle->dbs_sync); FREELIST(handle->noupgrade); + FREELIST(handle->noextract); FREELIST(handle->ignorepkg); free(handle);
PS: this is my first patch, so please anything i need to know to make subsequent patches more usefull... let me know thnx :) Essien Ita Essien wrote:
Hi,
I've started running valgrind over pacman3 and this first patch fixes one of the memleaks that shows up with doing pacman -Q. In this case, pmhandle_t wasn't being properly freed.
cheers, Essien
------------------------------------------------------------------------
Index: lib/libalpm/handle.c =================================================================== RCS file: /home/cvs-pacman/pacman-lib/lib/libalpm/handle.c,v retrieving revision 1.12 diff -u -r1.12 handle.c --- lib/libalpm/handle.c 10 Oct 2005 20:41:35 -0000 1.12 +++ lib/libalpm/handle.c 22 Dec 2005 16:17:16 -0000 @@ -84,12 +84,15 @@ }
/* free memory */ + db_close(handle->db_local); /*verify no problems, like double free (basically, is this the right way to handle pmdb_t free/close?*/ FREETRANS(handle->trans); FREE(handle->root); FREE(handle->dbpath); + FREE(handle->cachedir); FREE(handle->logfile); FREELIST(handle->dbs_sync); FREELIST(handle->noupgrade); + FREELIST(handle->noextract); FREELIST(handle->ignorepkg); free(handle);
------------------------------------------------------------------------
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://www.archlinux.org/mailman/listinfo/pacman-dev
Applied, without the db_close call, as already pointed out by VMiklos. Thanks -- Aurelien Essien Ita Essien wrote:
PS: this is my first patch, so please anything i need to know to make subsequent patches more usefull... let me know
thnx :)
Applied, without the db_close call, as already mentionned by VMiklos. Thansk -- Aurelien
On Thu, Dec 22, 2005 at 05:22:32PM +0100, Essien Ita Essien <essiene@datavibe.net> wrote:
+ db_close(handle->db_local); /*verify no problems, like double free (basically, is this the right way to handle pmdb_t free/close?*/
yes, this is the right way, but this is done in alpm.c, alpm_release() there will be no double free as there is already a check there for preventing this so this one is unnecessary (the others looks good to me) the format (cvs diff -u) is ok, too :) udv / greetings, VMiklos -- Developer of Frugalware Linux, to make things frugal - http://frugalware.org
VMiklos wrote:
On Thu, Dec 22, 2005 at 05:22:32PM +0100, Essien Ita Essien <essiene@datavibe.net> wrote:
+ db_close(handle->db_local); /*verify no problems, like double free (basically, is this the right way to handle pmdb_t free/close?*/
yes, this is the right way, but this is done in alpm.c, alpm_release() there will be no double free as there is already a check there for preventing this
so this one is unnecessary (the others looks good to me)
oh cool.
the format (cvs diff -u) is ok, too :)
bingo!!! :)
udv / greetings, VMiklos
btw, sorry for replying this late... i had to travel, and just got connected back to the net today... so back to hacking ;)
VMiklos wrote:
http://frugalware.org/~vmiklos/patches/libpacman-proposed/20051222/up2datedb...
$ sudo pacman.static -S cabextract :: Synchronizing package databases... frugalware-current [----------------] 100% 97K 91.5K/s 00:00:01 error: failed to synchronize frugalware-current (database is up to date) extra-current [----------------] 100% 124K 40.0K/s 00:00:03 error: failed to synchronize extra-current (database is up to date)
i think here checking if the db was really updated is a feature not an error
udv / greetings, VMiklos
Applied -- Aurelien
participants (3)
-
Aurelien Foret
-
Essien Ita Essien
-
VMiklos