<p>Patch set 4:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10330">View Change</a></p><p>9 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10330/4//COMMIT_MSG">Commit Message:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10330/4//COMMIT_MSG@21">Patch Set #4, Line 21:</a> <code style="font-family:monospace,monospace">Module load/start errors are delayed until the end the loader startup.</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">s/the end the/the end of/</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10330/4/main/loader.c">File main/loader.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10330/4/main/loader.c@144">Patch Set #4, Line 144:</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;">#define STR_APPEND_TEXT(txt, str) \<br>        ast_str_append(&str, 0, "%s%s", \<br>               ast_str_strlen(str) > 0 ? ", " : "", \<br>         txt)<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">str must be used as a pointer pointer<br>struct ast_str **str</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_str_append(str, ...)<br>ast_str_strlen(*str)...</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10330/4/main/loader.c@156">Patch Set #4, Line 156:</a> <code style="font-family:monospace,monospace">#define module_load_error(fmt, ...) \</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Looks like the previous function attribute was wrong:</p><p style="white-space: pre-wrap; word-wrap: break-word;">static __attribute__((format(printf, 1, 0))) void module_load_error(const char *fmt, ...)</p><p style="white-space: pre-wrap; word-wrap: break-word;">should have been:</p><p style="white-space: pre-wrap; word-wrap: break-word;">static __attribute__((format(printf, 1, 2))) void module_load_error(const char *fmt, ...)</p><p style="white-space: pre-wrap; word-wrap: break-word;"><br>That and there was a nominal return path that didn't do a va_end().</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10330/4/main/loader.c@903">Patch Set #4, Line 903:</a> <code style="font-family:monospace,monospace">static int load_dlopen_missing(struct ast_str *list, struct ast_vector_string *deps)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">list must be passed as a pointer pointer<br>struct ast_str **list</p><p style="white-space: pre-wrap; word-wrap: break-word;">Otherwise when STR_APPEND_TEXT increases the list size the caller will have a stale pointer to list that it cannot free.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10330/4/main/loader.c@969">Patch Set #4, Line 969:</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;">                        resource_being_loaded = NULL;<br>                 module_load_error("Error loading module '%s': %s\n", resource_in, dlerror_msg);<br><br>                   goto error_return;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Don't we need to logged_dlclose() here if mod->lib?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10330/4/main/loader.c@981">Patch Set #4, Line 981:</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;">                       c = load_dlopen_missing(list, &mod->requires);<br>                 c += load_dlopen_missing(list, &mod->enhances);<br>#ifndef OPTIONAL_API<br>                  c += load_dlopen_missing(list, &mod->optional_modules);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">pass list as<br>&list</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10330/4/main/loader.c@1810">Patch Set #4, Line 1810:</a> <code style="font-family:monospace,monospace">         AST_VECTOR_CALLBACK_VOID(&localdeps, STR_APPEND_TEXT, printmissing);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Pass &printmissing</p><p style="white-space: pre-wrap; word-wrap: break-word;">or assign *printmissing_ptr = printmissing earlier and use printmissing_ptr instead.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10330/4/main/loader.c@1863">Patch Set #4, Line 1863:</a> <code style="font-family:monospace,monospace">                                     "This is a bug in the module.\n", ast_module_name(mod));</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">unnecessary extra indention</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10330/4/main/loader.c@1924">Patch Set #4, Line 1924:</a> <code style="font-family:monospace,monospace">                             AST_VECTOR_CALLBACK_VOID(&localdeps, STR_APPEND_TEXT, printmissing);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Pass &printmissing</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10330">change 10330</a>. To unsubscribe, or for help writing mail filters, 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/10330"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I046052c71331c556c09d39f47a3b92975f3e1758 </div>
<div style="display:none"> Gerrit-Change-Number: 10330 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 01 Oct 2018 21:43:09 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>