How to resolve this problem on stratup?
call stack:
libc.so.6!__GI_raise(int sig) (\data\user00\proc\glibc-2.18\nptl\sysdeps\unix\sysv\linux\raise.c:56) libc.so.6!__GI_abort() (\data\user00\proc\glibc-2.18\stdlib\abort.c:89) _mi_assert_fail(const char * assertion, const char * fname, unsigned int line, const char * func) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\options.c:540) _mi_page_map_register(mi_page_t * page) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\page-map.c:286) mi_arenas_page_alloc_fresh(mi_subproc_t * subproc, size_t slice_count, size_t block_size, size_t block_alignment, mi_arena_t * req_arena, size_t tseq, int numa_node, _Bool commit) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\arena.c:703) mi_arenas_page_regular_alloc(mi_heap_t * heap, size_t slice_count, size_t block_size) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\arena.c:727) _mi_arenas_page_alloc(mi_heap_t * heap, size_t block_size, size_t block_alignment) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\arena.c:766) mi_page_fresh_alloc(mi_heap_t * heap, mi_page_queue_t * pq, size_t block_size, size_t page_alignment) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\page.c:305) mi_page_fresh(mi_heap_t * heap, mi_page_queue_t * pq) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\page.c:335) mi_page_queue_find_free_ex(mi_heap_t * heap, mi_page_queue_t * pq, _Bool first_try) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\page.c:807) mi_find_free_page(mi_heap_t * heap, mi_page_queue_t * pq) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\page.c:848) mi_find_page(mi_heap_t * heap, size_t size, size_t huge_alignment) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\page.c:929) _mi_malloc_generic(mi_heap_t * heap, size_t size, _Bool zero, size_t huge_alignment) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\page.c:965) _mi_page_malloc_zero(mi_heap_t * heap, mi_page_t * page, size_t size, _Bool zero) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\alloc.c:42) mi_heap_malloc_small_zero(mi_heap_t * heap, size_t size, _Bool zero) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\alloc.c:151) _mi_heap_malloc_zero_ex(mi_heap_t * heap, size_t size, _Bool zero, size_t huge_alignment) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\alloc.c:176) _mi_heap_malloc_zero(mi_heap_t * heap, size_t size, _Bool zero) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\alloc.c:200) mi_heap_malloc(mi_heap_t * heap, size_t size) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\alloc.c:204) mi_malloc(size_t size) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\alloc.c:208) libc.so.6!__fopen_internal(const char * filename, const char * mode, int is32) (\data\user00\proc\glibc-2.18\libio\iofopen.c:73) libc.so.6!_IO_new_fopen(const char * filename, const char * mode) (\data\user00\proc\glibc-2.18\libio\iofopen.c:103) libc.so.6!phys_pages_info(const char * format) (\data\user00\proc\glibc-2.18\sysdeps\unix\sysv\linux\getsysstats.c:296) libc.so.6!__get_phys_pages() (\data\user00\proc\glibc-2.18\sysdeps\unix\sysv\linux\getsysstats.c:340) libc.so.6!posix_sysconf(int name) (\data\user00\proc\glibc-2.18\sysdeps\posix\sysconf.c:632) libc.so.6!linux_sysconf(int name) (\data\user00\proc\glibc-2.18\sysdeps\unix\sysv\linux\sysconf.c:145) libc.so.6!__GI___sysconf(int name) (\data\user00\proc\glibc-2.18\sysdeps\unix\sysv\linux\x86_64\sysconf.c:36) _mi_prim_mem_init(mi_os_mem_config_t * config) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\prim\unix\prim.c:154) _mi_os_init() (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\os.c:84) mi_process_init() (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\init.c:714) mi_thread_init() (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\init.c:549) mi_heap_get_default() (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\heap.c:158) _mi_malloc_generic(mi_heap_t * heap, size_t size, _Bool zero, size_t huge_alignment) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\page.c:944) _mi_heap_malloc_zero_ex(mi_heap_t * heap, size_t size, _Bool zero, size_t huge_alignment) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\alloc.c:187) _mi_heap_malloc_zero(mi_heap_t * heap, size_t size, _Bool zero) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\alloc.c:200) mi_heap_malloc(mi_heap_t * heap, size_t size) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\alloc.c:204) mi_malloc(size_t size) (\data\user00\project\lsgame_proj\main\tools\ecsvr\3rd\src\alloc.c:208) libstdc++.so.6!_GLOBAL__sub_I_eh_alloc.cc (未知源:0) ld-linux-x86-64.so.2!call_init(struct link_map * l, int argc, char ** argv, char ** env) (\data\user00\proc\glibc-2.18\elf\dl-init.c:84) ld-linux-x86-64.so.2!call_init(char ** env, char ** argv, int argc, struct link_map * l) (\data\user00\proc\glibc-2.18\elf\dl-init.c:131) ld-linux-x86-64.so.2!_dl_init(struct link_map * main_map, int argc, char ** argv, char ** env) (\data\user00\proc\glibc-2.18\elf\dl-init.c:132) ld-linux-x86-64.so.2!_dl_start_user (未知源:0) [Unknown/Just-In-Time compiled code] (未知源:0)
Thanks for the report.
This is caused by recursive allocation when mimalloc calls sysconf(_SC_PHYS_PAGES); (in src/prim/unix/prim.c:153) (and on your Linux this calls fopen which allocates itself :-( ). If you like you can comment that part out and everything should work (change the line #if defined(_SC_PHYS_PAGES) to #if 0).
However, I would like to fix this so let me know hat exact version of Linux are you using? And what version of mimalloc?
I think this is fixed now in the latest dev, dev2, dev3 -- can you confirm?
I think this is fixed now in the latest
dev,dev2,dev3-- can you confirm?
I am also impacted by this issue in 3.0.8 (CentOS 7 x86_64, GCC 12), and can confirm that it is not present in the latest dev3 (haven't tried other branches)