Go to file
Elliot Ronaghan 5acef864f2 Don't use compact red-black trees with the pgi compiler
Some bug (either in the red-black tree code, or in the pgi compiler) seems to
cause red-black trees to become unbalanced. This issue seems to go away if we
don't use compact red-black trees. Since red-black trees don't seem to be used
much anymore, I opted for what seems to be an easy fix here instead of digging
in and trying to find the root cause of the bug.

Some context in case it's helpful:

I experienced a ton of segfaults while using pgi as Chapel's target compiler
with jemalloc 4.0.4. The little bit of debugging I did pointed me somewhere
deep in red-black tree manipulation, but I didn't get a chance to investigate
further. It looks like 4.2.0 replaced most uses of red-black trees with
pairing-heaps, which seems to avoid whatever bug I was hitting.

However, `make check_unit` was still failing on the rb test, so I figured the
core issue was just being masked. Here's the `make check_unit` failure:

```sh
=== test/unit/rb ===
test_rb_empty: pass
tree_recurse:test/unit/rb.c:90: Failed assertion: (((_Bool) (((uintptr_t) (left_node)->link.rbn_right_red) & ((size_t)1)))) == (false) --> true != false: Node should be black
test_rb_random:test/unit/rb.c:274: Failed assertion: (imbalances) == (0) --> 1 != 0: Tree is unbalanced
tree_recurse:test/unit/rb.c:90: Failed assertion: (((_Bool) (((uintptr_t) (left_node)->link.rbn_right_red) & ((size_t)1)))) == (false) --> true != false: Node should be black
test_rb_random:test/unit/rb.c:274: Failed assertion: (imbalances) == (0) --> 1 != 0: Tree is unbalanced
node_remove:test/unit/rb.c:190: Failed assertion: (imbalances) == (0) --> 2 != 0: Tree is unbalanced
<jemalloc>: test/unit/rb.c:43: Failed assertion: "pathp[-1].cmp < 0"
test/test.sh: line 22: 12926 Aborted
Test harness error
```

While starting to debug I saw the RB_COMPACT option and decided to check if
turning that off resolved the bug. It seems to have fixed it (`make check_unit`
passes and the segfaults under Chapel are gone) so it seems like on okay
work-around. I'd imagine this has performance implications for red-black trees
under pgi, but if they're not going to be used much anymore it's probably not a
big deal.
2016-09-26 11:08:45 -07:00
bin Pass retain and exclude parameters to /pprof/symbol. 2016-01-29 19:59:06 -08:00
build-aux Use AC_CONFIG_AUX_DIR([build-aux]). 2015-11-12 11:23:39 -08:00
doc Change html manual encoding to UTF-8. 2016-09-12 16:44:33 -07:00
include Don't use compact red-black trees with the pgi compiler 2016-09-26 11:08:45 -07:00
msvc Cleanup MSVC project, embed PDB data inside static .lib 2016-04-12 09:50:10 +02:00
src Formatting fixes. 2016-09-26 11:01:59 -07:00
test Work around a weird pgi bug in test/unit/math.c 2016-09-26 11:08:45 -07:00
.autom4te.cfg Disable autom4te cache. 2014-09-02 17:49:29 -07:00
.gitattributes fix git handling of newlines on windows 2014-05-07 18:48:39 -04:00
.gitignore Add MS Visual Studio 2015 support 2016-02-20 10:55:23 -08:00
autogen.sh Move repo contents in jemalloc/ to top level. 2011-03-31 20:36:17 -07:00
ChangeLog Update ChangeLog for 4.2.1. 2016-06-08 10:20:10 -07:00
config.stamp.in Move repo contents in jemalloc/ to top level. 2011-03-31 20:36:17 -07:00
configure.ac Fix a bug in __builtin_unreachable configure check 2016-09-26 10:44:51 -07:00
COPYING Update copyright dates for 2016. 2016-02-28 15:20:40 -08:00
coverage.sh Add test code coverage analysis. 2013-12-06 18:50:51 -08:00
INSTALL Add --with-version. 2016-03-14 20:19:11 -07:00
jemalloc.pc.in Take into account the install suffix that jemalloc was built with in the pkg-config file. 2015-02-13 12:46:19 -08:00
Makefile.in Fix tsd bootstrapping for a0malloc(). 2016-05-07 16:55:36 -07:00
README Update README. 2013-10-20 19:38:19 -07:00

jemalloc is a general purpose malloc(3) implementation that emphasizes
fragmentation avoidance and scalable concurrency support.  jemalloc first came
into use as the FreeBSD libc allocator in 2005, and since then it has found its
way into numerous applications that rely on its predictable behavior.  In 2010
jemalloc development efforts broadened to include developer support features
such as heap profiling, Valgrind integration, and extensive monitoring/tuning
hooks.  Modern jemalloc releases continue to be integrated back into FreeBSD,
and therefore versatility remains critical.  Ongoing development efforts trend
toward making jemalloc among the best allocators for a broad range of demanding
applications, and eliminating/mitigating weaknesses that have practical
repercussions for real world applications.

The COPYING file contains copyright and licensing information.

The INSTALL file contains information on how to configure, build, and install
jemalloc.

The ChangeLog file contains a brief summary of changes for each release.

URL: http://www.canonware.com/jemalloc/