Agenda SDK Dialog: App crashes making multiple parallel http requests using http_client lib
Hi I am having issues with:
https://sdk.innovaphone.com/13r2/sdk/common/interface/http_client.htm
when I try to make http requests parallel.
at start of task i check for connection but it still give error:
void TaskHttpRequest::Start(class UTask* user)
{
LOG("TaskHttpRequest::%s \t URL: %s", __FUNCTION__, address.c_str());
this->user = user;
if (!httpClient->Connected())
{
httpClient->Connect(address.c_str());
}
}
{
LOG("TaskHttpRequest::%s \t URL: %s", __FUNCTION__, address.c_str());
this->user = user;
if (!httpClient->Connected())
{
httpClient->Connect(address.c_str());
}
}
app crashes with following error:
01-23 11:34:18.160 ASSERT: Called HTTPClient::Connect() while client is not offline (Connect:198)
[New LWP 31879]
[New LWP 31920]
[New LWP 31921]
[New LWP 31923]
[New LWP 31924]
[New LWP 31925]
[New LWP 32012]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/apps/WhoisOnV2/WhoisOnV2 --manager=/var/run/manager/manager --service-id=whois'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f96921afe8a in raise () from /lib64/libpthread.so.0
[Current thread is 1 (Thread 0x7f96916fe100 (LWP 31879))]
Thread 7 (Thread 0x7f968a7fc700 (LWP 32012)):
#0 0x00007f96921ab77c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000004c03c3 in DnsThread::ThreadFunction() ()
#2 0x00000000004bf5da in __dns_thread_main(void*) ()
#3 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#4 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 6 (Thread 0x7f968affd700 (LWP 31925)):
#0 0x00007f96921ab77c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000004c03c3 in DnsThread::ThreadFunction() ()
#2 0x00000000004bf5da in __dns_thread_main(void*) ()
#3 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#4 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 5 (Thread 0x7f968b7fe700 (LWP 31924)):
#0 0x00007f96921ab77c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000004c03c3 in DnsThread::ThreadFunction() ()
#2 0x00000000004bf5da in __dns_thread_main(void*) ()
#3 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#4 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 4 (Thread 0x7f968bfff700 (LWP 31923)):
#0 0x00007f96921aec42 in __lll_lock_wait () from /lib64/libpthread.so.0
#1 0x00007f96921a77e1 in pthread_mutex_lock () from /lib64/libpthread.so.0
#2 0x00000000004c032b in DnsThread::ThreadFunction() ()
#3 0x00000000004bf5da in __dns_thread_main(void*) ()
#4 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#5 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 3 (Thread 0x7f9690ec3700 (LWP 31921)):
#0 0x00007f96921ab77c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000004c03c3 in DnsThread::ThreadFunction() ()
#2 0x00000000004bf5da in __dns_thread_main(void*) ()
#3 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#4 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 2 (Thread 0x7f96916fa700 (LWP 31920)):
#0 0x00007f96921ab77c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000004c03c3 in DnsThread::ThreadFunction() ()
#2 0x00000000004bf5da in __dns_thread_main(void*) ()
#3 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#4 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7f96916fe100 (LWP 31879)):
#0 0x00007f96921afe8a in raise () from /lib64/libpthread.so.0
#1 0x00000000004807d8 in HTTPClient::Connect(char const*, char const*, char const*, int) ()
#2 0x000000000040bfdd in WhoisOn::PbxPresenceUpdated(std::vector<UserPresence, std::allocator<UserPresence> > const&) ()
#3 0x000000000040d30d in WhoisOn::PbxPresenceUpdated(char const*, IPbxApiPresence*) ()
#4 0x000000000048c289 in PbxApiTaskPresenceSubscription::Message(json_io&, unsigned short, char const*, char const*) ()
#5 0x00000000004617b3 in AppWebsocket::WebsocketRecvResult(IWebsocket*, void*, unsigned long, bool, bool) ()
#6 0x00000000004aace9 in WebserverWebsocketHandler::HandleMessage(IWebserverMessage*, void*, unsigned long) ()
#7 0x00000000004a2779 in WebserverPlugin::SocketRecvResult(ISocket*, void*, unsigned long) ()
#8 0x000000000047ea0b in UDSocket::ReceiveData() ()
#9 0x000000000047eb4d in UDSocket::IoExec(void*) ()
#10 0x000000000045b259 in IoMux::ExecListRun() ()
#11 0x000000000045b6cc in IoMux::Run() ()
#12 0x0000000000409181 in main ()
[New LWP 31879]
[New LWP 31920]
[New LWP 31921]
[New LWP 31923]
[New LWP 31924]
[New LWP 31925]
[New LWP 32012]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/apps/WhoisOnV2/WhoisOnV2 --manager=/var/run/manager/manager --service-id=whois'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f96921afe8a in raise () from /lib64/libpthread.so.0
[Current thread is 1 (Thread 0x7f96916fe100 (LWP 31879))]
Thread 7 (Thread 0x7f968a7fc700 (LWP 32012)):
#0 0x00007f96921ab77c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000004c03c3 in DnsThread::ThreadFunction() ()
#2 0x00000000004bf5da in __dns_thread_main(void*) ()
#3 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#4 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 6 (Thread 0x7f968affd700 (LWP 31925)):
#0 0x00007f96921ab77c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000004c03c3 in DnsThread::ThreadFunction() ()
#2 0x00000000004bf5da in __dns_thread_main(void*) ()
#3 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#4 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 5 (Thread 0x7f968b7fe700 (LWP 31924)):
#0 0x00007f96921ab77c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000004c03c3 in DnsThread::ThreadFunction() ()
#2 0x00000000004bf5da in __dns_thread_main(void*) ()
#3 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#4 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 4 (Thread 0x7f968bfff700 (LWP 31923)):
#0 0x00007f96921aec42 in __lll_lock_wait () from /lib64/libpthread.so.0
#1 0x00007f96921a77e1 in pthread_mutex_lock () from /lib64/libpthread.so.0
#2 0x00000000004c032b in DnsThread::ThreadFunction() ()
#3 0x00000000004bf5da in __dns_thread_main(void*) ()
#4 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#5 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 3 (Thread 0x7f9690ec3700 (LWP 31921)):
#0 0x00007f96921ab77c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000004c03c3 in DnsThread::ThreadFunction() ()
#2 0x00000000004bf5da in __dns_thread_main(void*) ()
#3 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#4 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 2 (Thread 0x7f96916fa700 (LWP 31920)):
#0 0x00007f96921ab77c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000000004c03c3 in DnsThread::ThreadFunction() ()
#2 0x00000000004bf5da in __dns_thread_main(void*) ()
#3 0x00007f96921a4f3d in start_thread () from /lib64/libpthread.so.0
#4 0x00007f969183b9af in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7f96916fe100 (LWP 31879)):
#0 0x00007f96921afe8a in raise () from /lib64/libpthread.so.0
#1 0x00000000004807d8 in HTTPClient::Connect(char const*, char const*, char const*, int) ()
#2 0x000000000040bfdd in WhoisOn::PbxPresenceUpdated(std::vector<UserPresence, std::allocator<UserPresence> > const&) ()
#3 0x000000000040d30d in WhoisOn::PbxPresenceUpdated(char const*, IPbxApiPresence*) ()
#4 0x000000000048c289 in PbxApiTaskPresenceSubscription::Message(json_io&, unsigned short, char const*, char const*) ()
#5 0x00000000004617b3 in AppWebsocket::WebsocketRecvResult(IWebsocket*, void*, unsigned long, bool, bool) ()
#6 0x00000000004aace9 in WebserverWebsocketHandler::HandleMessage(IWebserverMessage*, void*, unsigned long) ()
#7 0x00000000004a2779 in WebserverPlugin::SocketRecvResult(ISocket*, void*, unsigned long) ()
#8 0x000000000047ea0b in UDSocket::ReceiveData() ()
#9 0x000000000047eb4d in UDSocket::IoExec(void*) ()
#10 0x000000000045b259 in IoMux::ExecListRun() ()
#11 0x000000000045b6cc in IoMux::Run() ()
#12 0x0000000000409181 in main ()