diff -Nru lmdb-0.9.22/debian/changelog lmdb-0.9.22/debian/changelog --- lmdb-0.9.22/debian/changelog 2018-07-16 18:14:38.000000000 +0000 +++ lmdb-0.9.22/debian/changelog 2019-02-28 15:52:40.000000000 +0000 @@ -1,3 +1,11 @@ +lmdb (0.9.22-1ubuntu0.1) cosmic-proposed; urgency=medium + + * Add ubuntu_01_remove_loose_pg_from_dirty_list_in_freelist_save.diff + * Fixes common crash in Baloo file indexer + * SRU LP: #1812122 + + -- Jonathan Riddell Thu, 28 Feb 2019 15:52:40 +0000 + lmdb (0.9.22-1) unstable; urgency=medium * New upstream version 0.9.22 (Closes: #855688) diff -Nru lmdb-0.9.22/debian/control lmdb-0.9.22/debian/control --- lmdb-0.9.22/debian/control 2018-07-16 18:14:38.000000000 +0000 +++ lmdb-0.9.22/debian/control 2019-02-28 15:52:40.000000000 +0000 @@ -1,7 +1,8 @@ Source: lmdb Section: database Priority: optional -Maintainer: LMDB +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: LMDB Uploaders: Ondřej Surý Build-Depends: debhelper (>= 9), doxygen diff -Nru lmdb-0.9.22/debian/patches/series lmdb-0.9.22/debian/patches/series --- lmdb-0.9.22/debian/patches/series 2018-07-16 18:14:38.000000000 +0000 +++ lmdb-0.9.22/debian/patches/series 2019-02-28 15:52:25.000000000 +0000 @@ -1,2 +1,3 @@ 0001-Debian-quirks-to-make-shared-library-versioned.patch 0002-Make-the-build-reproducible-by-turning-off-HTML_TIME.patch +ubuntu_01_remove_loose_pg_from_dirty_list_in_freelist_save.diff diff -Nru lmdb-0.9.22/debian/patches/ubuntu_01_remove_loose_pg_from_dirty_list_in_freelist_save.diff lmdb-0.9.22/debian/patches/ubuntu_01_remove_loose_pg_from_dirty_list_in_freelist_save.diff --- lmdb-0.9.22/debian/patches/ubuntu_01_remove_loose_pg_from_dirty_list_in_freelist_save.diff 1970-01-01 00:00:00.000000000 +0000 +++ lmdb-0.9.22/debian/patches/ubuntu_01_remove_loose_pg_from_dirty_list_in_freelist_save.diff 2019-02-28 15:52:34.000000000 +0000 @@ -0,0 +1,53 @@ +commit 1ffe472a080fcd3c7dab6e352848703ad7adbe14 +Author: Howard Chu +Date: Fri Jun 22 16:30:13 2018 +0100 + + ITS#8756 remove loose pg from dirty list in freelist_save + +Index: lmdb-0.9.22/libraries/liblmdb/mdb.c +=================================================================== +--- lmdb-0.9.22.orig/libraries/liblmdb/mdb.c ++++ lmdb-0.9.22/libraries/liblmdb/mdb.c +@@ -3094,10 +3094,41 @@ mdb_freelist_save(MDB_txn *txn) + * we may be unable to return them to me_pghead. + */ + MDB_page *mp = txn->mt_loose_pgs; ++ MDB_ID2 *dl = txn->mt_u.dirty_list; ++ unsigned x; + if ((rc = mdb_midl_need(&txn->mt_free_pgs, txn->mt_loose_count)) != 0) + return rc; +- for (; mp; mp = NEXT_LOOSE_PAGE(mp)) ++ for (; mp; mp = NEXT_LOOSE_PAGE(mp)) { + mdb_midl_xappend(txn->mt_free_pgs, mp->mp_pgno); ++ /* must also remove from dirty list */ ++ if (txn->mt_flags & MDB_TXN_WRITEMAP) { ++ for (x=1; x<=dl[0].mid; x++) ++ if (dl[x].mid == mp->mp_pgno) ++ break; ++ mdb_tassert(txn, x <= dl[0].mid); ++ } else { ++ x = mdb_mid2l_search(dl, mp->mp_pgno); ++ mdb_tassert(txn, dl[x].mid == mp->mp_pgno); ++ } ++ dl[x].mptr = NULL; ++ mdb_dpage_free(env, mp); ++ } ++ { ++ /* squash freed slots out of the dirty list */ ++ unsigned y; ++ for (y=1; dl[y].mptr && y <= dl[0].mid; y++); ++ if (y <= dl[0].mid) { ++ for(x=y, y++;;) { ++ while (!dl[y].mptr && y <= dl[0].mid) y++; ++ if (y > dl[0].mid) break; ++ dl[x++] = dl[y++]; ++ } ++ dl[0].mid = x-1; ++ } else { ++ /* all slots freed */ ++ dl[0].mid = 0; ++ } ++ } + txn->mt_loose_pgs = NULL; + txn->mt_loose_count = 0; + }