Diaz diaz
Diaz diaz

Reputation: 284

Fatal signal6 during disposing PeerConnection WebRTC

I am using WebRTC for voice calling everything work fine. When Call hangUp i am disposing the PeerConnection as follows before finishing Call Activity .

 executor.execute(() -> {
        if (peerConnectionFactory != null) {
            peerConnectionFactory.dispose();
            peerConnectionFactory=null;
        }
        if (localPeer != null) {
            localPeer.dispose();
            localPeer=null;
        }
    });

I am getting fatal-signal-6. I have read what-is-fatal-signal-6 . Its says Do not block the UI thread, this can cause a SIGABRT as the OS will kill a non-responsive app . But i am calling it on non Ui thread and still getting the issue.

Fatal signal 6 (SIGABRT) at 0x00007e2f (code=-6), thread 32390 (worker_thread)

Please look into issue.

Upvotes: 1

Views: 1098

Answers (2)

user1942887
user1942887

Reputation: 94

In my case, I called the 'release' function twice in parallel. This caused the crash. Once the two threads were synced, the crash went away.

Upvotes: 0

Diaz diaz
Diaz diaz

Reputation: 284

I was doing wrong during closing the peerConnection . Correct flow of closing connection is below.

 executor.execute(() -> {
            if (peerConnectionFactory != null) {
                peerConnectionFactory.stopAecDump();
            }
            if (localPeer != null) {
                localPeer.dispose();
                localPeer = null;
            }
            if (peerConnectionFactory != null) {
                peerConnectionFactory.dispose();
                peerConnectionFactory = null;
            }
            PeerConnectionFactory.stopInternalTracingCapture();
            PeerConnectionFactory.shutdownInternalTracer();
        });

Upvotes: 1

Related Questions