# Why wait indefinitely for a pipe in a DestroyZoomVideoSDKObj call

**URL:** <https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166>\
**Category:** Linux\
**Created:** [February 5, 2024, 2:42am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166 "2024-02-05T02:42:08Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://devforum.zoom.us/u/Wang)\
**Post date:** [February 5, 2024, 2:42am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/1 "2024-02-05T02:42:08Z")

</div>

@ chunsiong.zoom When I call DestroyZoomVideoSDKObj on the main thread, the main thread gets stuck.  
It can be found from the stack that it is waiting indefinitely to read a pipeline message and has not been able to receive the message, so it has been stuck there.  
Can you help analyze the reason for waiting indefinitely to read the pipeline message when releasing the object? Can we not wait indefinitely to read this pipe? The current version of SDK is 1.8.10. In addition, I tried to upgrade the SDK to 1.10.5, and the version higher than 1.8 will cause a segment error in the SSL inside my QNetworkManager.

#0 0x00007ffff6f19aff in \_\_GI\_\_\_poll (fds=0x7fffffffc1c0, nfds=1, timeout=-1) at …/sysdeps/unix/sysv/linux/poll.c:29  
#1 0x00007fffc9cbfa3c in ssb::notifier\_pipe\_t::wait(int, bool) () from lib/libvideosdk.so.1  
#2 0x00007fffc9ca4f7b in ssb::msg\_queue\_t::send\_msg(ssb::msg\_it\*, ssb::msg\_queue\_sink\_it\*, int) () from lib/libvideosdk.so.1  
#3 0x00007fffc9caf94a in ssb::thread\_wrapper\_t::stop() () from lib/libvideosdk.so.1  
#4 0x00007fffc9cafba7 in ssb::thread\_io\_t::stop() () from lib/libvideosdk.so.1  
#5 0x00007fffc9cb32e1 in ssb::thread\_mgr\_t::stop\_threads\_by\_type(unsigned int) () from lib/libvideosdk.so.1  
#6 0x00007fffc9c134ca in ssb::dns\_provider\_t::stop() () from lib/libvideosdk.so.1  
#7 0x00007fffc9bfb90e in tp\_uninit () from lib/libvideosdk.so.1  
#8 0x00007fffc8d45ed5 in CSBWebServiceModuleClient::~CSBWebServiceModuleClient() () from lib/libvideosdk.so.1  
#9 0x00007fffc8d45fe9 in CSBWebServiceModuleClient::~CSBWebServiceModuleClient() () from lib/libvideosdk.so.1  
#10 0x00007fffc8d45b2b in TermWebServiceModule () from lib/libvideosdk.so.1  
#11 0x00007fffc82afa4a in ZOOMLITESDK::iOSZoomRTCModuleMgr::UnloadInternal(bool) () from lib/libvideosdk.so.1  
#12 0x00007fffc82ae4a3 in ZOOMLITESDK::CZoomRTCModuleMgr::Unload(bool) () from lib/libvideosdk.so.1  
#13 0x00007fffc82a385c in ZOOMLITESDK::CZoomLITESDKContext::Uninit() () from lib/libvideosdk.so.1  
#14 0x00007fffc82a0aeb in ZOOMLITESDK::CZoomRTCMgr::Shutdown(bool) () from lib/libvideosdk.so.1  
#15 0x00007fffc82a0c30 in ZOOMLITESDK::CZoomRTCMgr::Cleanup() () from lib/libvideosdk.so.1  
#16 0x00007fffc829484b in ZOOMVIDEOSDK::ZoomVideoSDK::UNInitialize() () from lib/libvideosdk.so.1  
#17 0x00007fffc8296fb2 in ZOOMVIDEOSDK::ZoomVideoSDK::~ZoomVideoSDK() () from lib/libvideosdk.so.1  
#18 0x00007fffc8297159 in ZOOMVIDEOSDK::ZoomVideoSDK::~ZoomVideoSDK() () from lib/libvideosdk.so.1  
#19 0x00007fffc8298e06 in DestroyZoomVideoSDKObj () from lib/libvideosdk.so.1

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 7, 2024, 4:32am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/2 "2024-02-07T04:32:26Z")

</div>

@Wang ,

I’ve just tried something like this

```auto
void my_handler(int s)
{
	printf("\nCaught signal %d\n", s);
	
	printf("\Leaving Session\n");
	video_sdk_obj->leaveSession(false);
	printf("\Left Session\n");
	
	printf("\Cleaning up SDK\n");
	video_sdk_obj->cleanup();
	printf("\Cleaned up SDK\n");

	printf("\Destroying SDK Object\n");
	DestroyZoomVideoSDKObj();
	printf("\Destroyed SDK Object\n");
}

.
.
.
.
.

//in the main thread
	struct sigaction sigIntHandler;

	sigIntHandler.sa_handler = my_handler;
	sigemptyset(&sigIntHandler.sa_mask);
	sigIntHandler.sa_flags = 0;

	sigaction(SIGINT, &sigIntHandler, NULL);

	loop = g_main_loop_new(NULL, FALSE);

	// add source to default context
	g_timeout_add(100, timeout_callback, loop);
	g_main_loop_run(loop);
	return 0;

```

