summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-03 11:59:21 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-03 11:59:21 +0200
commit4f7b3595df7707ead424036bc3898f482fb0bd26 (patch)
tree454336d83484c0d3883559b09181e6b90c0dc864
parent32ee7f9840c373bd51761cc5af6a39b261f2e1e1 (diff)
WIP.. avoid a crash that should not happen..zecke/hacks/no-is-paging-assert
I don't see how is_paging is unbalanced.. but it is clearly happening..
-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..2be4cbc96 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;