plasma-umass / Mesh

A memory allocator that automatically reduces the memory footprint of C/C++ applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segfault when preloading Mesh

Axel-Naumann opened this issue · comments

Hi,

Preloading Mesh for root.exe from https://github.com/root-project/root/ causes

$ LD_PRELOAD=./bazel-bin/src/libmesh.so root.exe -l -b -q

segfault (1/0xffffffff): in arena? 0

That's with Mesh's master from 1h ago on Ubuntu 20.04.1.

ROOT is using cling and its llvm-jitting and I was guessing that this might cause havoc - but that's not it: Mesh works with cling like a charm!

LD_PRELOADing jemalloc works for ROOT:

$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 root.exe -l -b -q
$

So how would I go about debugging this? Do you have instructions on how to get a Mesh build with debug symbols, are there assertions I should be turning on, etc?

(I bet the CERN LHC experiments' software stacks will love to try this out once we manage to get Mesh to work with ROOT!)

Cheers, Axel.

sorry for the delay here - this sounds exciting! I will look at this in the next few days - I suspect that we're not properly chaining/retaining segfault handlers correctly.

Not sure if that's related but with the latest mesh I get this error in a cppyy setup which is similar to root in many ways:

src/meshable_arena.cc:509:void mesh::MeshableArena::beginMesh(void*, void*, size_t): ASSERTION 'r == 0' FAILED:

I now went back to 78b9b5d where I don't think that I have had this problem.