---

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://devforum.zoom.us/u/Wang)\
**Post date:** [February 7, 2024, 8:05am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/3 "2024-02-07T08:05:01Z")

</div>

Both cleanup and DestroyZoomVideoSDKObj wait for this pipe. DestroyZoomVideoSDKObj calls cleanup internally, and then deletes an object more than cleanup does.

---

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://devforum.zoom.us/u/Wang)\
**Post date:** [February 19, 2024, 5:59am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/4 "2024-02-19T05:59:00Z")

</div>

I’ve tried to test it 25 times, and I’ve stuck once and crashed four times. Please also help analyze and locate the problem.  
The crash stack is as follows:

Core was generated by `./zoom\_v-sdk\_linux\_bot’.  
Program terminated with signal SIGSEGV, Segmentation fault.  
#0 0x00007f6313d681ca in ssb::thread\_mgr\_t::find\_by\_type(unsigned int) const () from libvideosdk.so.1  
[Current thread is 1 (Thread 0x7f630b05c9c0 (LWP 8888))]  
(gdb) bt  
#0 0x00007f6313d681ca in ssb::thread\_mgr\_t::find\_by\_type(unsigned int) const () from libvideosdk.so.1  
#1 0x00007f6313d68bbe in ssb::thread\_mgr\_t::stop\_threads\_by\_type(unsigned int) () from libvideosdk.so.1  
#2 0x00007f6313cc1c57 in ssb::dns\_provider\_t::~dns\_provider\_t() () from libvideosdk.so.1  
#3 0x00007f6313cc1ce9 in ssb::dns\_provider\_t::~dns\_provider\_t() () from libvideosdk.so.1  
#4 0x00007f6313caf894 in ssb::singleton\_t\<ssb::dns\_provider\_t, ssb::thread\_mutex\_recursive\>::reset\_all() () from libvideosdk.so.1  
#5 0x00007f6313d5ef23 in ssb::singleton\_life\_t::cleanup() () from libvideosdk.so.1  
#6 0x00007f6313d74913 in util\_uninit () from libvideosdk.so.1  
#7 0x00007f6313d74961 in _sdk\_global\_exit_ () from libvideosdk.so.1  
#8 0x00007f6312031ebc in ZOOMVIDEOSDK::ZoomVideoSDK::UNInitialize() () from libvideosdk.so.1  
#9 0x00007f6312031ff9 in ZOOMVIDEOSDK::ZoomVideoSDK::cleanup() () from libvideosdk.so.1  
#10 0x00005631524cb1bd in destroySDKObj () at /home/wangsheng/zoomvideodemo/videosdk-linux-raw-recording-sample-main/src/zoom\_v-sdk\_linux\_bot.cpp:388  
#11 0x00005631524d0958 in ZoomVideoSDKDelegate::onSessionLeave (this=0x56315430f220) at /home/wangsheng/zoomvideodemo/videosdk-linux-raw-recording-sample-main/src/zoom\_v-sdk\_linux\_bot.cpp:130  
#12 0x00007f6312031daf in ZOOMVIDEOSDK::ZoomVideoSDK::onConferenceLeftNotification() () from libvideosdk.so.1  
#13 0x00007f6312054970 in ZOOMVIDEOSDK::CZoomLiteRTCConfStatusHandler::ProcConferenceLeftNotification(bool) () from libvideosdk.so.1  
#14 0x00007f63120cc28b in ZMMeetingBridgeAsyncHelper::RunDelayTaskList(bool) () from libvideosdk.so.1  
#15 0x00007f63120cc587 in non-virtual thunk to ZMMeetingBridgeAsyncHelper::OnTimer(void\*, unsigned int, unsigned int, unsigned long) () from libvideosdk.so.1  
#16 0x00007f6311fe31ee in Cmm::GLIBTimer\_Notify(void\*) () from libvideosdk.so.1  
#17 0x00007f6310a6dbe8 in ?? () from /lib/x86\_64-linux-gnu/libglib-2.0.so.0  
#18 0x00007f6310a6d04e in g\_main\_context\_dispatch () from /lib/x86\_64-linux-gnu/libglib-2.0.so.0  
#19 0x00007f6310a6d400 in ?? () from /lib/x86\_64-linux-gnu/libglib-2.0.so.0  
#20 0x00007f6310a6d6f3 in g\_main\_loop\_run () from /lib/x86\_64-linux-gnu/libglib-2.0.so.0  
#21 0x00005631524cd3da in main (argc=1, argv=0x7ffe905fce18) at /home/wangsheng/zoomvideodemo/videosdk-linux-raw-recording-sample-main/src/zoom\_v-sdk\_linux\_bot.cpp:680

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 19, 2024, 6:12am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/5 "2024-02-19T06:12:57Z")

</div>

@Wang , are you able to capture the SDK log during the crash, and upload it somewhere?

---

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://devforum.zoom.us/u/Wang)\
**Post date:** [February 20, 2024, 2:43am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/6 "2024-02-20T02:43:30Z")

</div>

Can you please give me your email? I’ll email you.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 23, 2024, 4:43am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/7 "2024-02-23T04:43:41Z")

</div>

@Wang I’m creating a ticket from my side. I’ll provide you with updates here

ZSEE-120336

---

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://devforum.zoom.us/u/Wang)\
**Post date:** [February 25, 2024, 4:56pm UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/8 "2024-02-25T16:56:04Z")

</div>

- tan:
- 
  - Thank you for your help!Due to the fact that the OpenSSL version in my current environment is 1.1.1, I am using SDK1.8.10. How can I get your updates? I don’t know what ZSEE-120336 is.

Chun Siong (tag me for response) via Zoom Developer Forum \<[notifications@zoomdeveloper.discoursemail.com](mailto:notifications@zoomdeveloper.discoursemail.com)\> 于2024年2月23日周五 12:53写道：

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 26, 2024, 6:29am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/9 "2024-02-26T06:29:50Z")

</div>

@Wang ， do you have a portion of the code on how you are calling DestroyZoomVideoSDKObj? We are trying to replicate this on our side

---

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://devforum.zoom.us/u/Wang)\
**Post date:** [February 26, 2024, 7:00am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/10 "2024-02-26T07:00:21Z")

</div>

```auto
void destroySDKObj()
{
    if(video_sdk_obj)
    {
        video_sdk_obj->cleanup();
        std::cout << "clearn up" << std::endl;
        DestroyZoomVideoSDKObj();
        std::cout << "destory" << std::endl;
        video_sdk_obj = nullptr;
    }
}

