linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Fwd: linphone-android DTLS SIGSEGV problem


From: Eugene Vasyuk
Subject: [Linphone-developers] Fwd: linphone-android DTLS SIGSEGV problem
Date: Sun, 27 Dec 2015 19:29:04 +0200

Hi, guys!

I encountered problems with getting my android-linphone client to run secure media.

As back-end we use openSIPs with rtpEngine. As far as we found rtpEngine is pretty bad processing streams with SRTP encryption(there is no media-stream if clients would be in different external IP-addresses).
So we decided to try DTLS-encryption.

The main problem is SIGSEGV at the point of making invite with pre-defined parameters(as far as I discovered,it is the only way to make it possible of audio-records)

This is how I make my invitation:
public synchronized void makeCall(String name) {
appendLogger("profiling", "makeCall()");
LinphoneAddress address = null;
LinphoneCallParams params = null;
try {
address = mLcFactory.createLinphoneAddress((IS_TLS_ENABLED ? URI_SIPS : URI_SIP) + name + "@" + SERVER_URL);

address.setTransport(LinphoneAddress.TransportType.LinphoneTransportTls);
address.setPort(5061);
address.setDomain(SERVER_URL);

filename = getRecordFileName();
File recordFile = new File(filename);

try {
if (recordFile.createNewFile()) {
params = lc.createCallParams(null);
//params.enableLowBandwidth(true);
params.setMediaEnctyption(ENC_TYP);
params.setVideoEnabled(IS_VIDEO_SUPPORTED);
params.setRecordFile(recordFile.getAbsolutePath());
IO_RECORD_ERROR = false;
} else {
IO_RECORD_ERROR = true;
App.log("make call raw action", "CALL RECORDING WOULD NOT BE STARTED");
}
} catch (IOException e) {
IO_RECORD_ERROR = true;
e.printStackTrace();
App.getInstance().showToast("RECORDING WOULD NOT BE STARTED: " + e.getMessage());
App.log("make call raw action", "CALL RECORDING WOULD NOT BE STARTED DUE TO IOEXCEPTION: " + e.getMessage());
} catch (Exception exc) {
exc.printStackTrace();
}

if (params == null)
lc.invite(address);
else {
String password = pref.getString(App.PROP_SIP_PASS, null);// password saved in onToken
if (password == null)
password = "=\\ password is NULL";

App.log("sip husip password " + password);

params.setVideoEnabled(IS_VIDEO_SUPPORTED);

params.addCustomHeader("X-sender-Token", password);
lc.inviteAddressWithParams(address, params);
}
} catch (LinphoneCoreException e) {
App.log(SipHelper.class.getSimpleName(), "Invalid sip address: " + name + ". " + e.getMessage());
}
App.log("makeCall name " + name);
}
this is how I accepting invitations: (with DTLS it actually never runs)

@Override
public synchronized void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
...
if (state == LinphoneCall.State.IncomingReceived) {
LinphoneCallParams params = null;
params = lc.createCallParams(null);
params.setMediaEnctyption(ENC_TYP);
params.setVideoEnabled(IS_VIDEO_SUPPORTED);

filename = getRecordFileName();
File recordFile = new File(filename);
try {
if (recordFile.createNewFile()) {
params.setRecordFile(recordFile.getAbsolutePath());
IO_RECORD_ERROR = false;
} else {
IO_RECORD_ERROR = true;
App.log(TAG, "CALL RECORDING WOULD NOT BE STARTED");
}
} catch (IOException e) {
IO_RECORD_ERROR = true;
e.printStackTrace();
App.getInstance().showToast("RECORDING IO ERROR");
App.log(TAG, "CALL RECORDING WOULD NOT BE STARTED DUE TO IOEXCEPTION: " + e.getMessage());
} catch (Exception exc) {
IO_RECORD_ERROR = true;
exc.printStackTrace();
}

try {
if (params != null)
lc.acceptCallWithParams(call, params);
else
lc.acceptCall(call);
} catch (LinphoneCoreException e) {
App.log(SipHelper.class.getSimpleName(), " " + e.getMessage());

SenderCallUIEvent evt = new SenderCallUIEvent(SenderCallUIEvent.HIDE_SCREEN_ERROR, null);
evt.setErrorTitle("SIP LinphoneCoreException");
evt.setErrorInfo(e.getMessage());
Bus.getInstance ().post(evt);
}
}
...
And here is SIGSEGV dump before fixing problem with certificates:

