[asterisk-bugs] [JIRA] (ASTERISK-25455) Deadlock of PJSIP realtime over res_config_pgsql

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Tue Oct 13 11:47:33 CDT 2015


    [ https://issues.asterisk.org/jira/browse/ASTERISK-25455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=227854#comment-227854 ] 

Richard Mudgett commented on ASTERISK-25455:
--------------------------------------------

Thanks for the contribution! If you'd like your contribution to be included faster, you should submit your patch for code review by the Asterisk Developer Community. To do so, please follow the Code Review [1] instructions on the wiki. Be sure to:
* Verify that your patch conforms to the Coding Guidelines [2]
* Review the Code Review Checklist [3] for common items reviewers will look for
* If necessary, provide tests for the Asterisk Test Suite that verify the correctness of your patch [4]
* As this is a new feature, please read the New Feature Guidelines [5]
* Make sure your new feature applies cleanly to Asterisk trunk

When ready, submit your patch and any tests to Review Board [6] for code review.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Code+Review
[2] https://wiki.asterisk.org/wiki/display/AST/Coding+Guidelines
[3] https://wiki.asterisk.org/wiki/display/AST/Code+Review+Checklist
[4] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Test+Suite+Documentation
[5] https://wiki.asterisk.org/wiki/display/AST/New+Feature+Guidelines
[6] https://wiki.asterisk.org/wiki/display/AST/Review+Board+Usage

Since this is a bug fix patch, it should be applied to the v11, v13, and master branches.
https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage#GerritUsage-BranchCherry-Picking

With your patch there is now a deadlock potential between find_table() and unload_module() involving the locking order of the psql_tables list lock and the pgsql_lock.  I think the deadlock potential can be avoided simply by destroying the cached table info after the pgsql_lock is released in unload_module().

> Deadlock of PJSIP realtime over res_config_pgsql 
> -------------------------------------------------
>
>                 Key: ASTERISK-25455
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25455
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_pjsip, Resources/res_config_pgsql, Resources/res_pjsip
>    Affects Versions: 13.5.0, 13.6.0
>         Environment: linux 64bit
> kernel 3.10.17
> distro slackware64 14.1 
>            Reporter: mdu113
>            Assignee: Unassigned
>         Attachments: backtrace-threads2.txt, core-show-locks2.txt, core-show-locks.txt, lock-bt-full.txt, res_config_pgsql.c-connlock.diff
>
>
> Asterisk intermittently deadlocks during initial loading of pjsip endpoints. It seems to depend on number of endpoints loaded. With small number of endpoints (up to a 100) it loads ok most of the time. With several hundreds of endpoints it deadlocks sometimes. With several thousand of endpoints it deadlocks most of the time.
> Attached are backtrace and output of "core show locks". The testing was done on asterisk 13.6.0-rc2



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list