<p>Richard Mudgett <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/8390">View Change</a></p><p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p>(11 comments)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/8390/1/include/asterisk/module.h">File include/asterisk/module.h:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/include/asterisk/module.h@295">Patch Set #1, Line 295:</a> <code style="font-family:monospace,monospace">       AST_MODPRI_CORE =               40,  /*!< A core module originally meant to start between preload and load. */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Does this need it's own different priority value?</p></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/8390/1/main/Makefile">File main/Makefile:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/main/Makefile@21">Patch Set #1, Line 21:</a> <code style="font-family:monospace,monospace"># Allow deletion of built-in modules without needing to modify this source.</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">deletion?<br>Should that be addition?</p></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/8390/1/main/asterisk.c">File main/asterisk.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/main/asterisk.c@4548">Patch Set #1, Line 4548:</a> <code style="font-family:monospace,monospace">  check_init(ast_cc_init(), "Call Completion Supplementary Services");</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Call completion reads the ccss.conf file so it needs to be a built in module too.</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_cc_init() calls initialize_cc_devstate_map() which reads ccss.conf.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/main/asterisk.c@4550">Patch Set #1, Line 4550:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">     /* We should avoid most config loads before this point as they can't use realtime. */<br>     check_init(load_modules(1), "Module Preload");<br><br>    /* Load remaining modules */<br>  check_init(load_modules(0), "Module");<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Is there any need for two module loads now?  Or does this still need to be done to sort of force other modules to load/start earlier?</p></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/8390/1/main/cel.c">File main/cel.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/main/cel.c@1568">Patch Set #1, Line 1568:</a> <code style="font-family:monospace,monospace">            return AST_MODULE_LOAD_FAILURE;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">We should still be calling cel_engine_cleanup() i.e. unload_module() before exiting with failure.</p></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/8390/1/main/dsp.c">File main/dsp.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/main/dsp.c@2407">Patch Set #1, Line 2407:</a> <code style="font-family:monospace,monospace">     int res = _dsp_init(0);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">We should return early if res is nonzero rather than possibly registering the test commands.  Or we could simply eliminate res:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">if (_dsp_init(0) {<br>   return AST_MODULE_LOAD_FAILURE;<br>}</pre><p style="white-space: pre-wrap; word-wrap: break-word;">AST_TEST_REGISTER...</p><p style="white-space: pre-wrap; word-wrap: break-word;">return AST_MODULE_LOAD_SUCCESS;</p></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/8390/1/main/features.c">File main/features.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/main/features.c@1168">Patch Set #1, Line 1168:</a> <code style="font-family:monospace,monospace">    return res ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">We should be calling unload_module() if res is nonzero to cleanup on failure.</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">if (res) {<br>   unload_module();<br>   return AST_MODULE_LOAD_FAILURE;<br>}<br>return AST_MODULE_LOAD_SUCCESS;</pre></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/8390/1/main/indications.c">File main/indications.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/main/indications.c@1141">Patch Set #1, Line 1141:</a> <code style="font-family:monospace,monospace">                return AST_MODULE_LOAD_FAILURE;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">We still should call indications_shutdown()/unload_module() here.</p></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/8390/1/main/loader.c">File main/loader.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/main/loader.c@509">Patch Set #1, Line 509:</a> <code style="font-family:monospace,monospace">              mod = ast_calloc(1, sizeof(*mod) + strlen(info->name) + 1);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This is going to get called before MALLOC_DEBUG/astmm.c has initialized for the built-in modules.</p><p style="white-space: pre-wrap; word-wrap: break-word;">We will have to use ast_std_calloc()/ast_std_free() for these specific allocations.  My always use MALLOC_DEBUG patch makes the ast_calloc() function check and ast_log() allocation failures which uses the logger system that hasn't been initialized yet either.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/main/loader.c@1459">Patch Set #1, Line 1459:</a> <code style="font-family:monospace,monospace">                    /* Built-in modules cannot be unloaded. */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">s/be unloaded/be manually unloaded/</p></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/8390/1/res/res_config_sqlite.c">File res/res_config_sqlite.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8390/1/res/res_config_sqlite.c@1780">Patch Set #1, Line 1780:</a> <code style="font-family:monospace,monospace"> .requires = "cdr",</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Should it be extconfig?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/8390">change 8390</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8390"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f </div>
<div style="display:none"> Gerrit-Change-Number: 8390 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 08 Mar 2018 00:14:09 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>