Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 327
    • Issues 327
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 31
    • Merge requests 31
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #32103
Closed
Open
Issue created Oct 16, 2019 by opara@opara🎄Contributor

Subsystem "thread_cleanup" is never called

Subsystems implement the interface of struct subsys_fns_t, with one of the optional function pointers being void (*thread_cleanup)(void). This thread_cleanup function is called for all subsystems by the subsystem manager function void subsystems_thread_cleanup(void), but the subsystems_thread_cleanup function is never called anywhere in the code.

At the moment, the only subsystem to implement the thread_cleanup interface is the crypto subsystem, which uses thread_cleanup for freeing the threadlocal crypto_fast_rng_t, as well as freeing the threadlocal error queue on old versions of OpenSSL. As far as I can tell, this is never run.

I think that the subsystems_thread_cleanup function should be run somewhere in the code, but it's not clear to me how this subsystems_thread_cleanup is expected to be used. It seems like there should also be subsystems_thread_init and thread_init functions as well for initializing threadlocal variables. Right now the crypto subsystem does an "initialize on first use" singleton pattern, but it might be useful to add this initialization interface function so that subsystems have the option of initializing all of their threadlocals in one place.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking