aboutsummaryrefslogtreecommitdiff
path: root/contrib/jemalloc/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix abort in jemalloc extent coalescing.Marcin Wojtas2020-12-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix error in extent_try_coalesce_impl(), which could cause abort to happen when trying to coalesce extents backwards. The error could happen because of how extent_before_get() function works. This function gets address of previous extent, by subtracting page size from current extent address. If current extent is located at PAGE_SIZE offset, this address resolved to 0x0000. An assertion in rtree_leaf_elm_lookup then caused the running program to abort. This problem was discovered when trying to build world on 32-bit machines with ASLR and PIE enabled. The problem was encountered on armv7 and i386 machines, but most likely other 32-bit architectures are affected as well. While this patch fixes one problem with buildworld on 32-bit platforms with ASLR, the build still fails, however it happens much later and due to lack of memory. The change is aligned with accepted fix in the upstream Jemalloc repository (https://github.com/jemalloc/jemalloc/pull/1973). As it doesn't apply on top of Jemalloc tree, its updated version was eventually merged: https://github.com/jemalloc/jemalloc/pull/2003 PR: 249937 Submitted by: Dawid Gorecki <dgr@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D27025 Notes: svn path=/head/; revision=368756
* Update jemalloc to version 5.2.1Eric van Gyzen2020-04-2324-1112/+4454
| | | | | | | | | | | | | | | | | | | Revert r354606 to restore r354605. Apply one line from jemalloc commit d01b425e5d1e1 in hash_x86_128() to fix the build with gcc, which only allows a fallthrough attribute to appear before a case or default label. Submitted by: jasone in r354605 Discussed with: jasone Reviewed by: bdrewery MFC after: never, due to gcc 4.2.1 Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24522 Notes: svn path=/head/; revision=360233
* jemalloc: pick from upstream: Fix GCC-9.1 warning with macro GET_ARG_NUMERICRyan Libby2019-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pick 2d6d099fed05b1509e81e54458516528bfbbf38d from upstream jemalloc: Fix GCC-9.1 warning with macro GET_ARG_NUMERIC GCC-9.1 reports following error when trying to compile file src/malloc_io.c and with CFLAGS='-Werror' : src/malloc_io.c: In function ‘malloc_vsnprintf’: src/malloc_io.c:369:2: error: case label value exceeds maximum value for type [-Werror] 369 | case '?' | 0x80: \ | ^~~~ src/malloc_io.c:581:5: note: in expansion of macro ‘GET_ARG_NUMERIC’ 581 | GET_ARG_NUMERIC(val, 'p'); | ^~~~~~~~~~~~~~~ ... <snip> cc1: all warnings being treated as errors make: *** [Makefile:388: src/malloc_io.sym.o] Error 1 The warning is reported as by default the type 'char' is 'signed char' and or-ing 0x80 will turn the case label char negative which will be beyond the printable ascii range (0 - 127). The patch fixes this by explicitly casting the 'len' variable as unsigned char' inside the 'switch' statement so that value of expression " '?' | 0x80 " falls within the legal values of the variable 'len'. Discussed with: jasone (maintainer) Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=355975
* Revert r354605: Update jemalloc to version 5.2.1.Jason Evans2019-11-1124-4455/+1113
| | | | | | | Compilation fails for non-llvm-based platforms. Notes: svn path=/head/; revision=354606
* Update jemalloc to version 5.2.1.Jason Evans2019-11-1124-1113/+4455
| | | | Notes: svn path=/head/; revision=354605
* realloc(x, 0) should not return NULL.Konstantin Belousov2019-09-171-15/+0
| | | | | | | | | | | | | | | See http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm#dr_400. Upstream jemalloc issue is opened by emaste at https://github.com/jemalloc/jemalloc/issues/1629. Reviewed by: emaste PR: 240456 Sponsored by: The FreeBSD Foundation MFC after: 1 week DIfferential revision: https://reviews.freebsd.org/D21632 Notes: svn path=/head/; revision=352456
* Pick 57553c3b1a5592dc4c03f3c6831d9b794e523865 from upstream:Edward Tomasz Napierala2018-11-141-2/+3
| | | | | | | | | | | | | | | | | Avoid touching all pages in extent_recycle for debug build. We may have a large number of pages with *zero set (since they are populated on demand). Only check the first page to avoid paging in all of them. This makes it easy to compare performance with and without 'retain:true'. Discussed with: jasone Obtained from: Qi Wang <interwq at gwu dot edu> MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=340430
* Pick 50b473c8839f5408df179bdf6f2b3fd2cf5c3b2f from upstream:Edward Tomasz Napierala2018-11-061-0/+4
| | | | | | | | | | | | | | | | | Set commit properly for FreeBSD w/ overcommit. When overcommit is enabled, commit needs to be set when doing mmap(). The regression was introduced in f80c97e. This fixes 'retain:true'. Discussed with: jasone Obtained from: Qi Wang <interwq at gwu dot edu> MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=340177
* Pick f80c97e477d1b3fe7778c65d9439d673738b4131 from upstream:Edward Tomasz Napierala2018-10-231-0/+25
| | | | | | | | | | | | | | | Rework the way jemalloc uses mmap(2) on FreeBSD. This makes it directly use MAP_EXCL and MAP_ALIGNED() instead of weird workarounds involving mapping at random places and then unmapping parts of them. Discussed with: jasone MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=339655
* Pick 676cdd66792ccb629a978837ea2a066d5db342cc from upstream:Edward Tomasz Napierala2018-10-231-0/+6
| | | | | | | | | | | | | | Disable runtime detection of lazy purging support on FreeBSD. The check doesn't seem to serve any purpose here, and this shaves off three syscalls on binary startup. Discussed by: jasone MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=339654
* Update jemalloc to version 5.1.0.Jason Evans2018-05-1118-1537/+2475
| | | | Notes: svn path=/head/; revision=333477
* Pick 'Remove external linkage for spin_adaptive' from upstream jemallocRyan Libby2017-08-091-4/+0
| | | | | | | | | | | | | Apply the changes from upstream jemalloc 048c6679. This is actually not quite a cherry pick due to makefile difference and because FreeBSD does not carry the msvc project files which were also modified in that commit. Approved by: jasone (maintainer), markj (mentor) Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=322332
* Update jemalloc to 5.0.1.Jason Evans2017-07-039-102/+266
| | | | Notes: svn path=/head/; revision=320623
* Update jemalloc to 5.0.0.Jason Evans2017-06-1535-9308/+10835
| | | | Notes: svn path=/head/; revision=319971
* Update jemalloc to 4.5.0.Jason Evans2017-03-0211-174/+410
| | | | Notes: svn path=/head/; revision=314529
* Update jemalloc to 4.4.0.Jason Evans2016-12-0411-176/+358
| | | | Notes: svn path=/head/; revision=309540
* Update jemalloc to 4.3.1.Jason Evans2016-11-0917-913/+1425
| | | | Notes: svn path=/head/; revision=308473
* Update jemalloc to 4.2.1.Jason Evans2016-06-096-36/+82
| | | | Notes: svn path=/head/; revision=301718
* Update jemalloc to 4.2.0.Jason Evans2016-05-1321-1781/+2467
| | | | Notes: svn path=/head/; revision=299587
* Restore support for decay time of -1 (no decay).Jason Evans2016-03-031-1/+5
| | | | Notes: svn path=/head/; revision=296334
* Add a cast to prevent a compiler warning.Jason Evans2016-03-031-1/+1
| | | | Notes: svn path=/head/; revision=296332
* Update jemalloc to 4.1.0.Jason Evans2016-02-2918-845/+1722
| | | | | | | | | | | | | Add missing Symbol.map entry for __aligned_alloc. Add weak-->strong symbol binding for {malloc_stats_print,mallctl,mallctlnametomib,mallctlbymib} --> {__malloc_stats_print,__mallctl,__mallctlnametomib,__mallctlbymib}. These bindings complete the set necessary to allow applications to replace all malloc-related symbols. Notes: svn path=/head/; revision=296221
* Update jemalloc to version 4.0.4.Jason Evans2015-10-244-19/+52
| | | | Notes: svn path=/head/; revision=289900
* Update jemalloc to 4.0.2.Jason Evans2015-09-227-323/+317
| | | | Notes: svn path=/head/; revision=288090
* Update jemalloc to version 4.0.0.Jason Evans2015-08-1820-3763/+7086
| | | | Notes: svn path=/head/; revision=286866
* Fix known issues which blow up the process after dlopen("libthr.so")Konstantin Belousov2015-01-032-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (or loading a dso linked to libthr.so into process which was not linked against threading library). - Remove libthr interposers of the libc functions, including __error(). Instead, functions calls are indirected through the interposing table, similar to how pthread stubs in libc are already done. Libc by default points either to syscall trampolines or to existing libc implementations. On libthr load, libthr rewrites the pointers to the cancellable implementations already in libthr. The interposition table is separate from pthreads stubs indirection table to not pull pthreads stubs into static binaries. - Postpone the malloc(3) internal mutexes initialization until libthr is loaded. This avoids recursion between calloc(3) and static pthread_mutex_t initialization. - Reinstall signal handlers with wrapper on libthr load. The _rtld_is_dlopened(3) is used to avoid useless calls to sigaction(2) when libthr is statically referenced from the main binary. In the process, fix openat(2), swapcontext(2) and setcontext(2) interposing. The libc symbols were exported at different versions than libthr interposers. Export both libc and libthr versions from libc now, with default set to the higher version from libthr. Remove unused and disconnected swapcontext(3) userspace implementation from libc/gen. No objections from: deischen Tested by: pho, antoine (exp-run) (previous versions) Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=276630
* Update jemalloc to version 3.6.0.Jason Evans2014-03-314-13/+25
| | | | Notes: svn path=/head/; revision=263974
* Update jemalloc to version 3.5.1.Jason Evans2014-02-262-1/+10
| | | | Notes: svn path=/head/; revision=262521
* Update jemalloc to version 3.5.0.Jason Evans2014-01-2317-1323/+2003
| | | | Notes: svn path=/head/; revision=261071
* Update jemalloc to version 3.4.1.Jason Evans2013-10-214-67/+95
| | | | Notes: svn path=/head/; revision=256823
* Update jemalloc to version 3.4.0.Jason Evans2013-06-038-115/+138
| | | | Notes: svn path=/head/; revision=251300
* Import jemalloc 3.3.0. This reduces zeroed memory validation overhead forJason Evans2013-01-248-205/+126
| | | | | | | non-MALLOC_PRODUCTION builds. Notes: svn path=/head/; revision=245868
* Import jemalloc 3.2.0.Jason Evans2012-11-1014-449/+1131
| | | | Notes: svn path=/head/; revision=242844
* Import jemalloc 3.0.0. This fixes memory zeroing bugs that manifested asJason Evans2012-05-122-72/+84
| | | | | | | | jemalloc assertion failures for debug builds, or as calloc() sometimes returning non-zeroed memory for production builds. Notes: svn path=/head/; revision=235322
* Import jemalloc 37b6f95dcd866f51c91488531a2efc3ed4c2b754 (dev branch,Jason Evans2012-05-1013-707/+940
| | | | | | | | prior to 3.0.0 release). This version is likely very close to what will be 3.0.0. Notes: svn path=/head/; revision=235238
* Work around llvm PR 12623, which makes variables declared with .symverDimitry Andric2012-04-241-1/+2
| | | | | | | | | | | | | | sometimes disappear from the resulting object file, if compiled with clang. In particular, this can lead to errors when building world with clang and -g, similar to: /usr/obj/usr/src/tmp/usr/lib/libc.so: undefined reference to `_malloc_options' Reported by: Conrad J. Sabatier <conrads@.no.cox.net> Reviewed by: jasone Notes: svn path=/head/; revision=234658
* Import jemalloc a8f8d7540d66ddee7337db80c92890916e1063ca (dev branch,Jason Evans2012-04-225-105/+64
| | | | | | | | | | | | prior to 3.0.0 release). This fixes several bugs related to memory initialization. Mangle __jemalloc_a0{malloc,calloc,free}() just like all the other library-internal symbols in jemalloc, and adjust the tls allocation code in libc to use the mangled names. Notes: svn path=/head/; revision=234569
* Import jemalloc 606f1fdc3cdbc700717133ca56685313caea24bb (dev branch,Jason Evans2012-04-2111-84/+87
| | | | | | | prior to 3.0.0 release), and mangle internal symbols. Notes: svn path=/head/; revision=234543
* Import jemalloc 9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa (dev branch,Jason Evans2012-04-1722-0/+10521
prior to 3.0.0 release) as contrib/jemalloc, and integrate it into libc. The code being imported by this commit diverged from lib/libc/stdlib/malloc.c in March 2010, which means that a portion of the jemalloc 1.0.0 ChangeLog entries are relevant, as are the entries for all subsequent releases. Notes: svn path=/head/; revision=234370