summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCiaby <ciaby@rhizomatica.org>2015-07-31 14:06:28 +0200
committerCiaby <ciaby@rhizomatica.org>2015-07-31 14:21:19 +0200
commita690bfe93bdbbfabae0825f2b543faa8db5c51a0 (patch)
tree4fa4537d23500052c076adedb613c00a9e8a9689
parent255e7c09f243f61e9381ad7702cbfbe3cd1b9f34 (diff)
Temporary patch from Holger to fix the frequent crashes caused by un-handled paging request.
-rw-r--r--openbsc/src/libcommon/gsm_subscriber_base.c1
-rw-r--r--openbsc/src/libmsc/gsm_subscriber.c17
2 files changed, 17 insertions, 1 deletions
diff --git a/openbsc/src/libcommon/gsm_subscriber_base.c b/openbsc/src/libcommon/gsm_subscriber_base.c
index a455824a3..55bae603c 100644
--- a/openbsc/src/libcommon/gsm_subscriber_base.c
+++ b/openbsc/src/libcommon/gsm_subscriber_base.c
@@ -68,6 +68,7 @@ struct gsm_subscriber *subscr_alloc(void)
static void subscr_free(struct gsm_subscriber *subscr)
{
+ OSMO_ASSERT(!subscr->is_paging);
llist_del(&subscr->entry);
talloc_free(subscr);
}
diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c
index 4559de581..ff77aa5cf 100644
--- a/openbsc/src/libmsc/gsm_subscriber.c
+++ b/openbsc/src/libmsc/gsm_subscriber.c
@@ -33,6 +33,7 @@
#include <openbsc/gsm_subscriber.h>
#include <openbsc/gsm_04_08.h>
+#include <openbsc/osmo_msc.h>
#include <openbsc/debug.h>
#include <openbsc/paging.h>
#include <openbsc/signal.h>
@@ -82,7 +83,21 @@ static int subscr_paging_dispatch(unsigned int hooknum, unsigned int event,
struct gsm_subscriber *subscr = param;
struct paging_signal_data sig_data;
- OSMO_ASSERT(subscr->is_paging);
+ /*
+ * We might receive a timeout or paging response after one
+ * of the systems has already stopped paging and the below
+ * code was executed. In this case just leave early and free
+ * the resources early.
+ * This doesn't need a subscr_put as this should have been
+ * executed when is_paging has been set to 0.
+ */
+ if (!subscr->is_paging) {
+ LOGP(DMM, LOGL_NOTICE, "Unexpected pagign event(%d,%d) for %s\n",
+ hooknum, event, subscr_name(subscr));
+ if (conn)
+ msc_release_connection(conn);
+ return 0;
+ }
/* Inform parts of the system we don't know */
sig_data.subscr = subscr;