<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/21346">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ipaccess-proxy: 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>Change-Id: Iff920ff3dbeb48bd871b7578470f27fe9d0f9516<br>Fixes: OS#4865<br>---<br>M src/ipaccess/ipaccess-proxy.c<br>1 file changed, 10 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/46/21346/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c</span><br><span>index 47465b4..ca1769d 100644</span><br><span>--- a/src/ipaccess/ipaccess-proxy.c</span><br><span>+++ b/src/ipaccess/ipaccess-proxy.c</span><br><span>@@ -1092,8 +1092,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(tall_bsc_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(tall_bsc_ctx, stderr);</span><br><span>            break;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/21346">change 21346</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/osmo-bsc/+/21346"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Iff920ff3dbeb48bd871b7578470f27fe9d0f9516 </div>
<div style="display:none"> Gerrit-Change-Number: 21346 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>