Segmentation fault with parallel calls via JNI

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

 



Hi,

we are developing an internal server application that uses the PJSUA-LIB 
2.0.1 API to play multiple wav files in parallel.  The application is 
written in Java and runs in a JEE container on Linux 3.0.42 x86_64.

It uses PJSUA-LIB via JNI and a C++ custom wrapper library.  After some 
initial testing, we deliberately decided to use JNI directly from the 
container, aware that this is against the JEE spec.

During load tests with less than 40 calls in parallel we observed 
segmentation faults.  Here's the stack trace from the JVM error file:

Stack: [0x00007ff728b2d000,0x00007ff728c2e000],  sp=0x00007ff728c25ef0,  \
free space=995k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libVoIPSharedLib.so+0x9cb1d]  pjsip_uri_get_scheme+0x13
C  [libVoIPSharedLib.so+0x9de8b]  get_dest_info+0x2b
C  [libVoIPSharedLib.so+0x9e464]  pjsip_process_route_set+0x294
C  [libVoIPSharedLib.so+0x9edcf]  pjsip_endpt_send_request_stateless+0x74
C  [libVoIPSharedLib.so+0xb0225]  tsx_send_msg+0x3be
C  [libVoIPSharedLib.so+0xb094c]  tsx_on_state_null+0x172
C  [libVoIPSharedLib.so+0xaf4e9]  pjsip_tsx_send_msg+0x101
C  [libVoIPSharedLib.so+0xb5262]  pjsip_dlg_send_request+0x2ef
C  [libVoIPSharedLib.so+0x77934]  pjsip_inv_send_msg+0x13b
C  [libVoIPSharedLib.so+0x5488b]  on_make_call_med_tp_complete+0x3f9
C  [libVoIPSharedLib.so+0x55038]  pjsua_call_make_call+0x4dc
C  [libVoIPSharedLib.so+0x49b9e]  call(VoIPCallbackWrapper*, std::string const&, \
std::string const&, std::string const&, int)+0x41e

The last function is from the wrapper library.  In other cases, we did not get 
any error file.

So far, we were not able to reproduce the error outside the JEE container. 
Thus I'm currently investigating if the error could be related to the calling
thread being managed by the JEE container.

On this topic, I have a few questions: 

My understanding is that pjsip does not open threads on its own, while 
pjsua does.  Is that correct?

Currently we start different calls from the same thread.  Now I want to 
use a dedicated thread per call.  Are there any drawbacks with this approach 
regarding PJSUA-LIB and PJSIP?

We have compiled pjsip 2.0.1 with the following settings in config_site.h:

#define PJSUA_MAX_CALLS              480
#define PJSUA_MAX_PLAYERS            480
#define PJSUA_MAX_RECORDERS          4
#define PJSUA_MAX_CONF_PORTS         (PJSUA_MAX_CALLS+2*PJSUA_MAX_PLAYERS)
#define PJ_IOQUEUE_MAX_HANDLES             1024
#define PJSIP_MAX_DIALOG_COUNT             ((640*1024)-1)

Are these values ok?  Are we missing a setting? 

I could not find a similar case searching this list and the bug tracker.  
I would really appreciate any help. 

Cheers, 
Alexander



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux