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

Crash on V3.0.1 #991

Open
Denizeri24 opened this issue Jan 21, 2025 · 4 comments
Open

Crash on V3.0.1 #991

Denizeri24 opened this issue Jan 21, 2025 · 4 comments

Comments

@Denizeri24
Copy link

Denizeri24 commented Jan 21, 2025

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.

@daanx
Copy link
Collaborator

daanx commented Jan 22, 2025

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

@Denizeri24
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

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