brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
debug:
(gdb) set solib-search-path ./lib
(gdb) file test
Reading symbols from test...done.
(gdb) core-file test.core
[New pid 39800955 tid 1]
Program terminated with signal SIGSEGV, Segmentation fault.
0 tc_calloc (n=n@entry=34, elem_size=elem_size@entry=8) at src/tcmalloc.cc:1984
1984 size_t elem_size) PERFTOOLS_NOTHROW {
(gdb) f 1
1 0x00000033358c4e04 in emutls_get_address (obj=0x33358e4040 <emutls_v._ZN8tcmalloc11ThreadCache17threadlocal_data_E>) at ../../../../libgcc/emutls.c:159
159 ../../../../libgcc/emutls.c: No such file or directory.
(gdb) f 1
1 0x00000033358c4e04 in emutls_get_address (obj=0x33358e4040 <emutls_v._ZN8tcmalloc11ThreadCache17threadlocal_data_E>) at ../../../../libgcc/emutls.c:159
159 in ../../../../libgcc/emutls.c
(gdb) p list
No symbol "list" in current context.
(gdb) p next
$1 = 1
(gdb) p list
No symbol "list" in current context.
(gdb)
`#include
include <gperftools/tcmalloc.h>
int main() { char ptr = (char )tc_malloc(sizeof(char)); if(ptr){ printf("tcmalloc works failed!\n"); } tc_free(ptr);
}`
Execution issues after cross compilation: ldd test ./test: libtcmalloc.so.9 => /var/data/demo_test/libtcmalloc.so.9 (0x268c1ce000) libc++.so.1 => /lib64/libc++.so.1 (0x268c3d1000) libm.so.3 => /lib64/libm.so.3 (0x268c4c0000) libc.so.4 => /usr/lib/ldqnx-64.so.2 (0x268c11b000) ./test
Process 905670781 (test) terminated SIGSEGV code=1 fltno=11 ip=0000000defa9a868(/var/data/demo_test/libtcmalloc.so.9@calloc+0x0000000000000000) mapaddr=000000000002e868. ref=000000368d29cfc0 Memory fault (core dumped)
debug: (gdb) set solib-search-path ./lib (gdb) file test Reading symbols from test...done. (gdb) core-file test.core [New pid 39800955 tid 1] Program terminated with signal SIGSEGV, Segmentation fault.
0 tc_calloc (n=n@entry=34, elem_size=elem_size@entry=8) at src/tcmalloc.cc:1984
1984 size_t elem_size) PERFTOOLS_NOTHROW { (gdb) f 1
1 0x00000033358c4e04 in emutls_get_address (obj=0x33358e4040 <emutls_v._ZN8tcmalloc11ThreadCache17threadlocal_data_E>) at ../../../../libgcc/emutls.c:159
159 ../../../../libgcc/emutls.c: No such file or directory. (gdb) f 1
1 0x00000033358c4e04 in emutls_get_address (obj=0x33358e4040 <emutls_v._ZN8tcmalloc11ThreadCache17threadlocal_data_E>) at ../../../../libgcc/emutls.c:159
159 in ../../../../libgcc/emutls.c (gdb) p list No symbol "list" in current context. (gdb) p next $1 = 1 (gdb) p list No symbol "list" in current context. (gdb)
why ?
Originally posted by @tangzhiqiang3 in https://github.com/apache/brpc/issues/1979#issuecomment-1720709755