1

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.

Diaz diaz
  • 284
  • 1
  • 7
  • 21

2 Answers2

1

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();
        });
Diaz diaz
  • 284
  • 1
  • 7
  • 21
  • I tried it your way but I'm still getting a **Fatal signal 11 (SIGSEGV), code 1, fault addr 0xb8 in tid 26448 (Thread-13148)** when calling peerConnectionFactory.dispose() the only difference I can see with your code is that I'm using Kotlin and my peerConnectionFactory is declared as **var peerConnectionFactory: PeerConnectionFactory? = null** so I need the !! operator to access it... Any clues? Do I actually need to call *dispose()* on my peerConnectionFactory? – Jairo Lozano Nov 21 '18 at 20:36
  • Found another thread facing my same situation [here](https://stackoverflow.com/questions/45169413/webrtc-conferencing-1v3-connectionfactory-dispose-crashes), although it has not ben answered yet it gets the exact same error message... – Jairo Lozano Nov 21 '18 at 20:54
0

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.

user1942887
  • 94
  • 1
  • 5