Files
389-ds-base/jemalloc-5.3.0_throw_bad_alloc.patch
Viktor Ashirov 6a9fe72ef8 Fix broken FreeIPA upgrade and replication issues
- Resolves: rhbz#2424132 Upgrade from freeipa-4.12.5-3 and 390-ds-base-3.1.3-10 to latest rawhide fails
- Fix jemalloc compilation issue with GCC 15
- Issue 7096 - During replication online total init the function idl_id_is_in_idlist is not scaling with large database
- Issue 7118 - Revise paged result search locking
- Issue 7108 - Fix shutdown crash in entry cache destruction

Use correct tarball from upstream.
2026-01-09 18:48:11 +01:00

42 lines
1.9 KiB
Diff

#commit 3de0c24859f4413bf03448249078169bb50bda0f
#Author: divanorama <divanorama@gmail.com>
#Date: Thu Sep 29 23:35:59 2022 +0200
#
# Disable builtin malloc in tests
#
# With `--with-jemalloc-prefix=` and without `-fno-builtin` or `-O1` both clang and gcc may optimize out `malloc` calls
# whose result is unused. Comparing result to NULL also doesn't necessarily count as being used.
#
# This won't be a problem in most client programs as this only concerns really unused pointers, but in
# tests it's important to actually execute allocations.
# `-fno-builtin` should disable this optimization for both gcc and clang, and applying it only to tests code shouldn't hopefully be an issue.
# Another alternative is to force "use" of result but that'd require more changes and may miss some other optimization-related issues.
#
# This should resolve https://github.com/jemalloc/jemalloc/issues/2091
#
#diff --git a/Makefile.in b/Makefile.in
#index 6809fb29..a964f07e 100644
#--- a/Makefile.in
#+++ b/Makefile.in
#@@ -458,6 +458,8 @@ $(TESTS_OBJS): $(objroot)test/%.$(O): $(srcroot)test/%.c
# $(TESTS_CPP_OBJS): $(objroot)test/%.$(O): $(srcroot)test/%.cpp
# $(TESTS_OBJS): CPPFLAGS += -I$(srcroot)test/include -I$(objroot)test/include
# $(TESTS_CPP_OBJS): CPPFLAGS += -I$(srcroot)test/include -I$(objroot)test/include
#+$(TESTS_OBJS): CFLAGS += -fno-builtin
#+$(TESTS_CPP_OBJS): CPPFLAGS += -fno-builtin
# ifneq ($(IMPORTLIB),$(SO))
# $(CPP_OBJS) $(C_SYM_OBJS) $(C_OBJS) $(C_JET_SYM_OBJS) $(C_JET_OBJS): CPPFLAGS += -DDLLEXPORT
# endif
diff --git a/src/jemalloc_cpp.cpp b/src/jemalloc_cpp.cpp
index fffd6aee..5a682991 100644
--- a/src/jemalloc_cpp.cpp
+++ b/src/jemalloc_cpp.cpp
@@ -93,7 +93,7 @@ handleOOM(std::size_t size, bool nothrow) {
}
if (ptr == nullptr && !nothrow)
- std::__throw_bad_alloc();
+ throw std::bad_alloc();
return ptr;
}