Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Q] MALLOC_HOOKS default mode description #5644

Open
hiroyuki-sato opened this issue Sep 1, 2020 · 2 comments
Open

[Q] MALLOC_HOOKS default mode description #5644

hiroyuki-sato opened this issue Sep 1, 2020 · 2 comments

Comments

@hiroyuki-sato
Copy link
Contributor

Hello, Developers.

Could you tell me about the MALLOC_HOOKS description?

The MALLOC_HOOKS description says below.

This is unsafe and off by default,

It seems that this value is on(yes) by default. Does this description correct?

  {"MALLOC_RELOC", "yes",

{"MALLOC_RELOC", "yes",
"Enable installing malloc symbols in the relocation table.\n"
"This is unsafe and off by default, because sometimes glibc\n"
"calls malloc/free without going through the relocation table,\n"
"which would use the original implementation and not ours.",
ucs_offsetof(ucm_global_config_t, enable_malloc_reloc), UCS_CONFIG_TYPE_BOOL},

The default value is zero in this file.

.enable_malloc_reloc = 0,

Best regards

@hiroyuki-sato
Copy link
Contributor Author

It seems that on by default.

Source: 571381c

ucx_info -c
UCX_MEM_MALLOC_RELOC=y
./ucx_info -f
#
# Enable installing malloc symbols in the relocation table.
# This is unsafe and off by default, because sometimes glibc
# calls malloc/free without going through the relocation table,
# which would use the original implementation and not ours.
#
# syntax:    <y|n>
#
UCX_MEM_MALLOC_RELOC=y

@nmorey
Copy link

nmorey commented Jan 13, 2022

This should probably be fixed. I'm getting a deadlock with it enabled:
#0 0x00007f9eef53fc07 in sched_yield () from /lib64/libc.so.6
#1 0x00007f9eed3c320e in ?? () from /usr/lib64/libucm.so.0
#2 0x00007f9eed3c483f in ucm_dlmalloc () from /usr/lib64/libucm.so.0
#3 0x00007f9eed3bc24d in ?? () from /usr/lib64/libucm.so.0
#4 0x00007f9ef056a7f8 in _dl_exception_create_format () from /lib64/ld-linux-x86-64.so.2
#5 0x00007f9ef055e91a in _dl_lookup_symbol_x () from /lib64/ld-linux-x86-64.so.2
#6 0x00007f9eef594561 in do_sym () from /lib64/libc.so.6
#7 0x00007f9eede672c4 in dlsym_doit () from /lib64/libdl.so.2
#8 0x00007f9eef594b4d in _dl_catch_exception () from /lib64/libc.so.6
#9 0x00007f9eef594bcf in _dl_catch_error () from /lib64/libc.so.6
#10 0x00007f9eede678a5 in _dlerror_run () from /lib64/libdl.so.2
#11 0x00007f9eede6732f in dlsym () from /lib64/libdl.so.2
#12 0x00007f9eed3be3e9 in ?? () from /usr/lib64/libucm.so.0
#13 0x00007f9eed3bece7 in ucm_orig_dlsym_sbrk () from /usr/lib64/libucm.so.0
#14 0x00007f9eed3b90f3 in ?? () from /usr/lib64/libucm.so.0
#15 0x00007f9eed3b9169 in ucm_event_dispatch () from /usr/lib64/libucm.so.0
#16 0x00007f9eed3ba546 in ucm_sbrk () from /usr/lib64/libucm.so.0
#17 0x00007f9eed3c4b80 in ucm_dlmalloc () from /usr/lib64/libucm.so.0
#18 0x00007f9eed3bc24d in ?? () from /usr/lib64/libucm.so.0
#19 0x00007f9eed3bb1ae in ?? () from /usr/lib64/libucm.so.0
#20 0x00007f9eed3bcb1c in ucm_malloc_install () from /usr/lib64/libucm.so.0
#21 0x00007f9eed3bab9a in ucm_set_event_handler () from /usr/lib64/libucm.so.0
#22 0x00007f9eee4bca43 in ?? () from /usr/lib64/libucs.so.0
#23 0x00007f9eee4be8fd in ucs_rcache_create () from /usr/lib64/libucs.so.0
#24 0x00007f9eed152593 in uct_ib_md_open_common () from /usr/lib64/ucx/libuct_ib.so.0
#25 0x00007f9eed1585c1 in ?? () from /usr/lib64/ucx/libuct_ib.so.0
#26 0x00007f9eed151e34 in uct_ib_md_open () from /usr/lib64/ucx/libuct_ib.so.0
#27 0x00007f9eed7eca12 in uct_md_open () from /usr/lib64/libuct.so.0
#28 0x00007f9eee6fb84c in ?? () from /usr/lib64/libucp.so.0
#29 0x00007f9eee6fd101 in ucp_init_version () from /usr/lib64/libucp.so.0
#30 0x00007f9eefbbbddd in ucp_init (context_p=, config=, params=0x7ffd30580310) at /usr/include/ucp/api/ucp.h:1913
#31 MPIDI_UCX_mpi_init_hook (rank=rank@entry=0, size=size@entry=1, appnum=appnum@entry=0, tag_bits=tag_bits@entry=0x7ffd30580418, init_comm=init_comm@entry=0x7f9ef0545b60 <MPIR_Comm_direct>) at src/mpid/ch4/netmod/ucx/ucx_init.c:241
#32 0x00007f9eefb9ad6f in MPID_Init (requested=, provided=provided@entry=0x7f9ef054dda0 <MPIR_ThreadInfo>) at src/mpid/ch4/src/ch4_init.c:595
#33 0x00007f9eefa69679 in MPIR_Init_thread (argc=argc@entry=0x7ffd3058093c, argv=argv@entry=0x7ffd30580930, user_required=, provided=provided@entry=0x7ffd305808ac) at src/mpi/init/initthread.c:158
#34 0x00007f9eefa69444 in PMPI_Init (argc=0x7ffd3058093c, argv=0x7ffd30580930) at src/mpi/init/init.c:131
#35 0x0000000000401c62 in ?? ()
#36 0x00007f9eef47e34d in __libc_start_main () from /lib64/libc.so.6
#37 0x000000000040236a in ?? ()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants