Closed
Description
Hi,
I encountered a crash today, from the hs_err log I see the last java frame is getContextPageOffset0
.
I then used the debug jar and enabled core dump, the stack trace is bellow:
#0 0x00007fc775409387 in raise () from /lib64/libc.so.6
#1 0x00007fc77540aa78 in abort () from /lib64/libc.so.6
#2 0x00007fc776008a66 in tcmalloc::Log(tcmalloc::LogMode, char const*, int, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem) () from /usr/lib64/libtcmalloc.so
#3 0x00007fc775ffd644 in (anonymous namespace)::InvalidFree(void*) () from /usr/lib64/libtcmalloc.so
#4 0x00007fc74eb9f701 in Contexts::getPage(int) ()
The reason is, if libtcmalloc.so.4.4.5
is PR_LOADEDed, the aligned_alloc
is from libc (because libtcmalloc.so.4.4.5 does not have aligned_alloc), while free
is from tcmalloc, then tcmalloc complains about pointer is not allocated by it.
readelf -s -W /usr/lib64/libc-2.26.so|grep aligned_alloc
1261: 000000000007f0e0 9 FUNC WEAK DEFAULT 12 aligned_alloc@@GLIBC_2.16
6011: 000000000007f0e0 9 FUNC WEAK DEFAULT 12 aligned_alloc
readelf -s -W /usr/lib64/libtcmalloc.so.4.4.5|grep aligned_alloc|wc -l
0
java-profiler/ddprof-lib/src/main/cpp/context.cpp
Lines 57 to 68 in 6fa1618
Consider users are free to use any allocator, it's better not to crash. The simplest fix is to replace aligned_alloc
with malloc
.
Any thoughts ?
Thanks.
Metadata
Metadata
Assignees
Labels
No labels