yes, there is multithreading in my code. Now the problem is that when i execute the program as a single thread, the result is what i want, but when i deal with the function as a thread function, the outcome is timeout in the debug information(which i use "printf" to print).
#8
well, you might need some synchronization in multithreading environment. Without seeing ur code, no one can help.
you could try the debug tools, such as valgrind, but you got know what you are doing...
#9
does ur source code involve multithreading or multiprocessing?
debugging will break the scheduling for execution that could otherwise introduce bugs on their normal schedule...
yes, there is multithreading in my code. Now the problem is that when i execute the program as a single thread, the result is what i want, but when i deal with the function as a thread function, the outcome is timeout in the debug information(which i use "printf" to print).
well, you might need some synchronization in multithreading environment. Without seeing ur code, no one can help.
you could try the debug tools, such as valgrind, but you got know what you are doing...
eXosip_message_send_request success!
at 1.
No response or the time is over (in sip_invite)!
at 2.
No response or the time is over(in sip_get_list)!
==2213==
==2213== HEAP SUMMARY:
==2213== in use at exit: 28,204 bytes in 1,643 blocks
==2213== total heap usage: 2,479 allocs, 836 frees, 100,172 bytes allocated
==2213==
==2213== 30 bytes in 1 blocks are definitely lost in loss record 855 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4085BF9: osip_uri_to_str (osip_uri.c:558)
==2213== by 0x80496C7: create_uri (l_osip.c:24)
==2213== by 0x8049E83: sip_register (ua.c:102)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 38 bytes in 1 blocks are definitely lost in loss record 937 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4085BF9: osip_uri_to_str (osip_uri.c:558)
==2213== by 0x80496C7: create_uri (l_osip.c:24)
==2213== by 0x8049E54: sip_register (ua.c:101)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,003 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x40B0AF0: pthread_create@GLIBC_2.0 (pthread_create.c:623)
==2213== by 0x4049D46: eXosip_listen_addr (eXconf.c:560)
==2213== by 0x8049E18: sip_register (ua.c:94)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,004 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x80497B9: main (main.c:51)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,005 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x8049800: main (main.c:59)
==2213==
==2213== 5,674 (616 direct, 5,058 indirect) bytes in 2 blocks are definitely lost in loss record 1,024 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4063E9E: eXosip_event_init (jevents.c:185)
==2213== by 0x4063DBB: eXosip_event_init_for_reg (jevents.c:154)
==2213== by 0x4059664: rcvregister_failure (jcallback.c:1370)
==2213== by 0x4059AEF: cb_rcv4xx (jcallback.c:1488)
==2213== by 0x4285213: __osip_message_callback (osip.c:2034)
==2213== by 0x42801B6: nict_rcv_23456xx (nict_fsm.c:288)
==2213== by 0x4282725: fsm_callmethod (fsm_misc.c:66)
==2213== by 0x4285F9A: osip_transaction_execute (osip_transaction.c:377)
==2213== by 0x42844D6: osip_nict_execute (osip.c:1595)
==2213== by 0x404A148: _eXosip_execute (eXconf.c:684)
==2213== by 0x404A585: _eXosip_thread (eXconf.c:807)
==2213==
==2213== LEAK SUMMARY:
==2213== definitely lost: 684 bytes in 4 blocks
==2213== indirectly lost: 5,058 bytes in 354 blocks
==2213== possibly lost: 408 bytes in 3 blocks
==2213== still reachable: 22,054 bytes in 1,282 blocks
==2213== suppressed: 0 bytes in 0 blocks
==2213== Reachable blocks (those to which a pointer was found) are not shown.
==2213== To see them, rerun with: --leak-check=full --show-reachable=yes
==2213==
==2213== For counts of detected and suppressed errors, rerun with: -v
==2213== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)
#10
does ur source code involve multithreading or multiprocessing?
debugging will break the scheduling for execution that could otherwise introduce bugs on their normal schedule...
yes, there is multithreading in my code. Now the problem is that when i execute the program as a single thread, the result is what i want, but when i deal with the function as a thread function, the outcome is timeout in the debug information(which i use "printf" to print).
well, you might need some synchronization in multithreading environment. Without seeing ur code, no one can help.
you could try the debug tools, such as valgrind, but you got know what you are doing...
eXosip_message_send_request success!
at 1.
No response or the time is over (in sip_invite)!
at 2.
No response or the time is over(in sip_get_list)!
==2213==
==2213== HEAP SUMMARY:
==2213== in use at exit: 28,204 bytes in 1,643 blocks
==2213== total heap usage: 2,479 allocs, 836 frees, 100,172 bytes allocated
==2213==
==2213== 30 bytes in 1 blocks are definitely lost in loss record 855 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4085BF9: osip_uri_to_str (osip_uri.c:558)
==2213== by 0x80496C7: create_uri (l_osip.c:24)
==2213== by 0x8049E83: sip_register (ua.c:102)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 38 bytes in 1 blocks are definitely lost in loss record 937 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4085BF9: osip_uri_to_str (osip_uri.c:558)
==2213== by 0x80496C7: create_uri (l_osip.c:24)
==2213== by 0x8049E54: sip_register (ua.c:101)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,003 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x40B0AF0: pthread_create@GLIBC_2.0 (pthread_create.c:623)
==2213== by 0x4049D46: eXosip_listen_addr (eXconf.c:560)
==2213== by 0x8049E18: sip_register (ua.c:94)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,004 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x80497B9: main (main.c:51)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,005 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x8049800: main (main.c:59)
==2213==
==2213== 5,674 (616 direct, 5,058 indirect) bytes in 2 blocks are definitely lost in loss record 1,024 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4063E9E: eXosip_event_init (jevents.c:185)
==2213== by 0x4063DBB: eXosip_event_init_for_reg (jevents.c:154)
==2213== by 0x4059664: rcvregister_failure (jcallback.c:1370)
==2213== by 0x4059AEF: cb_rcv4xx (jcallback.c:1488)
==2213== by 0x4285213: __osip_message_callback (osip.c:2034)
==2213== by 0x42801B6: nict_rcv_23456xx (nict_fsm.c:288)
==2213== by 0x4282725: fsm_callmethod (fsm_misc.c:66)
==2213== by 0x4285F9A: osip_transaction_execute (osip_transaction.c:377)
==2213== by 0x42844D6: osip_nict_execute (osip.c:1595)
==2213== by 0x404A148: _eXosip_execute (eXconf.c:684)
==2213== by 0x404A585: _eXosip_thread (eXconf.c:807)
==2213==
==2213== LEAK SUMMARY:
==2213== definitely lost: 684 bytes in 4 blocks
==2213== indirectly lost: 5,058 bytes in 354 blocks
==2213== possibly lost: 408 bytes in 3 blocks
==2213== still reachable: 22,054 bytes in 1,282 blocks
==2213== suppressed: 0 bytes in 0 blocks
==2213== Reachable blocks (those to which a pointer was found) are not shown.
==2213== To see them, rerun with: --leak-check=full --show-reachable=yes
==2213==
==2213== For counts of detected and suppressed errors, rerun with: -v
==2213== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)
these "leaks" may or may not be the real memory leaks. Valgrind just told you that u forgot to free them. It is usually fine if the program is not run as a daemon.
but you could use this report as your check list to discover potential memory related bug.
If nothing is wrong, you could try Helgrind and which are tools under valgrind tool suite for detecting bugs in multithreading environment...
#11
I meant to say you could try "Helgrind and DRD"
#12
I meant to say you could try "Helgrind and DRD"
get it, i try it. do you have some relevant materials about the tool, i think it is a powerful tool. i prefer to learn it deeply.
#13
I meant to say you could try "Helgrind and DRD"
get it, i try it. do you have some relevant materials about the tool, i think it is a powerful tool. i prefer to learn it deeply.
the best place for learning valgrind is its website: http://valgrind.org/
does ur source code involve multithreading or multiprocessing?
debugging will break the scheduling for execution that could otherwise introduce bugs on their normal schedule...
yes, there is multithreading in my code. Now the problem is that when i execute the program as a single thread, the result is what i want, but when i deal with the function as a thread function, the outcome is timeout in the debug information(which i use "printf" to print).
#8
does ur source code involve multithreading or multiprocessing?
debugging will break the scheduling for execution that could otherwise introduce bugs on their normal schedule...
yes, there is multithreading in my code. Now the problem is that when i execute the program as a single thread, the result is what i want, but when i deal with the function as a thread function, the outcome is timeout in the debug information(which i use "printf" to print).
well, you might need some synchronization in multithreading environment. Without seeing ur code, no one can help.
you could try the debug tools, such as valgrind, but you got know what you are doing...
#9
does ur source code involve multithreading or multiprocessing?
debugging will break the scheduling for execution that could otherwise introduce bugs on their normal schedule...
yes, there is multithreading in my code. Now the problem is that when i execute the program as a single thread, the result is what i want, but when i deal with the function as a thread function, the outcome is timeout in the debug information(which i use "printf" to print).
well, you might need some synchronization in multithreading environment. Without seeing ur code, no one can help.
you could try the debug tools, such as valgrind, but you got know what you are doing...
eXosip_message_send_request success!
at 1.
No response or the time is over (in sip_invite)!
at 2.
No response or the time is over(in sip_get_list)!
==2213==
==2213== HEAP SUMMARY:
==2213== in use at exit: 28,204 bytes in 1,643 blocks
==2213== total heap usage: 2,479 allocs, 836 frees, 100,172 bytes allocated
==2213==
==2213== 30 bytes in 1 blocks are definitely lost in loss record 855 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4085BF9: osip_uri_to_str (osip_uri.c:558)
==2213== by 0x80496C7: create_uri (l_osip.c:24)
==2213== by 0x8049E83: sip_register (ua.c:102)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 38 bytes in 1 blocks are definitely lost in loss record 937 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4085BF9: osip_uri_to_str (osip_uri.c:558)
==2213== by 0x80496C7: create_uri (l_osip.c:24)
==2213== by 0x8049E54: sip_register (ua.c:101)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,003 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x40B0AF0: pthread_create@GLIBC_2.0 (pthread_create.c:623)
==2213== by 0x4049D46: eXosip_listen_addr (eXconf.c:560)
==2213== by 0x8049E18: sip_register (ua.c:94)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,004 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x80497B9: main (main.c:51)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,005 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x8049800: main (main.c:59)
==2213==
==2213== 5,674 (616 direct, 5,058 indirect) bytes in 2 blocks are definitely lost in loss record 1,024 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4063E9E: eXosip_event_init (jevents.c:185)
==2213== by 0x4063DBB: eXosip_event_init_for_reg (jevents.c:154)
==2213== by 0x4059664: rcvregister_failure (jcallback.c:1370)
==2213== by 0x4059AEF: cb_rcv4xx (jcallback.c:1488)
==2213== by 0x4285213: __osip_message_callback (osip.c:2034)
==2213== by 0x42801B6: nict_rcv_23456xx (nict_fsm.c:288)
==2213== by 0x4282725: fsm_callmethod (fsm_misc.c:66)
==2213== by 0x4285F9A: osip_transaction_execute (osip_transaction.c:377)
==2213== by 0x42844D6: osip_nict_execute (osip.c:1595)
==2213== by 0x404A148: _eXosip_execute (eXconf.c:684)
==2213== by 0x404A585: _eXosip_thread (eXconf.c:807)
==2213==
==2213== LEAK SUMMARY:
==2213== definitely lost: 684 bytes in 4 blocks
==2213== indirectly lost: 5,058 bytes in 354 blocks
==2213== possibly lost: 408 bytes in 3 blocks
==2213== still reachable: 22,054 bytes in 1,282 blocks
==2213== suppressed: 0 bytes in 0 blocks
==2213== Reachable blocks (those to which a pointer was found) are not shown.
==2213== To see them, rerun with: --leak-check=full --show-reachable=yes
==2213==
==2213== For counts of detected and suppressed errors, rerun with: -v
==2213== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)
#10
does ur source code involve multithreading or multiprocessing?
debugging will break the scheduling for execution that could otherwise introduce bugs on their normal schedule...
yes, there is multithreading in my code. Now the problem is that when i execute the program as a single thread, the result is what i want, but when i deal with the function as a thread function, the outcome is timeout in the debug information(which i use "printf" to print).
well, you might need some synchronization in multithreading environment. Without seeing ur code, no one can help.
you could try the debug tools, such as valgrind, but you got know what you are doing...
eXosip_message_send_request success!
at 1.
No response or the time is over (in sip_invite)!
at 2.
No response or the time is over(in sip_get_list)!
==2213==
==2213== HEAP SUMMARY:
==2213== in use at exit: 28,204 bytes in 1,643 blocks
==2213== total heap usage: 2,479 allocs, 836 frees, 100,172 bytes allocated
==2213==
==2213== 30 bytes in 1 blocks are definitely lost in loss record 855 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4085BF9: osip_uri_to_str (osip_uri.c:558)
==2213== by 0x80496C7: create_uri (l_osip.c:24)
==2213== by 0x8049E83: sip_register (ua.c:102)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 38 bytes in 1 blocks are definitely lost in loss record 937 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4085BF9: osip_uri_to_str (osip_uri.c:558)
==2213== by 0x80496C7: create_uri (l_osip.c:24)
==2213== by 0x8049E54: sip_register (ua.c:101)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,003 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x40B0AF0: pthread_create@GLIBC_2.0 (pthread_create.c:623)
==2213== by 0x4049D46: eXosip_listen_addr (eXconf.c:560)
==2213== by 0x8049E18: sip_register (ua.c:94)
==2213== by 0x8049795: main (main.c:50)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,004 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x80497B9: main (main.c:51)
==2213==
==2213== 136 bytes in 1 blocks are possibly lost in loss record 1,005 of 1,024
==2213== at 0x402B965: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4011627: allocate_dtv (dl-tls.c:296)
==2213== by 0x4011DBB: _dl_allocate_tls (dl-tls.c:460)
==2213== by 0x40B04BE: pthread_create@@GLIBC_2.1 (allocatestack.c:579)
==2213== by 0x8049800: main (main.c:59)
==2213==
==2213== 5,674 (616 direct, 5,058 indirect) bytes in 2 blocks are definitely lost in loss record 1,024 of 1,024
==2213== at 0x40299D8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2213== by 0x4063E9E: eXosip_event_init (jevents.c:185)
==2213== by 0x4063DBB: eXosip_event_init_for_reg (jevents.c:154)
==2213== by 0x4059664: rcvregister_failure (jcallback.c:1370)
==2213== by 0x4059AEF: cb_rcv4xx (jcallback.c:1488)
==2213== by 0x4285213: __osip_message_callback (osip.c:2034)
==2213== by 0x42801B6: nict_rcv_23456xx (nict_fsm.c:288)
==2213== by 0x4282725: fsm_callmethod (fsm_misc.c:66)
==2213== by 0x4285F9A: osip_transaction_execute (osip_transaction.c:377)
==2213== by 0x42844D6: osip_nict_execute (osip.c:1595)
==2213== by 0x404A148: _eXosip_execute (eXconf.c:684)
==2213== by 0x404A585: _eXosip_thread (eXconf.c:807)
==2213==
==2213== LEAK SUMMARY:
==2213== definitely lost: 684 bytes in 4 blocks
==2213== indirectly lost: 5,058 bytes in 354 blocks
==2213== possibly lost: 408 bytes in 3 blocks
==2213== still reachable: 22,054 bytes in 1,282 blocks
==2213== suppressed: 0 bytes in 0 blocks
==2213== Reachable blocks (those to which a pointer was found) are not shown.
==2213== To see them, rerun with: --leak-check=full --show-reachable=yes
==2213==
==2213== For counts of detected and suppressed errors, rerun with: -v
==2213== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)
these "leaks" may or may not be the real memory leaks. Valgrind just told you that u forgot to free them. It is usually fine if the program is not run as a daemon.
but you could use this report as your check list to discover potential memory related bug.
If nothing is wrong, you could try Helgrind and which are tools under valgrind tool suite for detecting bugs in multithreading environment...
#11
I meant to say you could try "Helgrind and DRD"
#12
I meant to say you could try "Helgrind and DRD"
get it, i try it. do you have some relevant materials about the tool, i think it is a powerful tool. i prefer to learn it deeply.
#13
I meant to say you could try "Helgrind and DRD"
get it, i try it. do you have some relevant materials about the tool, i think it is a powerful tool. i prefer to learn it deeply.
the best place for learning valgrind is its website: http://valgrind.org/