Skip to content
Snippets Groups Projects

Re: Coverity report Oct 31st, 2024 (Issue #40991)

Merged excurso requested to merge excurso/tor:fix/memleaks-cpuworker into maint-0.4.8
  • Rework of worker threads' start and exit
  • Slight changes in cleanup code

Handles issue #40991

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • excurso resolved all threads

    resolved all threads

  • Ghost User added 1 commit

    added 1 commit

    • 5741967a - Rework of worker threads' start and exit + slight changes in cleanup code

    Compare with previous version

  • Author Contributor

    Switched from temporary mutex to pool->control_lock. Don't know, why I haven't done it previously. Was overloaded that day :laughing:

    The current version also seems to be robust, passes all tests and debug log looks good:

    [debug] threadpool_start_threads(): Starting worker threads...                                                                                    │
    [debug] worker_thread_main(): Worker thread 1/8 has started [TID: 139827143562944].
    [debug] worker_thread_main(): Worker thread 2/8 has started [TID: 139827135170240].
    [debug] worker_thread_main(): Worker thread 3/8 has started [TID: 139827126777536].
    [debug] worker_thread_main(): Worker thread 4/8 has started [TID: 139827118384832].
    [debug] worker_thread_main(): Worker thread 5/8 has started [TID: 139827109992128].
    [debug] worker_thread_main(): Worker thread 6/8 has started [TID: 139827101599424].
    [debug] worker_thread_main(): Worker thread 7/8 has started [TID: 139826753959616].
    [debug] worker_thread_main(): Worker thread 8/8 has started [TID: 139826745566912].
    [debug] threadpool_start_threads(): Starting worker threads finished.
    [debug] threadpool_start_threads(): Signaled the worker threads to enter the work loop.
    [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827143562944].
    [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827135170240].
    [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827118384832].
    [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827126777536].
    [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827109992128].
    [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139827101599424].
    [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139826753959616].
    [debug] worker_thread_main(): Worker thread has entered the work loop [TID: 139826745566912].

    Sent SIGTERM to the tor process here.

    [debug] threadpool_stop_threads(): Signaled worker threads to exit. Waiting for them to exit...
    [debug] worker_thread_main(): Worker thread 1/8 has exited [TID: 139827118384832].
    [debug] worker_thread_main(): Worker thread 2/8 has exited [TID: 139827101599424].
    [debug] worker_thread_main(): Worker thread 3/8 has exited [TID: 139826753959616].
    [debug] worker_thread_main(): Worker thread 4/8 has exited [TID: 139827135170240].
    [debug] worker_thread_main(): Worker thread 5/8 has exited [TID: 139827109992128].
    [debug] worker_thread_main(): Worker thread 6/8 has exited [TID: 139827143562944].
    [debug] worker_thread_main(): Worker thread 7/8 has exited [TID: 139827126777536].
    [debug] worker_thread_main(): Worker thread 8/8 has exited [TID: 139826745566912].
    [debug] threadpool_stop_threads(): All worker threads have exited.
    [debug] threadpool_free_(): Beginning to clean up...
    [debug] threadpool_free_(): Cleanup finished.
  • merged

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading