File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- Copyright (c) 2005-2024 Intel Corporation
2+ Copyright (c) 2005-2026 Intel Corporation
3+ Copyright (c) 2026 UXL Foundation Contributors
34
45 Licensed under the Apache License, Version 2.0 (the "License");
56 you may not use this file except in compliance with the License.
@@ -196,7 +197,10 @@ TBBMALLOCPROXY_EXPORT void *PREFIX(calloc)(ZONE_ARG size_t num, size_t size) __T
196197
197198TBBMALLOCPROXY_EXPORT void PREFIX (free)(ZONE_ARG void *object) __THROW
198199{
199- InitOrigPointers ();
200+ // InitOrigPointers() must NOT be called here,
201+ // because it may cause the infinite recursion:
202+ // free() -> InitOrigPointers() -> dlsym() -> free()
203+ // (see issue #1907)
200204 __TBB_malloc_safer_free (object, (void (*)(void *))orig_free);
201205}
202206
@@ -293,7 +297,10 @@ TBBMALLOCPROXY_EXPORT void *__libc_valloc(size_t size) __TBB_ALIAS_ATTR_COPY(val
293297// call original __libc_* to support naive replacement of free via __libc_free etc
294298TBBMALLOCPROXY_EXPORT void __libc_free (void *ptr)
295299{
296- InitOrigPointers ();
300+ // InitOrigPointers() must NOT be called here,
301+ // because it may cause the infinite recursion:
302+ // libc_free() -> InitOrigPointers() -> dlsym() -> libc_free()
303+ // (see issue #1907)
297304 __TBB_malloc_safer_free (ptr, (void (*)(void *))orig_libc_free);
298305}
299306
You can’t perform that action at this time.
0 commit comments