[Asterisk-code-review] xmldoc: Allow XML docs to be reloaded. (asterisk[master])

N A asteriskteam at digium.com
Sat Nov 5 08:45:28 CDT 2022


Attention is currently required from: Joshua Colp.

N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/19474 )

Change subject: xmldoc: Allow XML docs to be reloaded.
......................................................................


Patch Set 2:

(1 comment)

File main/xmldoc.c:

https://gerrit.asterisk.org/c/asterisk/+/19474/comment/d317092a_1929b882 
PS2, Line 3014: 	xmldoc_purge_documentation();
> There is an existing comment in the code: […]
I wish the comment elaborated on what changes were envisioned at the time, but I don't see anywhere how references to xmldoc_tree could escape outside of this file, no (e.g. xmldoc_get_node is static). Documentation can be safely reloaded without causing a crash, as long as the list locks are held.
 
The one possible case that may stand out is stuff like here: https://github.com/asterisk/asterisk/blob/38f9000fcbf5f0819b14006c9f5cd5c728a37d8f/main/xmldoc.c#L1253
 
The list lock is held inside xmldoc_get_node, but then it returns the node which _ast_xmldoc_build_syntax uses. In theory there is a small chance of an issue there, since the list lock is released while something in it is being used.
 
I think it could be fixed by simply holding the list lock until _ast_xmldoc_build_syntax returns. I don't see any benefit or need for adding ref counting with just this case.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19474
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I4f265b0e5517e757c5453a0f241201a5788d3a07
Gerrit-Change-Number: 19474
Gerrit-PatchSet: 2
Gerrit-Owner: N A <asterisk at phreaknet.org>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Sat, 05 Nov 2022 13:45:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221105/280e0cd6/attachment.html>


More information about the asterisk-code-review mailing list