Skip to content

Commit

Permalink
Bug 1321093 - Avoid logalloc-replay make check failure when libstdc++…
Browse files Browse the repository at this point in the history
… allocates memory in some static initializer. r=njn

--HG--
extra : rebase_source : 83ef3414b74a5164b8535bdf266075d1076e0437
  • Loading branch information
glandium committed Nov 29, 2016
1 parent 64c4760 commit d1c271f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions memory/replace/logalloc/replay/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ expected_output.log: $(srcdir)/replay.log

check:: $(srcdir)/replay.log expected_output.log
# Test with MALLOC_LOG as a file descriptor number
MALLOC_LOG=1 $(LOGALLOC) ./$(PROGRAM) < $< | $(PYTHON) $(srcdir)/logalloc_munge.py | diff -w - expected_output.log
# We filter out anything happening before the first jemalloc_stats (first
# command in replay.log) because starting with libstdc++ 5, a static
# initializer in the STL allocates memory, which we obviously don't have
# in expected_output.log.
MALLOC_LOG=1 $(LOGALLOC) ./$(PROGRAM) < $< | sed -n '/jemalloc_stats/,$$p' | $(PYTHON) $(srcdir)/logalloc_munge.py | diff -w - expected_output.log
# Test with MALLOC_LOG as a file name
$(RM) test_output.log
MALLOC_LOG=test_output.log $(LOGALLOC) ./$(PROGRAM) < $<
$(PYTHON) $(srcdir)/logalloc_munge.py < test_output.log | diff -w - expected_output.log
sed -n '/jemalloc_stats/,$$p' test_output.log | $(PYTHON) $(srcdir)/logalloc_munge.py | diff -w - expected_output.log

endif
1 change: 1 addition & 0 deletions memory/replace/logalloc/replay/replay.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
1 1 jemalloc_stats()
1 1 malloc(42)=#1
1 1 malloc(24)=#2
2 2 malloc(42)=#1
Expand Down

0 comments on commit d1c271f

Please sign in to comment.