Hello palica,
Thanks a lot for your effort.
It is kind of a weird issue and I never ran into something like that before.
All I know is that ruby as well as neovim emerge fine without jemalloc, i.e. USE=-jemalloc. Rust, which happens to have a jemalloc use flag, too, emerged without issues.
It happens on pure64 as well as on multilib.
The hardware is a NUC6i5-SYK. I haven't experience any issues at all with this thing when it ran Arch Linux, however an internet search revealed that there are bugs and that linux support is not so awesome.
If it happened only in my custom kernel I would blame that but the debian kernel [4.14.12], which is what I used initially, doesn't solve the issue either.
jemalloc-5.0.1:0/2::dev-kit USE=hardned hugepages lazy-lock xmalloc -debug -static-libs -stats
Emerging jemalloc with USE=-hugepages didn't solve the issue. There are a few options left...
EDIT: sorry for lack of markup but it seems I didn't have a JS powered editor