/// \brief Triggered when session leaveSession
virtual void onSessionLeave()
{
    g_main_loop_unref(loop);
    std::cout << __PRETTY_FUNCTION__ << " Already left session" << std::endl;
    destroySDKObj();
    exit(1);
};

```

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 27, 2024, 6:47am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/11 "2024-02-27T06:47:29Z")

</div>

@Wang ,

I’ve checked with our team, it might not be suitable to destroy the sdk obj in onSessionLeave. Is it possible to call it in other methods instead?

---

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://devforum.zoom.us/u/Wang)\
**Post date:** [February 27, 2024, 9:08am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/12 "2024-02-27T09:08:14Z")

</div>

The following is for use in a real development environment without releasing SDK resources in onLeaveSession.The program will still crash or get stuck.

```auto
MainWindow::on_pushButton_Quit()
{
    ReleaseResourceService releaseService;
}

ReleaseResourceService::ReleaseResourceService(QObject *parent) :
    QObject(parent)
{
    bool waitHangup = SharedSingleton<ZoomTeleMedicine>::getInstance()->meetingStatus() >= ZOOMJOINING; 
    ZoomListenerWatcher *zoomListenerWatcher = dynamic_cast<ZoomListenerWatcher*>(SharedSingleton<ZoomVideoService>::getInstance()->getListenerWatcher()); // get zoomdelegate listener
    if(waitHangup)
    {
        if(zoomListenerWatcher)
        {
            connect(zoomListenerWatcher, &ZoomListenerWatcher::notifyLocalUserLeave, this, [=](const QString &userId, const QString &userName){
                //This is entered when onSessionLeave is triggered
                Q_UNUSED(userId);
                Q_UNUSED(userName);
                exitWatcher->notify(NO_ERR, "", ""); //Notifies to exit the event loop
            });
            connect(zoomListenerWatcher, &ZoomListenerWatcher::notifyError, this, [=](int errorCode, int detailErrorCode){
                //This is entered when onError is triggered
                Q_UNUSED(errorCode);
                Q_UNUSED(detailErrorCode);
                exitWatcher->notify(NO_ERR, "", ""); //Notifies to exit the event loop
            });
            QEventLoop loop;
            connect(exitWatcher.get(), &ExitWatcher::notifyEixt, &loop, &QEventLoop::quit); 
            if(SharedSingleton<ZoomTeleMedicine>::getInstance()->hangUpCall()) 
            {
                loop.exec(); //Wait for exit notice
            }
        }
    }
    SharedSingleton<ZoomVideoService>::getInstance()->unInit(); // call release zoom video sdk
}

```

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 28, 2024, 6:43am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/13 "2024-02-28T06:43:42Z")

</div>

@Wang ,

do you have the logs captured for this implementation?

---

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://devforum.zoom.us/u/Wang)\
**Post date:** [March 5, 2024, 7:04am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/14 "2024-03-05T07:04:29Z")

</div>

@chunsiong.zoom I sent you an email and asked you to help analyze it.

---

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://devforum.zoom.us/u/Wang)\
**Post date:** [March 15, 2024, 3:10am UTC](https://devforum.zoom.us/t/why-wait-indefinitely-for-a-pipe-in-a-destroyzoomvideosdkobj-call/103166/15 "2024-03-15T03:10:35Z")

</div>

@chunsiong.zoom Have there been any new findings in the analysis of program crashes and freezing issues?
