Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
BIND
BIND
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 390
    • Issues 390
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 68
    • Merge Requests 68
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Packages
    • Packages
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • ISC Open Source Projects
  • BINDBIND
  • Issues
  • #1148

Closed
Open
Opened Jul 17, 2019 by Dan Streetman@ddstreet
  • Report abuse
  • New issue
Report abuse New issue

deadlock hangs named

Ubuntu bug: https://bugs.launchpad.net/maas/+bug/1710278

quick summary:

deadlock in bind9 code; thread A runs ns_client_endrequest->dns_view_detach->view_flushanddetach, which includes:

  LOCK(&view->lock);
  if (!RESSHUTDOWN(view))
    dns_resolver_shutdown(view->resolver);

inside dns_resolver_shutdown, for each resolver bucket, it does:

  for (i = 0; i < res->nbuckets; i++) {
    LOCK(&res->buckets[i].lock);

at this point, one of the bucket locks is held, and thread A is blocked holding view->lock, but waiting for the view->resolver->bucket[i].lock.

meanwhile, thread B runs dispatch->validated, and does:

  bucketnum = fctx->bucketnum;
  LOCK(&res->buckets[bucketnum].lock);

then while still holding that lock calls dns_validator_destroy->destroy->dns_view_weakdetach

which does:

  LOCK(&view->lock);

leaving thread A and thread B in a deadlock, with thread A waiting for the buckets[bucketnum].lock that thread B holds, and thread B waiting for the view->lock that thread A holds.

Edited Aug 01, 2019 by Ondřej Surý
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
3
Labels
Bug Medium Resolver
Assign labels
  • View project labels
Reference: isc-projects/bind9#1148