[Debian-med-packaging] Bug#914814: spades: FTBFS with jemalloc/experimental

Faidon Liambotis paravoid at debian.org
Sat Jan 5 09:05:38 GMT 2019


tags 914814 - help + patch
thanks

Hi there,

jemalloc (wannabe) maintainer here :) Thanks Adam for filing this!

On Sat, Dec 01, 2018 at 07:34:45AM +0100, Andreas Tille wrote:
> Spades is originally carrying a code copy.  I'm afraid upstream will
> give the advise to use the code they are shipping which we want to
> avoid.  Could you possibly provide some patch which I could use and
> provide to upstream once tested?  Unfortunately I have no idea about
> jemalloc.

It looks like spades is using rallocm(), which was an experimental API
that was deprecated in 3.5.0 in favor of the *allocx variants, and
eventually removed in 4.0. (Debian currently carries 3.6.0, and the
intention is to move to 5.1.0.)

The whole block is a bit odd, as it's trying to grow the allocation
in-place and then fall back to malloc/memcpy/free... which is really
something that the allocator (any allocator!) can just do automatically
with (je_)realloc(). Unfortunately the class' method is already poorly
named as "realloc" and conflicts with a realloc() invocation. While
upstream renaming that method to avoid the conflict would be a trivial
fix, it would be a more invasive patch that I'd be comfortable with to
carry as a Debian patch.

Therefore attached is a patch that addresses this using the je_rallocx
API. It also deals with the deprecation of the stats.cactive statistic
(as of jemalloc 4.0), using the stats.active instead.

The patch should be 3.6.0-compatible as well and can go in anytime and
ahead of a potential jemalloc transition. It is lightly tested (i.e.
builds and runs the test suite).

More broadly, my recommendation to upstream would be to drop the ancient
(and patched?) embedded copy of jemalloc, use up-to-date standard API
interfaces (malloc/realloc) and opportunistically use the jemalloc
allocator when present without any special calls to it other than
perhaps the mallctl stats.

Regards,
Faidon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jemalloc-5-compatibility-fixes.patch
Type: text/x-diff
Size: 2468 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-med-packaging/attachments/20190105/c6e3365b/attachment.patch>


More information about the Debian-med-packaging mailing list