==13975== Memcheck, a memory error detector ==13975== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==13975== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==13975== Command: tests/sgsn/sgsn_test ==13975== <0012> gprs_llc.c:485 LLC: unknown TLLI 0xc0000234, creating LLME on the fly <000f> gprs_subscriber.c:816 SUBSCR(1234567890) Updating subscriber data <0012> gprs_llc.c:485 LLC: unknown TLLI 0xffeeddcc, creating LLME on the fly <0002> gprs_sgsn.c:237 MM(/00000000) Allocated with GEA0 cipher. <0012> gprs_llc.c:485 LLC: unknown TLLI 0xffeeddcc, creating LLME on the fly <0002> gprs_sgsn.c:237 MM(/00000000) Allocated with GEA0 cipher. <000f> gprs_subscriber.c:714 SUBSCR(1234567890) Received GSUP message OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT <000f> gprs_subscriber.c:239 SUBSCR(1234567890) Got SendAuthenticationInfoResult, num_auth_vectors = 2 <000f> gprs_subscriber.c:251 SUBSCR(1234567890) Adding auth tuple, cksn = 0 <000f> gprs_subscriber.c:251 SUBSCR(1234567890) Adding auth tuple, cksn = 1 <000f> gprs_subscriber.c:828 SUBSCR(1234567890) Updating subscriber authentication info Called my_dummy_sgsn_update_subscriber_data, mmctx = 0x829e560, subscr = 0x829cf00 <000f> gprs_subscriber.c:714 SUBSCR(1234567890) Received GSUP message OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR <000f> gprs_subscriber.c:470 SUBSCR(1234567890) Send authentication info has failed with cause 7, handled as: Permission denied <000f> gprs_subscriber.c:478 SUBSCR(1234567890) GPRS send auth info req failed, access denied, GMM cause = 'GPRS services not allowed' (7) <000f> gprs_subscriber.c:828 SUBSCR(1234567890) Updating subscriber authentication info Called my_dummy_sgsn_update_subscriber_data, mmctx = 0x829e560, subscr = 0x829cf00 <000f> gprs_subscriber.c:714 SUBSCR(1234567890) Received GSUP message OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT <000f> gprs_subscriber.c:364 SUBSCR(1234567890) Will set PDP info, context id = 1, APN = 04 74 65 73 74 03 61 70 6e <000f> gprs_subscriber.c:364 SUBSCR(1234567890) Will set PDP info, context id = 2, APN = 03 66 6f 6f 03 61 70 6e <000f> gprs_subscriber.c:816 SUBSCR(1234567890) Updating subscriber data Called my_dummy_sgsn_update_subscriber_data, mmctx = 0x829e560, subscr = 0x829cf00 <000f> gprs_subscriber.c:714 SUBSCR(1234567890) Received GSUP message OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR <000f> gprs_subscriber.c:520 SUBSCR(1234567890) Update location has failed with cause 7, handled as: Permission denied <000f> gprs_subscriber.c:528 SUBSCR(1234567890) GPRS update location failed, access denied, GMM cause = 'GPRS services not allowed' (7) <000f> gprs_subscriber.c:828 SUBSCR(1234567890) Updating subscriber authentication info Called my_dummy_sgsn_update_subscriber_data, mmctx = 0x829e560, subscr = 0x829cf00 <000f> gprs_subscriber.c:714 SUBSCR(1234567890) Received GSUP message OSMO_GSUP_MSGT_INSERT_DATA_REQUEST <000f> gprs_subscriber.c:364 SUBSCR(1234567890) Will set PDP info, context id = 3, APN = 03 62 61 72 03 61 70 6e <000f> gprs_subscriber.c:816 SUBSCR(1234567890) Updating subscriber data Called my_dummy_sgsn_update_subscriber_data, mmctx = 0x829e560, subscr = 0x829cf00 <000f> gprs_subscriber.c:206 SUBSCR(1234567890) Sending GSUP, will send: 12 01 05 21 43 65 87 09 28 01 01 <000f> gprs_subscriber.c:714 SUBSCR(1234567890) Received GSUP message OSMO_GSUP_MSGT_DELETE_DATA_REQUEST <000f> gprs_subscriber.c:414 SUBSCR(1234567890) Rx GSUP message OSMO_GSUP_MSGT_DELETE_DATA_REQUEST not supported for CS <000f> gprs_subscriber.c:206 SUBSCR(1234567890) Sending GSUP, will send: 15 01 05 21 43 65 87 09 02 01 61 28 01 01 <000f> gprs_subscriber.c:206 SUBSCR(---) Sending GSUP, will send: 1d 01 05 11 11 11 11 01 02 01 02 28 01 01 <000f> gprs_subscriber.c:653 Unknown IMSI 1111111110, discarding GSUP request of type 0x1c <000f> gprs_subscriber.c:714 SUBSCR(1234567890) Received GSUP message OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST <000f> gprs_subscriber.c:626 SUBSCR(1234567890) Cancelling MS subscriber (update procedure) <000f> gprs_subscriber.c:206 SUBSCR(1234567890) Sending GSUP, will send: 1e 01 05 21 43 65 87 09 28 01 01 <000f> gprs_subscriber.c:816 SUBSCR(1234567890) Updating subscriber data Called my_dummy_sgsn_update_subscriber_data, mmctx = 0x829e560, subscr = 0x829cf00 <000f> gprs_subscriber.c:714 SUBSCR(1234567890) Received GSUP message OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST <000f> gprs_subscriber.c:626 SUBSCR(1234567890) Cancelling MS subscriber (subscription withdraw) <000f> gprs_subscriber.c:206 SUBSCR(1234567890) Sending GSUP, will send: 1e 01 05 21 43 65 87 09 28 01 01 <000f> gprs_subscriber.c:816 SUBSCR(1234567890) Updating subscriber data <000f> gprs_subscriber.c:714 SUBSCR(1234567890) Received GSUP message OSMO_GSUP_MSGT_PURGE_MS_RESULT <000f> gprs_subscriber.c:575 SUBSCR(1234567890) Completing purge MS <000f> gprs_subscriber.c:816 SUBSCR(1234567890) Updating subscriber data <000f> gprs_subscriber.c:568 GSUP(1234567890) Completing purge MS <000f> gprs_subscriber.c:564 GSUP(1234567890) Purge MS has failed with cause 'IMSI unknown in HLR' (2) <000f> gprs_subscriber.c:564 GSUP(1234567890) Purge MS has failed with cause 'Network failure' (17) <000f> gprs_subscriber.c:206 SUBSCR(---) Sending GSUP, will send: 11 01 05 21 43 65 87 09 02 01 02 28 01 01 <000f> gprs_subscriber.c:653 Unknown IMSI 1234567890, discarding GSUP request of type 0x10 <000f> gprs_subscriber.c:206 SUBSCR(---) Sending GSUP, will send: 15 01 05 21 43 65 87 09 02 01 02 28 01 01 <000f> gprs_subscriber.c:653 Unknown IMSI 1234567890, discarding GSUP request of type 0x14 <000f> gprs_subscriber.c:206 SUBSCR(---) Sending GSUP, will send: 1d 01 05 21 43 65 87 09 02 01 02 28 01 01 <000f> gprs_subscriber.c:653 Unknown IMSI 1234567890, discarding GSUP request of type 0x1c <0012> gprs_llc.c:485 LLC: unknown TLLI 0xc0000023, creating LLME on the fly <0002> gprs_sgsn.c:237 MM(/00000000) Allocated with GEA0 cipher. <0002> gprs_gmm.c:1463 MM(/00000000) -> GMM DETACH REQUEST TLLI=0xc0000023 type=GPRS detach <0002> gprs_gmm.c:522 <- GPRS MM DETACH ACC (force-standby: 0) <0012> gprs_llc_parse.c:81 LLC SAPI=1 C U GEA? IOV-UI=0x000000 FCS=0xe92dc0 CMD=UI DATA  <0012> gprs_gb_parse.c:408 Got LLC message, CRC: e92dc0 (computed e92dc0) Got DL LLC message: DETACH_ACK <0002> gprs_gmm.c:313 MM(/00000000) Cleaning MM context due to GPRS DETACH REQUEST <0012> gprs_llc.c:485 LLC: unknown TLLI 0xc0000023, creating LLME on the fly <0002> gprs_sgsn.c:237 MM(/00000000) Allocated with GEA0 cipher. <0002> gprs_gmm.c:1463 MM(/00000000) -> GMM DETACH REQUEST TLLI=0xc0000023 type=GPRS detach Power-off <0002> gprs_gmm.c:313 MM(/00000000) Cleaning MM context due to GPRS DETACH REQUEST <0012> gprs_llc.c:485 LLC: unknown TLLI 0xc0000023, creating LLME on the fly <0002> gprs_gmm.c:1919 Cannot handle GMM for unknown MM CTX <0012> gprs_llc.c:1076 LLGM Reset ==13975== Invalid read of size 4 ==13975== at 0x713C404: pthread_mutex_lock (pthread_mutex_lock.c:66) ==13975== by 0x6C6240B: ??? (in /usr/lib/x86_64-linux-gnu/libgnutls.so.28.30.1) ==13975== by 0x6CF2B06: ??? (in /usr/lib/x86_64-linux-gnu/libgnutls.so.28.30.1) ==13975== by 0x40B721: gprs_llgmm_reset (gprs_llc.c:1078) ==13975== by 0x412BF1: gsm0408_rcv_gmm (gprs_gmm.c:1931) ==13975== by 0x414421: gsm0408_gprs_rcvmsg_gb (gprs_gmm.c:2851) ==13975== by 0x4084B6: send_0408_message (sgsn_test.c:217) ==13975== by 0x403DC6: test_gmm_detach_no_mmctx (sgsn_test.c:846) ==13975== by 0x403DC6: main (sgsn_test.c:2462) ==13975== Address 0x10 is not stack'd, malloc'd or (recently) free'd ==13975== ==13975== ==13975== Process terminating with default action of signal 11 (SIGSEGV) ==13975== Access not within mapped region at address 0x10 ==13975== at 0x713C404: pthread_mutex_lock (pthread_mutex_lock.c:66) ==13975== by 0x6C6240B: ??? (in /usr/lib/x86_64-linux-gnu/libgnutls.so.28.30.1) ==13975== by 0x6CF2B06: ??? (in /usr/lib/x86_64-linux-gnu/libgnutls.so.28.30.1) ==13975== by 0x40B721: gprs_llgmm_reset (gprs_llc.c:1078) ==13975== by 0x412BF1: gsm0408_rcv_gmm (gprs_gmm.c:1931) ==13975== by 0x414421: gsm0408_gprs_rcvmsg_gb (gprs_gmm.c:2851) ==13975== by 0x4084B6: send_0408_message (sgsn_test.c:217) ==13975== by 0x403DC6: test_gmm_detach_no_mmctx (sgsn_test.c:846) ==13975== by 0x403DC6: main (sgsn_test.c:2462) ==13975== If you believe this happened as a result of a stack ==13975== overflow in your program's main thread (unlikely but ==13975== possible), you can try to increase the size of the ==13975== main thread stack using the --main-stacksize= flag. ==13975== The main thread stack size used in this run was 8388608. Testing LLME allocations Testing core subscriber data API llist_count(gprs_subscribers) == 0 llist_count(gprs_subscribers) == 1 llist_count(gprs_subscribers) == 1 llist_count(gprs_subscribers) == 2 llist_count(gprs_subscribers) == 3 llist_count(gprs_subscribers) == 2 llist_count(gprs_subscribers) == 1 llist_count(gprs_subscribers) == 0 Testing authentication triplet handling Testing subscriber GSUP handling Testing GMM detach Testing GMM detach (power off) Testing GMM detach (no MMCTX) ==13975== ==13975== HEAP SUMMARY: ==13975== in use at exit: 13,290 bytes in 14 blocks ==13975== total heap usage: 77 allocs, 63 frees, 104,336 bytes allocated ==13975== ==13975== LEAK SUMMARY: ==13975== definitely lost: 0 bytes in 0 blocks ==13975== indirectly lost: 0 bytes in 0 blocks ==13975== possibly lost: 13,290 bytes in 14 blocks ==13975== still reachable: 0 bytes in 0 blocks ==13975== suppressed: 0 bytes in 0 blocks ==13975== Rerun with --leak-check=full to see details of leaked memory ==13975== ==13975== For counts of detected and suppressed errors, rerun with: -v ==13975== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)