Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 790767 - dev-libs/boehm-gc: GnuCash crashes with "No more root sets" when importing a large dataset
Summary: dev-libs/boehm-gc: GnuCash crashes with "No more root sets" when importing a ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-05-18 07:07 UTC by Dirk Tilger
Modified: 2023-08-23 01:27 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
The attached patch introduces the USE flag "large" to dev-libs/boehm-gc that sets a larger value for MAX_ROOTS and thus prevents applications like app-office/gnucash from crashing (0001-Enables-boehm-gc-with-large-root-sets.patch,1.76 KB, patch)
2021-05-18 07:07 UTC, Dirk Tilger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Tilger 2021-05-18 07:07:15 UTC
Created attachment 709527 [details, diff]
The attached patch introduces the USE flag "large" to dev-libs/boehm-gc that sets a larger value for MAX_ROOTS and thus prevents applications like app-office/gnucash from crashing

I have a fairly large accounting file that has grown more than 15 years. When exporting that data as "Transactions CSV" and then reimporting them "from CSV", GnuCash crashes when I select the "GnuCash" CSV import preset. More precisely dev-libs/boehm-gc calls "abort" giving the reason "No more root sets" during a garbage collection run.

A hard coded value MAX_ROOTS in dev-libs/boehm-gc defines how many root sets are permissible and the ./configure script option --enable-large-config can set MAX_ROOTS reasonably big, however there is currently no way to enable it in dev-libs/boehm-gc src_configure().

I didn't dig into boehm-gc to find out the rationale for the limit, but I am assuming it is a question of performance and/or memory. The protection thereby is probably for resource limited systems (think embedded). I can't really conjecture a situation where forcefully failing garbage collection with SIGABRT is better than just waiting a little bit longer and potentially have big amounts of memory freed. There might be, though.

The attached patch enables "large config" by default for dev-libs/boehm-gc unless disabled by USE=-large. If a more conservative solution would be required, I could think of these two alternatives:

* Setting REQUIRE_USE to allow "large" only on machine architectures that are more likely not resource constrained (i.e. x86 and amd64, but not arm).
* Setting IUSE=large (thus it being not enabled by default), but then depending on dev-libs/boehm-gc[large] from applications that crash with "No more root sets" such as app-office/gnucash
Comment 1 Ionen Wolkens gentoo-dev 2021-05-19 21:34:54 UTC
Just-in-case it matters, could you provide output of:

  emerge --info app-office/gnucash dev-libs/boehm-gc

(tentatively assigned to boehm-gc because of the patch)
Comment 2 Larry the Git Cow gentoo-dev 2021-05-19 22:51:43 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef0c9d87d21dc75b7a698755b00aa5f2969715c7

commit ef0c9d87d21dc75b7a698755b00aa5f2969715c7
Author:     Dirk Tilger <dirk@systemication.com>
AuthorDate: 2021-05-18 02:37:31 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2021-05-19 22:51:40 +0000

    dev-libs/boehm-gc: Enables boehm-gc with large root sets
    
    This disables the 'No more root sets' error message for programs dealing
    with large datasets (i.e. GnuCash data import)
    
    Bug: https://bugs.gentoo.org/790767
    Signed-off-by: Dirk Tilger <dirk@systemication.com>
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 dev-libs/boehm-gc/boehm-gc-8.0.4.ebuild |  3 ++-
 dev-libs/boehm-gc/metadata.xml          | 11 +++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2021-05-19 23:00:29 UTC
I pulled your patch almost as is with minor changes around metadata declaration. I think it's useful on it's own.

Glancing at code around LARGE_CONFIG it looks like a limitation of boehm-gc of not being able to handle large amount of root pointers. I wonder if it means that app-office/gnucash should change strategy of exposing reachable GC pointers to boehm-gc via APIs other than individual GC roots (via single indirect data structure).
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2023-08-23 01:27:45 UTC
Nothing to do here anymore.