Re: [PATCH STABLE] cext: fix memory leak in phases computation

2021-06-06 Thread Joerg Sonnenberger
On Mon, Jun 07, 2021 at 12:29:20AM +0200, Georges Racinet wrote:
> # HG changeset patch
> # User Georges Racinet 
> # Date 1622935470 -7200
> #  Sun Jun 06 01:24:30 2021 +0200
> # Branch stable
> # Node ID be560b55eb7cfe25c68fb6fab5417fab6688cf84
> # Parent  5ac0f2a8ba7205266a206ad8da89a79173e8efea
> # EXP-Topic memleak-phases
> cext: fix memory leak in phases computation

LGTM.

Joerg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE] cext: fix memory leak in phases computation

2021-06-06 Thread Georges Racinet
On 6/7/21 12:29 AM, Georges Racinet wrote:
> # HG changeset patch
> # User Georges Racinet 
> # Date 1622935470 -7200
> #  Sun Jun 06 01:24:30 2021 +0200
> # Branch stable
> # Node ID be560b55eb7cfe25c68fb6fab5417fab6688cf84
> # Parent  5ac0f2a8ba7205266a206ad8da89a79173e8efea
> # EXP-Topic memleak-phases
> cext: fix memory leak in phases computation

Can also directly be pulled from
https://foss.heptapod.net/octobus/mercurial-devel

Corresponding CI run :
https://foss.heptapod.net/octobus/mercurial-devel/-/pipelines/22818

Thanks!

-- 
Georges Racinet
https://octobus.net, https://about.heptapod.host, https://heptapod.net
GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH STABLE] cext: fix memory leak in phases computation

2021-06-06 Thread Georges Racinet
# HG changeset patch
# User Georges Racinet 
# Date 1622935470 -7200
#  Sun Jun 06 01:24:30 2021 +0200
# Branch stable
# Node ID be560b55eb7cfe25c68fb6fab5417fab6688cf84
# Parent  5ac0f2a8ba7205266a206ad8da89a79173e8efea
# EXP-Topic memleak-phases
cext: fix memory leak in phases computation

Without this a buffer whose size in bytes is the number of
changesets in the repository is leaked each time the repository is
opened and changeset phases are computed.

Impact: the current code in hgwebdir creates a new `localrepository`
instance for each HTTP request. Since any pull or push is made of several
requests, a team of 100 people can easily produce thousands of such
requests per day.

Being a low-level malloc, this leak can't be seen with the gc module and
tools relying on that, but was spotted by valgrind immediately.

Reproduction


  for i in range(cl_args.iterations):
  repo = hg.repository(baseui, repo_path)
  rev = repo.revs(rev).first()
  ctx = repo[rev]

  del ctx
  del repo
  # avoid any pollution by other type of leak
  # (that should be fixed in 5.8)
  repoview._filteredrepotypes.clear()

  gc.collect()

Measurements


Resident Set Size (RSS), taken on a clone of
mozilla-central for performance analysis (440 000
changesets).

before:
  5.8+hg19.5ac0f2a8ba72  1000 iterations: 1606MB
  5.8+hg19.5ac0f2a8ba72 1 iterations: 5723MB
after:
  5.8+hg20.e2084d39e145  1000 iterations:  555MB
  5.8+hg20.e2084d39e145 1 iterations:  555MB
 (double checked, not a copy/paste error)

(e2084d39e14 is the present changeset, before amendment
of the message to add the measurements)

diff -r 5ac0f2a8ba72 -r be560b55eb7c mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c   Thu May 20 14:20:39 2021 -0400
+++ b/mercurial/cext/revlog.c   Sun Jun 06 01:24:30 2021 +0200
@@ -919,6 +919,7 @@
phasesets[i] = NULL;
}
 
+   free(phases);
return Py_BuildValue("nN", len, phasesetsdict);
 
 release:

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


bugzilla weekly report (2021-06-07)

