diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-12-27 20:10:24 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-12-27 20:20:55 +0100 |
commit | 900394acf3564066571bc83cf9419037fa0fa003 (patch) | |
tree | cd2b4bec78e4d4eca2b55eb53e89d830c0aa4b40 /openbsc/tests/channel | |
parent | b1d71d42679d0ffad3859ceaeead3a2b49208fbb (diff) |
db: Avoid crash we have seen with the dbi code when reading a SMS
Avoid a crash when reading a SMS and a Subscriber could not be resolved.
It is not clear why the read was failing. The sender_id and the receiver_id
was valid for the given sms. I assume that the database has been locked
due external access to it.
The side-effect is that in case of such a failure the sms_queue will start
to deliver starting from subscriber id = 0 again.
#1 0x0000000000428bec in sms_from_result (net=0x156a270, result=0x15eda30) at db.c:1146
#2 0x000000000042a8e0 in db_sms_get_unsent_by_subscr (net=0x156a270,
min_subscr_id=<optimized out>, failed=<optimized out>) at db.c:1255
#3 0x000000000042e900 in take_next_sms (smsq=<optimized out>) at sms_queue.c:193
#4 sms_submit_pending (_data=0x158e300) at sms_queue.c:227
#5 0x00007f3fd30de3bc in osmo_timers_update () at timer.c:243
#6 0x00007f3fd30de69b in osmo_select_main (polling=0) at select.c:133
#7 0x0000000000406fbc in main (argc=9, argv=<optimized out>) at bsc_hack.c:346
(gdb) frame 1
#1 0x0000000000428bec in sms_from_result (net=0x156a270, result=0x15eda30) at db.c:1146
1146 strncpy(sms->src.addr, sms->sender->extension, sizeof(sms->src.addr)-1);
(gdb) p *sms
(gdb) p sms->sender
$1 = (struct gsm_subscriber *) 0x0
(gdb) p sender_id
$2 = <optimized out>
Diffstat (limited to 'openbsc/tests/channel')
-rw-r--r-- | openbsc/tests/channel/channel_test.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index ab0d9eb0b..e9badadb2 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -85,6 +85,7 @@ int main(int argc, char **argv) void _abis_nm_sendmsg() {} void sms_alloc() {} +void sms_free() {} void gsm_net_update_ctype(struct gsm_network *network) {} void gsm48_secure_channel() {} void paging_request_stop() {} |