#27383 closed defect (implemented)

Resolve memory leaks in NSS unit tests

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: 0.3.5.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: #27387 Points:
Reviewer: asn Sponsor:

Description

These leaks seem to be caused by the way that the unit tests fork and reinitialize NSS: they don't appear to affect Tor itself. That said, we'll need to get rid of them, to make sure that we're able to find real memory leaks.

One possibility here is to refactor our test harness so that NSS initialization happens only in subprocesses, and so that forking *always* happens. I'm not sure I like that, but most other things I have tried seem to fail.

Tor itself doesn't have these leaks.

Child Tickets

Change History (6)

comment:1 Changed 16 months ago by nickm

Parent ID: #26631#27387

No, I've figured it out. The last pieces are fixed in my WIP branch nss_tls_fixes. See parent.

comment:2 Changed 16 months ago by nickm

Status: newneeds_review

comment:3 in reply to:  1 Changed 16 months ago by cyberpunks

Replying to nickm:

No, I've figured it out. The last pieces are fixed in my WIP branch nss_tls_fixes.

Where is that branch? I can't find that name on github or on tpo.

See parent.

#27387 doesn't mention details of what you figured out specifically, what did you mean?

comment:4 Changed 15 months ago by asn

Reviewer: asn

comment:5 Changed 15 months ago by nickm

That branch should be online. The two key items were 72548c5018426e30d84f7783d1773694f6cbb0ea and dc789256c18ae38ba0e09073b1885b15d67fa781. The critical insight was that you can't shutdown and restart NSS if any reference to a slot is held.

Less crashy leaks were fixed in 1a66f2bfa67adf278a3d2873507b3baa1395d812 and
9795d65552a4b5f057003d75381ce26ce42ea0b6.

This is part of the nss stuff that ahf already reviewed.

comment:6 Changed 15 months ago by nickm

Resolution: implemented
Status: needs_reviewclosed

(merged)

Note: See TracTickets for help on using tickets.