Hi.
I'm implementing a softphone that must create a new thread when a function is invoked. Such thread executes another very simple function. The simple function just prints a 'hello world' and nothing more.
When the simple function ends, the entire softphone craches and 'die'.
Could someone check the code (c++) bellow and tell me if I am doing something wrong please? --------------------------------------------------------------------------------------------------------------------------------------
I created the thread:
pj_caching_pool_init(&cp, NULL, 1024*1024 );
pool = pj_pool_create(&cp.factory, // the factory
"pool5", // pool's name PJ_THREAD_DEFAULT_STACK_SIZE, // initial size 4000, // increment size NULL); if (pool == NULL) { qDebug(" Pool error. \n"); } else{ pj_thread_create(pool, "MySimpleThread", (pj_thread_proc*)&:: sdCardWatchDog, NULL, PJ_THREAD_DEFAULT_STACK_SIZE, 0, &newThread); } The code of the simple function is: static void * sdCardWatchDog(){
qDebug(" Hello World !! \n"); return NULL; } In header file I have: pj_caching_pool cp;
pj_thread_t * newThread; pj_pool_t *pool; static void * sdCardWatchDog(); Any hint will very helpful! Best regards.
RODRIGO PIMENTA CARVALHO
Inatel Competence Center Software Ph: +55 35 3471 9200 RAMAL 979 De: pjsip <pjsip-bounces@xxxxxxxxxxxxxxx> em nome de Ming <ming@xxxxxxxxx>
Enviado: sexta-feira, 10 de novembro de 2017 08:04 Para: pjsip list Assunto: Re: Stack-buffer overflow in pjsip_multipart_parse and pj_scan_get_quotes Hi Stephan,
Ah, silly me. Forgot to include the flags when compiling PJSIP.
Thanks for letting me know. I've found the problems and fixed them, all three programs you sent coughed up no errors now. Currently still checking for the same patterns in other places as well. Will update you when it's done, probably early next week.
Thanks a lot and have a good weekend.
Regards,
Ming
On Fri, Nov 10, 2017 at 4:48 PM, Stephan Zeisberg
<stephan@xxxxxxxxx> wrote:
Hi Ming — |
_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org