diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-03-29 18:36:30 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-03-29 18:51:28 +0100 |
commit | d01c7b98b63dfda1e72e289eccd7a384c658069f (patch) | |
tree | b3ef413b8c3b29baab3671dfca5b766e7d976b6d | |
parent | 158ea5bc6604122071a7d18f085eecb062057d56 (diff) |
osmo-trx: Avoid handling signals after shutdown triggered
Recently a blocked osmo-trx process was found after ending SIGTERM to
it.
Apparently one thread was handling SIGTERM and calling fprintf()
(grabbing libc lock) while another thread was handling another signal
and also grabbing similar lock. Both thread looked deadlocked there.
Probably this change doesn't fix the block on its own, but at least
simplifies scenarios inside signal ctx which can go wrong.
Change-Id: If91621913b8b03d8a0f4c863be0b0d479f97e8a1
-rw-r--r-- | Transceiver52M/osmo-trx.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 1f35cd8..0141810 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -164,6 +164,12 @@ int makeTransceiver(struct trx_ctx *trx, RadioInterface *radio) static void sig_handler(int signo) { + + if (gshutdown) + /* We are in the middle of shutdown process, avoid any kind of extra + action like printing */ + return; + fprintf(stdout, "signal %d received\n", signo); switch (signo) { case SIGINT: |