2021-06-06 Thread Octobot
Bug activity report, between 2021-05-31 and 2021-06-07
 * urgent+: 3 bugs
 * unconfirmed: 65 bugs
 * new: 0 bugs
 * closed: 6 bugs
 * need example: 0 bugs
 * new details: 0 bugs
 * active: 18 bugs
 * long inactive: 2 bugs

urgent+
---

Open of urgent or critical bugs.
Found 3 bugs with our query.

 id  summary
--- 
(#6219) mercurial can generate incomplete bundle, corrupting the reposit
(#6220) [hg/python3] pre-tag hook can't fixup arguments anymore 
(#6416) `hg touch`, `hg rewind` and `hg metaedit` create non-identical c

unconfirmed
---

Bugs with status 'unconfirmed'.
Found 65 bugs with our query.

 id  summary
--- 
(#6075) explicit GC on every request make repositories with thousands of
(#6212) monoblue: many help pages illegible due to layout problems  
(#6309) Exception while pushing 
(#6318) hg can`t clone via ssh on win8  
(#6336) Performance Regression on grafting  
(#6340) Occasional "IndexError: revlog out of range" on amends  
(#6345) Rebasing adds unrelated file changes
(#6348) Occasional "depthcache must be warmed before use" errors on push
(#6355) Comparision with None problem in mercurial.obsolete 
(#6377) hg split failure
(#6386) metaedit should trigger evolve --all
(#6387) topic - merge - rebase  
(#6397) Th prompt 'password:' is written to STDERR stream.  
(#6402) test-stdio.py flakiness 
(#6404) split sometimes loses topics
(#6406) Picking a commit with a topic to a wdir without a topic neither 
(#6408) hggit incoming: 'overlaymanifestlog' object has no attribute '_r
(#6414) In-memory rebase does not reactivate bookmark after falling back
(#6417) --per-file does not work when only one file has changed 
(#6420) need ability to use non-native eols in work-files, besides nativ
(#6421) Missing but unneeded merge-tool entries too noisy even for verbo
(#6426) display commit info (branch, topic, …) when prompted by `hg prev
(#6432) SQLite error handling request cmd=evoext_obshashrange_v1
(#6433) duplicated output for `hg next` when ambiguous changesets   
(#6435) In memory rebase drops the topic
(#6437) mercurial5.6 py3 can't access installed modules 
(#6441) Rename topics more easily   
(#6442) prune: add -t --topic   
(#6443) prune: advice for recover   
(#6448) hg-evolve sometimes shows status changes even when the -q / --qu
(#6453) Unknown exception on execute the command "hg pull -u"   
(#6454) Rebase w/ dirty wdir + in-memory merge can lead to data loss
(#6457) Integrity Check Failed  
(#6458) topic information missing in JSON log output
(#6462) Add support for lightweight, unversioned tags   
(#6463) hg commit --amend crashes if committemplate contains "{revset(..
(#6464) largefiles.usercache configuration option is not documented 
(#6465) Provide option to not use largefiles usercache  
(#6467) purge remove files following directory junctions, included desti
(#6468) test-sqlitestore.t is flaky 
(#6470) test-wireproto-exchangev2-shallow.t is flaky
(#6473) __index__.py is generated with str instead of bytes 
(#6474) narrow extention loose it`s page
(#6477) Tracking down the status of `HGMERGE=internal:local hg evolve`  
(#6481) graphlog's graphshorten option produces a confusing graph shape 
(#6484) Blank output from some hg commands  
(#6490) hgweb error on /archive/ without node   
(#6491) Repository in a state where files are erroneously identified as 
(#6494) topic on merged commit changes diff 
(#6495) utf-8 encoding error in hg log --style changelog
(#6497) RFE: hg which command, that identifies where a subcommand is def
(#6498) [evolve] user/username confusion
(#6501) Rebase switches parent order of merge   
(#6502) Hg archive download in a slow manner.   
(#6503) TypeError in 'show work' with topics enabled
(#6505) test-git-interop.t failure  
(#6507)