<p>pespin <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/mncc-python/+/21341">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  laforge: Looks good to me, approved
  pespin: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">main: generate coredump and exit upon SIGABRT received<br><br>Previous code relied on abort() switching sigaction to SIG_FDL +<br>retriggering SIGABRT in case the signal handler returns, which would<br>then generate the coredump + terminate the process.<br>However, if a SIGABRT is received from somewhere else (kill -SIGABRT),<br>then the process would print the talloc report and continue running,<br>which is not desired.<br><br>Fixes: OS#4865<br>Change-Id: I3caa78e6ce7c9a98b0a26fde61468bd7b38c6fd9<br>---<br>M rtpsource/rtpsource.c<br>1 file changed, 10 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/rtpsource/rtpsource.c b/rtpsource/rtpsource.c</span><br><span>index d5ffce5..d966a4f 100644</span><br><span>--- a/rtpsource/rtpsource.c</span><br><span>+++ b/rtpsource/rtpsource.c</span><br><span>@@ -198,8 +198,16 @@</span><br><span> {</span><br><span>     switch (signal) {</span><br><span>    case SIGABRT:</span><br><span style="color: hsl(0, 100%, 40%);">-           /* in case of abort, we want to obtain a talloc report</span><br><span style="color: hsl(0, 100%, 40%);">-           * and then return to the caller, who will abort the process */</span><br><span style="color: hsl(120, 100%, 40%);">+               /* in case of abort, we want to obtain a talloc report and</span><br><span style="color: hsl(120, 100%, 40%);">+             * then run default SIGABRT handler, who will generate coredump</span><br><span style="color: hsl(120, 100%, 40%);">+                * and abort the process. abort() should do this for us after we</span><br><span style="color: hsl(120, 100%, 40%);">+               * return, but program wouldn't exit if an external SIGABRT is</span><br><span style="color: hsl(120, 100%, 40%);">+             * received.</span><br><span style="color: hsl(120, 100%, 40%);">+           */</span><br><span style="color: hsl(120, 100%, 40%);">+           talloc_report_full(g_tall_ctx, stderr);</span><br><span style="color: hsl(120, 100%, 40%);">+               signal(SIGABRT, SIG_DFL);</span><br><span style="color: hsl(120, 100%, 40%);">+             raise(SIGABRT);</span><br><span style="color: hsl(120, 100%, 40%);">+               break;</span><br><span>       case SIGUSR1:</span><br><span>                talloc_report_full(g_tall_ctx, stderr);</span><br><span>              break;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/mncc-python/+/21341">change 21341</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/c/mncc-python/+/21341"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: mncc-python </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I3caa78e6ce7c9a98b0a26fde61468bd7b38c6fd9 </div>
<div style="display:none"> Gerrit-Change-Number: 21341 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>