Segfault with tcmalloc

I have a strange problem since a while now: when I try to compile ART from git source on my computer (Linux Manjaro) against tcmalloc, I get a segmentation fault on start. But when the program is compiled for the AUR package (which basically does the same thing, and also builds against tcmalloc) it doesn’t segfault.

Here’s the the error message from gdb running a debug build:

(gdb) run
Starting program: /home/sguyader/Photo-apps/art-master-debug/ART 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff2460700 (LWP 138683)]
[New Thread 0x7ffff1c5f700 (LWP 138684)]
[New Thread 0x7ffff145e700 (LWP 138685)]

Thread 1 "ART" received signal SIGSEGV, Segmentation fault.
0x00007ffff58a876a in tc_newarray () from /usr/lib/libtcmalloc.so.4
(gdb) bt full
#0  0x00007ffff589870b in tcmalloc::ThreadCache::ReleaseToCentralCache(tcmalloc::ThreadCache::FreeList*, unsigned int, int) ()
    at /usr/lib/libtcmalloc.so.4
#1  0x00007ffff5898a10 in tcmalloc::ThreadCache::Scavenge() () at /usr/lib/libtcmalloc.so.4
#2  0x00005555560a1950 in cJSON_Delete (item=0x5555572ccac0) at /home/sguyader/Sources/art/rtengine/cJSON.c:233
        next = 0x5555572ccb00
#3  0x00005555560a18de in cJSON_Delete (item=0x5555572cc8c0) at /home/sguyader/Sources/art/rtengine/cJSON.c:223
        next = 0x0
#4  0x00005555560a18de in cJSON_Delete (item=0x5555572cc840) at /home/sguyader/Sources/art/rtengine/cJSON.c:223
        next = 0x5555572ccb40
#5  0x00005555560a18de in cJSON_Delete (item=0x5555571c8940) at /home/sguyader/Sources/art/rtengine/cJSON.c:223
        next = 0x0
#6  0x00005555560a18de in cJSON_Delete (item=0x5555571c8880) at /home/sguyader/Sources/art/rtengine/cJSON.c:223
        next = 0x0
#7  0x00005555563df10e in rtengine::CameraConstantsStore::parse_camera_constants_file(Glib::ustring)
    (this=0x55555685aac0 <rtengine::CameraConstantsStore::getInstance()::instance_>, filename_=...)
    at /home/sguyader/Sources/art/rtengine/camconst.cc:789
        filename = 0x555557083840 "/home/sguyader/Photo-apps/art-master-debug/dcraw.json"
        stream = 0x5555570b6000
        bufsize = 114688
        increment = 131072
        datasize = 67520
        ret = 0
        buf = 0x555557262000 ""
        jsroot = 0x5555571c8880
        js = 0x0
#8  0x00005555563df377 in rtengine::CameraConstantsStore::init(Glib::ustring, Glib::ustring)
    (this=0x55555685aac0 <rtengine::CameraConstantsStore::getInstance()::instance_>, baseDir=..., userSettingsDir=...)
    at /home/sguyader/Sources/art/rtengine/camconst.cc:833
        f = {static npos = 18446744073709551615, string_ = "/home/sguyader/Photo-apps/art-master-debug/dcraw.json"}
        i = 0
        builtin_files = 
          {0x55555657846c "dcraw.json", 0x555556578477 "rt.json", 0x55555657847f "camconst.json", 0x55555657848d "cammatrices.json"}
        userFile = {static npos = 18446744073709551615, string_ = "/home/sguyader/Photo-apps/art-master-debug/dcraw.json"}
#9  0x0000555556154d7e in rtengine::_ZN8rtengine4initEPKNS_8SettingsEN4Glib7ustringES4_b._omp_fn.0(void) ()
    at /home/sguyader/Sources/art/rtengine/init.cc:87
        s = 0x555556852fd0 <options+1264>
        baseDir = @0x7fffffffd880: {static npos = 18446744073709551615, string_ = "/home/sguyader/Photo-apps/art-master-debug"}
        userSettingsDir = @0x7fffffffd8a0: {static npos = 18446744073709551615, string_ = "/home/sguyader/.config/ART"}
        loadAll = true
#10 0x00007ffff5207df3 in GOMP_parallel_sections
    (fn=0x555556154c39 <rtengine::_ZN8rtengine4initEPKNS_8SettingsEN4Glib7ustringES4_b._omp_fn.0(void)>, data=0x7fffffffd740, num_threads=4, count=7, flags=0) at /build/gcc/src/gcc/libgomp/sections.c:235
        team = <optimized out>
#11 0x00005555561549f1 in rtengine::init(rtengine::Settings const*, Glib::ustring, Glib::ustring, bool)
    (s=0x555556852fd0 <options+1264>, baseDir=..., userSettingsDir=..., loadAll=true) at /home/sguyader/Sources/art/rtengine/init.cc:52
#12 0x0000555555ed2f90 in Options::load(bool, int) (lightweight=false, verbose=-1) at /home/sguyader/Sources/art/rtgui/options.cc:2467
        path = 0x0
        dPath = {static npos = 18446744073709551615, string_ = ""}
        defaultTranslation = {static npos = 18446744073709551615, string_ = "/home/sguyader/Photo-apps/art-master-debug/languages/default"}
        languageTranslation = {static npos = 18446744073709551615, string_ = "/home/sguyader/Photo-apps/art-master-debug/languages/English"}
        localeTranslation = 
          {static npos = 18446744073709551615, string_ = "/home/sguyader/Photo-apps/art-master-debug/languages/English (US)"}
#13 0x0000555555e85b93 in main(int, char**) (argc=1, argv=0x7fffffffdda8) at /home/sguyader/Sources/art/rtgui/main.cc:520
        exname = "/home/sguyader/Photo-apps/art-master-debug/ART", '\000' <repeats 465 times>
        exePath = {static npos = 18446744073709551615, string_ = "/home/sguyader/Photo-apps/art-master-debug"}
        fatalError = {static npos = 18446744073709551615, string_ = ""}
        ret = 32767

Any idea what’s going on?