[asterisk-bugs] [JIRA] (ASTERISK-29614) app_agent_pool: XML Doc: unterminated entity reference

Sean Bright (JIRA) noreply at issues.asterisk.org
Wed Sep 1 09:12:34 CDT 2021


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

Sean Bright commented on ASTERISK-29614:
----------------------------------------

bq. 2. I am talking about xmldoc_update_config_type and what follows, especially xmlNodeSetContent. Where in the DOM is that node? And what shall be in that node actually?

The documentation says that it "Update\[s] the XML documentation for a config type based on its registration." Asterisk stores documentation for applications, functions, etc. in an XML document and when something registers itself with the ACO framework it is able to augment that documentation at runtime.

I do not see a call to {{xmlNodeSetContent}} in {{xmldoc_update_config_type()}} (and again, {{xmlNodeSetContent}} is from libxml2, not Asterisk). I feel like your other questions can be determined just by looking at {{xmldoc_update_config_type()}} so I will leave that to you. It's also possible I don't understand your additional questions.

bq. I tested your patch and {{config help show app_agent_pool \[globals|global|general]}}: It changed behavior for what it reacts. I am not sure whether this is intended.

Before my patch:

{noformat}
*CLI> config show help app_agent_pool [globals|global|general]
Unknown configuration type [globals|global|general]
*CLI> config show help app_agent_pool globals
Unknown configuration type globals
*CLI> config show help app_agent_pool global
global: [category =~ /general/]

Unused, but reserved.

*CLI> config show help app_agent_pool general
Unknown configuration type general
{noformat}

And after my patch:

{noformat}
*CLI> config show help app_agent_pool [globals|global|general]
Unknown configuration type [globals|global|general]
*CLI> config show help app_agent_pool globals
Unknown configuration type globals
*CLI> config show help app_agent_pool global
global: [category =~ /^general$/]

Unused, but reserved.

*CLI> config show help app_agent_pool general
Unknown configuration type general
{noformat}

The only difference I see is:

{noformat}
- global: [category =~ /general/]
+ global: [category =~ /^general$/]
{noformat}

Is that what you are referring to? If not, can you be specific about what the differing behavior is you are seeing?

bq. Furthermore, the help text seems not right either.

Can you please be specific about what is not right?

bq. Finally, I do not understand those three alternatives: \[globals|global|general].

I do not know where you are getting that string ({{\[globals|global|general]}}) from.

bq. Sometimes a module uses that, sometimes it uses this. Isn’t there a way that every module reacts on all three alternatives?

What are the "that" and the "this" that you are referring to here?

> app_agent_pool: XML Doc: unterminated entity reference
> ------------------------------------------------------
>
>                 Key: ASTERISK-29614
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29614
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_agent_pool, Applications/app_skel, Documentation
>    Affects Versions: 13.38.3, 16.20.0, 18.6.0, 19.0.0
>         Environment: Ubuntu 18.04 LTS
> ./configure --enable-xmldoc, which is the default
> make all or make full, does not matter
>            Reporter: Alexander Traud
>            Assignee: Unassigned
>            Severity: Major
>
> This issue seems not to be of constant occurrence. Furthermore, I was not able to find any reports about this except several failed builds in Gerrit. Perhaps those are related but I did not investigated those further, yet. 
> Currently, I am able to replicate it quite constant and was able to investigate a bit with GDB. However, I am reporting early in my analysis, perhaps somebody sees the culprit faster.
> *My symptom*:
> {code} Loading app_agent_pool.so.
>   == Manager registered action Agents
>   == Manager registered action AgentLogoff
>   == Registered custom function 'AGENT'
>   == Registered application 'AgentLogin'
>   == Registered application 'AgentRequest'
> error : unterminated entity reference            ���
>   == app_agent_pool.so => (Call center agent pool applications){code}*My call stack*:
> apps/app_agent_pool.c
> ⤷ load_module
>    ⤷ load_config
>       ⤷ aco_info_init
>          ⤷ type = agent_type (the second type from {{app_agent_pool}}, the one after the {{general_type}})
>             ⤷ xmldoc_update_config_type in file main/xml.c
>                ⤷ ast_xml_set_text
>                   ⤷ xmlNodeSetContent
> That error is not printed, when I remove _all_ categories except the terminating NULL, in the file {{apps/app_agent_pool.c}}, in the string array {{agent_type_blacklist}}. That error is not printed, when I comment/disable at least four of the eight {{aco_option_register}} in {{load_config}}.
> This looks like a memory corruption, because even when that error is not printed, on the command-line interface (CLI), I am not able to issue {{xmldoc dump <file>}} when the module {{app_agent_pool}} is loaded. I get errors like {{output error : string is not in UTF-8}} or {{xmlEscapeEntities : char out of range}}.
> *Workarounds*:
> a) {{./configure --disable-xmldoc}} or
> b) disable the module {{app_agent_pool}} via {{make menuselect}} or
> c) noload the module {{app_agent_pool}} via the configuration file {{modules.conf}} or
> d) change the string array {{agent_type_blacklist}} to contain just the terminating {{NULL}} value



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



More information about the asterisk-bugs mailing list