Ticket #2127 (closed enhancement: fixed)

Opened 5 months ago

Last modified 5 months ago

Replace DNS resolver mutex with group lock

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.8
Component: pjlib-util Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no


Currently the resolver releases the mutex when invoking callback, which may cause crash in these scenarios:

  • destroy from within callback context,
  • destroy while callback is being executed (from any context).

The crash can be avoided by replacing the mutex with group lock (thanks to reference counter functionality provided by the group lock).

Also note that the resolver docs recommends to destroy-recreate the resolver to overcome growing memory problem (see section "Resolver Limitations" in here). With the potential crash scenarios described above, it may not be a simple task for application to destroy the resolver without stopping ioqueue & timer first.

Change History

comment:1 Changed 5 months ago by nanang

  • Status changed from new to closed
  • Resolution set to fixed

In 5826:

Close #2127: Replaced DNS resolver mutex with group lock.

Note: See TracTickets for help on using tickets.