mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

Crash on V3.0.1

Open Denizeri24 opened this issue 11 months ago • 4 comments

I compiled my program as usual but it started to crash;

Image

FreeBSD x64, latest version (14.2-RELEASE) everything updated.

compile flags: -std=gnu++2b -march=native -m64 -static -DNDEBUG -pthread -ffast-math -O2

compiler: clang++19

LIBDIR += -L/usr/local/lib LIBS += -lmimalloc

includes on main.cpp;

#include <mimalloc.h> #include <mimalloc-new-delete.h>

main function start with these;

mi_version(); mi_stats_reset(); mi_option_set(mi_option_allow_large_os_pages , 1); mi_option_set(mi_option_reserve_os_memory, 500'000); // 512 MB

--- update ---

also idk why but I get duplicate linker errors;

Image

no new overrides in sources and another libs.

Denizeri24 avatar Jan 21 '25 18:01 Denizeri24

Thanks!

  • Do you have a repro so I can test ?
  • Otherwise, perhaps you can compile mimalloc in debug mode (-DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON) and see what it says? (this will check for valid pointers etc.)
  • Hmm, I wonder where the link warnings stem from. (Did you compile mimalloc in C++ mode? (-DMI_USE_CXX=ON)). Since you link statically with mimalloc I there is no need I think to include mimalloc-new-delete.h since these are already overridden in the library (and thus the duplicates).

Let me know how it goes

daanx avatar Jan 22 '25 03:01 daanx

Thanks!

  • Do you have a repro so I can test ?
  • Otherwise, perhaps you can compile mimalloc in debug mode (-DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON) and see what it says? (this will check for valid pointers etc.)
  • Hmm, I wonder where the link warnings stem from. (Did you compile mimalloc in C++ mode? (-DMI_USE_CXX=ON)). Since you link statically with mimalloc I there is no need I think to include mimalloc-new-delete.h since these are already overridden in the library (and thus the duplicates).

Let me know how it goes

I fixed duplicate error with building mimalloc directly from source (DMI_USE_CXX = ON, MI_OVERRIDE = OFF) (i manually changed std::malloc / calloc / free to mi_malloc, mi_calloc etc)

so i can build. also crash issue fixed with mimalloc.a with builded MI_OVERRIDE = OFF flag.

before v3, i used mimalloc from freebsd's pkg repo, and i dont get this problems.

Denizeri24 avatar Jan 22 '25 09:01 Denizeri24

is mimalloc support sse3 or multi-optimize-path?

I builded mimalloc_static with intel c++ compiler 2025 with this flags (/MT);

Image

and my program crashing when start;

Image

is that normal? i dont get any problem with original vs2022 sln project (AVX2)

Denizeri24 avatar Jan 23 '25 12:01 Denizeri24

@daanx I'm sorry for not tagging you, I thought github was reporting automatically.

Denizeri24 avatar Jan 24 '25 14:01 Denizeri24