12-26 19:53:20.397    3915-7507/? V/LinphoneHandler﹕ 8    error         Certificate generation can't open/create file ./linphone-dtls-default-identity.pem
12-26 19:53:20.397    3915-7507/? V/LinphoneHandler﹕ 8    error         Unable to retrieve or generate DTLS certificate and key - DTLS disabled
 
StackTrace#0
        12-26 19:53:22.707      286-286/? I/DEBUG#01 pc 000c3aa5  /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (linphone_call_make_local_media_description+2292)
12-26 19:53:22.707 286-286/? I/DEBUG#02 pc 000cd7dd /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (linphone_core_start_invite+24)
12-26 19:53:22.707 286-286/? I/DEBUG#03 pc 000ce281 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (linphone_core_invite_address_with_params+328)
12-26 19:53:22.707 286-286/? I/DEBUG#04 pc 000d50d3 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (Java_org_linphone_core_LinphoneCoreImpl_inviteAddressWithParams+10)
12-26 19:53:24.847 1060-1060/? D/CrashAnrDetectorBuild: samsung/a7ltexx/a7lte:5.0.2/LRX22G/A700FDXXU1BOJD:user/release-keys
Hardware: MSM8939
Revision: 5
Bootloader: A700FDXXU1BOJD
Radio: unknown
Kernel: Linux version 3.10.49-5891138 (address@hidden) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Sat Oct 31 19:59:56 KST 2015
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/a7ltexx/a7lte:5.0.2/LRX22G/A700FDXXU1BOJD:user/release-keys'
Revision: '5'
ABI: 'arm'
pid: 3915, tid: 7507, name: allState.sender >>> mobi.sender <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
r0 b8cbc224 r1 00000000 r2 00000100 r3 b8cbc224
r4 b8d1b420 r5 b8cbac28 r6 00000008 r7 00000000
r8 00000003 r9 b8cbc224 sl b8cbad00 fp 00001630
ip a19f2c1c sp 9a2cc748 lr a165baa9 pc b6f00a28 cpsr 600f0030
d0 3234623164386278 d1 305b206c6c616320
d2 6e6f206d61657274 d3 6f206c61636f6c20
d4 0000000000000000 d5 0000000000000000
d6 0000000000000000 d7 0000000000000000
d8 0000000042400000 d9 0000000000000000
d10 0000000000000000 d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 00001c2000001c20 d17 b8ca9b0e721a7034
d18 721a7034b8cb01e8 d19 0001000100010001
d20 0001000100010001 d21 0000000100010001
d22 0000000000000000 d23 0000000000000000
d24 0000000000000000 d25 0000000000000000
d26 0001000100010001 d27 0002000100010001
d28 0080008000800080 d29 0080008000800080
d30 0800080008000800 d31 0800080008000800
scr 60000013
backtrace:
#00 pc 00040a28 /system/lib/libc.so (strncpy+5)
#01 pc 000c3aa5 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (linphone_call_make_local_media_description+2292)
#02 pc 000cd7dd /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (linphone_core_start_invite+24)
#03 pc 000ce281 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (linphone_core_invite_address_with_params+328)
#04 pc 000d50d3 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (Java_org_linphone_core_LinphoneCoreImpl_inviteAddressWithParams+10)
#05 pc 005243c7 /data/dalvik-cache/arm/address@hidden@mobi.sender-2@address@hidden
stack:
9a2cc6c8 00000035
9a2cc6cc 00000016
9a2cc6d0 000001ee
9a2cc6d4 a1928170 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9a2cc6d8 b8cb1618 [heap]
9a2cc6dc 00000000
9a2cc6e0 00000000
9a2cc6e4 567ed412
9a2cc6e8 567ed412
9a2cc6ec 000789e6
9a2cc6f0 00000000
9a2cc6f4 00000002
9a2cc6f8 a1a00668 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9a2cc6fc a1a06ca4
9a2cc700 9a2cc744 [stack:7507]
9a2cc704 a192da83 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9a2cc708 a192dab6 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9a2cc70c 00000003
9a2cc710 b89fb738 [heap]
9a2cc714 b892ccd0 [heap]
9a2cc718 00000000
9a2cc71c a192dab6 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9a2cc720 00001630
9a2cc724 a16711c5 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (lp_config_get_string+22)
9a2cc728 00000000
9a2cc72c 00000001
9a2cc730 b8cbac28 [heap]
9a2cc734 a1671227 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (lp_config_get_int+10)
9a2cc738 b8752760 [heap]
9a2cc73c a1927d45 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9a2cc740 a192dab6 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9a2cc744 b8d1b420 [heap]
#00 9a2cc748 b8d1b420 [heap]
9a2cc74c a165baa9 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (linphone_call_make_local_media_description+2296)
#01 9a2cc750 00000001
9a2cc754 0
StackTrace#0:

