osmo-hlr/src
Vadim Yanitskiy dc17e05e28 src/db.c: fix: make sure the database is properly closed
Thanks to ASAN, it was discovered that some part of heap
is not released on exit:

  ==19736==ERROR: LeakSanitizer: detected memory leaks

  Indirect leak of 94616 byte(s) in 214 object(s) allocated from:
    #0 0x4e05c6  (/home/wmn/osmocom/osmo-hlr/src/osmo-hlr+0x4e05c6)
    #1 0x7f9b01061dc6  (/usr/lib/x86_64-linux-gnu/libsqlite3.so.0+0x33dc6)

  Indirect leak of 1160 byte(s) in 1 object(s) allocated from:
    #0 0x4e097d  (/home/wmn/osmocom/osmo-hlr/src/osmo-hlr+0x4e097d)
    #1 0x7f9b01061d58  (/usr/lib/x86_64-linux-gnu/libsqlite3.so.0+0x33d58)

  SUMMARY: AddressSanitizer: 95776 byte(s) leaked in 215 allocation(s).

After a long investigation, it was figured out that *sqlite never
closes the database* due to 'unfinalized statements or unfinished
backups'.

The problem was in db_bootstrap(), where several statements were
prepared, but not finalized in loop. This was also the reason of
*.db-shm / *.db-wal files remaining after the program is closed,
and the reason of the following message

  db.c:77 (283) recovered 18 frames from WAL file *.db-wal

Let's fix this and stop ignoring the result of sqlite3_close().

Change-Id: Ibe620d7723b1947d4f60f820bd18435ad0193112
Related: OS#3434
2018-07-30 13:35:32 +00:00
..
gsupclient gsup_client: rename gsup_client_* to osmo_gsup_client_* 2018-07-30 13:07:08 +00:00
Makefile.am import gsup_client.c as new libosmo-gsup-client 2018-07-30 13:07:08 +00:00
auc.c fix debug log: put 'deriving 2G from 3G' in proper place 2017-12-20 00:10:34 +01:00
auc.h initial import of osmo-gsup-hlr code so far 2016-04-28 07:18:49 +02:00
ctrl.c db_get_auth_data / db_get_auc: clarify return values 2017-11-29 16:22:29 +00:00
ctrl.h ctrl: completely replace all CTRL commands 2017-10-27 02:35:49 +02:00
db.c src/db.c: fix: make sure the database is properly closed 2018-07-30 13:35:32 +00:00
db.h db_test: don't verify SQLite issued error messages, they might change 2017-11-21 12:33:45 +01:00
db_auc.c db_get_auth_data / db_get_auc: clarify return values 2017-11-29 16:22:29 +00:00
db_bootstrap.sed automatically create db tables on osmo-hlr invocation 2017-10-28 16:49:33 +00:00
db_hlr.c add osmo-hlr-db-tool, program to migrate from osmo-nitb db 2017-10-28 20:34:01 +02:00
dbd_decode_binary.c add osmo-hlr-db-tool, program to migrate from osmo-nitb db 2017-10-28 20:34:01 +02:00
gsup_router.c Major update; Code now supports SAI, LU and ISD transactions 2016-05-03 18:49:27 +02:00
gsup_router.h gsup_router: Use "#pragma once" and add missing #includes 2018-06-24 11:49:16 +02:00
gsup_send.c add gsup_test to catch OS#3231 2018-05-04 16:12:19 +02:00
gsup_server.c gsup_server: Add "priv" pointer and make it point to 'struct hlr' 2018-06-16 20:21:45 +02:00
gsup_server.h gsup_server: Add "priv" pointer and make it point to 'struct hlr' 2018-06-16 20:21:45 +02:00
hlr.c hlr.c: track the use of talloc NULL memory contexts 2018-07-30 04:11:20 +07:00
hlr.h notify GSUP clients when HLR subscriber information changes 2018-04-10 07:57:49 +02:00
hlr_db_tool.c use osmo_init_logging2 2018-04-17 15:07:06 +02:00
hlr_vty.c Add "show gsup-connections" VTY command 2018-06-24 14:06:56 +02:00
hlr_vty.h VTY: Add hlr node and bind ip field 2017-06-01 11:31:39 +02:00
hlr_vty_subscr.c notify GSUP clients when HLR subscriber information changes 2018-04-10 07:57:49 +02:00
hlr_vty_subscr.h implement subscriber vty interface, tests 2017-10-17 00:59:00 +02:00
logging.c fix default logging levels to NOTICE, not DEBUG 2017-10-28 16:49:46 +00:00
logging.h initial import of osmo-gsup-hlr code so far 2016-04-28 07:18:49 +02:00
luop.c move creation of insert subscriber data messages to a common function 2018-05-18 12:18:32 +02:00
luop.h move osmo_gsup_addr_send() declaration from luop.h to gsup_router.h 2018-06-24 11:49:13 +02:00
populate_hlr_db.pl populate_hlr_db.pl: Script to generate a HLR database 2016-05-03 18:51:40 +02:00
rand.h initial import of osmo-gsup-hlr code so far 2016-04-28 07:18:49 +02:00
rand_fake.c initial import of osmo-gsup-hlr code so far 2016-04-28 07:18:49 +02:00
rand_urandom.c initial import of osmo-gsup-hlr code so far 2016-04-28 07:18:49 +02:00