Closed Bug 1104173 Opened 9 years ago Closed 9 years ago

logalloc-replay calls mozjemalloc's jemalloc_stats even when libreplace_jemalloc.so is loaded

Categories

(Core :: Memory Allocator, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: ggp, Assigned: glandium)

References

Details

Attachments

(1 file)

Running:

DYLD_INSERT_LIBRARIES=$(OBJDIR)/dist/lib/libreplace_jemalloc.dylib $(OBJDIR)/memory/replace/logalloc/replay/logalloc-replay < log.munged

directs calls to {m,c,re}alloc() to jemalloc3, as expected, but jemalloc_stats() calls mozjemalloc's jemalloc_stats_impl, resulting in an entirely wrong output.

I attempted to bisect this, and it looks like this regression was introduced by bug 818922.
Blocks: 818922
Bug 818922 made MOZ_REPLACE_MALLOC a global define, and that changed the
defines set when building mozjemalloc_compat.c for the jemalloc3
replace-malloc library. In turn, this made the symbol munging wrong for
that library, making the jemalloc_* functions exported as je_jemalloc_*
instead of replace_jemalloc_*.
Attachment #8528037 - Flags: review?(n.nethercote)
Assignee: nobody → mh+mozilla
Status: NEW → ASSIGNED
Comment on attachment 8528037 [details] [diff] [review]
Properly export jemalloc_* symbols from the jemalloc3 replace-malloc library

Review of attachment 8528037 [details] [diff] [review]:
-----------------------------------------------------------------

rs=me
Attachment #8528037 - Flags: review?(n.nethercote) → review+
Summary: localloc-replay calls mozjemalloc's jemalloc_stats even when libreplace_jemalloc.so is loaded → logalloc-replay calls mozjemalloc's jemalloc_stats even when libreplace_jemalloc.so is loaded
https://hg.mozilla.org/mozilla-central/rev/14214fcdb674
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.