StackTrace#1 (after fixing problems with certificates)

12-26 20:45:40.657    1060-1060/? D/CrashAnrDetectorBuild: samsung/a7ltexx/a7lte:5.0.2/LRX22G/A700FDXXU1BOJD:user/release-keys
Hardware: MSM8939
Revision: 5
Bootloader: A700FDXXU1BOJD
Radio: unknown
Kernel: Linux version 3.10.49-5891138 (address@hidden) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Sat Oct 31 19:59:56 KST 2015
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/a7ltexx/a7lte:5.0.2/LRX22G/A700FDXXU1BOJD:user/release-keys'
Revision: '5'
ABI: 'arm'
pid: 19963, tid: 21394, name: allState.sender >>> mobi.sender <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xdeadbaad
Abort message: 'invalid address or address of corrupt block 0xa0953c3f passed to dlfree'
r0 00000000 r1 b6f16dec r2 deadbaad r3 00000000
r4 a0953c3f r5 b6f180f8 r6 98a85000 r7 a0953c47
r8 b896f940 r9 b8da0308 sl b8e10500 fp ffffffff
ip 00000000 sp 9952d6b8 lr b6ee8637 pc b6ee8638 cpsr 60070030
d0 0000000000000000 d1 6120726f2073736c
d2 6f20737365726466 d3 707572726f632072
d4 696e692074786574 d5 6e72757465722074
d6 373278302d206465 d7 7473206e6f203038
d8 0000000042400000 d9 0000000000000000
d10 0000000000000000 d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 0000000000000000 d17 b8d2227d721a7034
d18 721a7034b8b07968 d19 0001000100010001
d20 0001000100010001 d21 0000000100010001
d22 0000000000000000 d23 0000000000000000
d24 0000000000000000 d25 0000000000000000
d26 0001000100010001 d27 0002000100010001
d28 0080008000800080 d29 0080008000800080
d30 0800080008000800 d31 0800080008000800
scr 60000013
backtrace:
#00 pc 00028638 /system/lib/libc.so (dlfree+1239)
#01 pc 0000ef53 /system/lib/libc.so (free+10)
#02 pc 0031bf99 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (ortp_free+8)
#03 pc 000c275b /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (setup_dtls_params+98)
#04 pc 000c4e41 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (linphone_call_init_audio_stream+252)
#05 pc 000c54db /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (linphone_call_init_media_streams+4)
#06 pc 000ce1c1 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (linphone_core_invite_address_with_params+240)
#07 pc 000d506b /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (Java_org_linphone_core_LinphoneCoreImpl_inviteAddressWithParams+10)
#08 pc 005243b7 /data/dalvik-cache/arm/address@hidden@mobi.sender-2@address@hidden
stack:
9952d638 a0a2c668 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9952d63c a0a32ca4
9952d640 9952d684 [stack:21394]
9952d644 a0992d9c /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9952d648 00000000
9952d64c a08ddf01 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (ortp_logv+64)
9952d650 9952d684 [stack:21394]
9952d654 ffffd880
9952d658 b88c9a38 [heap]
9952d65c b8706538 [heap]
9952d660 b898e280 [heap]
9952d664 9952d6fc [stack:21394]
9952d668 b8b06a70 [heap]
9952d66c a06ae190 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so (ortp_error+36)
9952d670 b88c9a38 [heap]
9952d674 9952d684 [stack:21394]
9952d678 b898e280 [heap]
9952d67c 29846937 /dev/ashmem/dalvik-main space (deleted)
9952d680 a0992d9c /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9952d684 a0953c3f /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9952d688 b6f180f8
9952d68c 98a85000
9952d690 a0953c47 /data/app/mobi.sender-2/lib/arm/liblinphone-armeabi-v7a.so
9952d694 b6ed1e5d /system/lib/libc.so (__libc_fatal_no_abort+16)
9952d698 b6f09897 /system/lib/libc.so
9952d69c 9952d6ac [stack:21394]
9952d6a0 b6f0d0ec /system/lib


Any ideas what goes wrong or how it could be fixed?
 
P.S. I am using git version with hash "gefce905"
 
--

Best regards,
Yevhenii Vasiuk

skype: evasyuk
mobile: +380956175855



--

Best regards,
Yevhenii Vasiuk

Mobile Developer, MiddleWare LLC
skype: evasyuk
mobile: +380956175855

reply via email to

[Prev in Thread] Current Thread [Next in Thread]