RPM

Comment 9 for bug 934420

Revision history for this message
Jeff Johnson (n3npq) wrote :

This quick-and-dirty hack to map 10x the needed memory avoids the problem:

Index: rpmdb/rpmdb.c
===================================================================
RCS file: /v/rpm/cvs/rpm/rpmdb/rpmdb.c,v
retrieving revision 1.392.2.9
diff -p -u -w -r1.392.2.9 rpmdb.c
--- rpmdb/rpmdb.c 7 Nov 2011 15:33:01 -0000 1.392.2.9
+++ rpmdb/rpmdb.c 21 Feb 2012 16:02:41 -0000
@@ -2081,7 +2081,7 @@ static int rpmmiGet(dbiIndex dbi, DBC *
  vp->flags |= DB_DBT_USERMEM;
  rc = dbiGet(dbi, dbcursor, kp, vp, flags);
  if (rc == DB_BUFFER_SMALL) {
- size_t uhlen = vp->size;
+ size_t uhlen = 10 * vp->size;
      void * uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off);
      if (uh == NULL || uh == (void *)-1)
   fprintf(stderr,

I shall add another DB_SET (to attempt to get the blob size accurately) next.