Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segmentaion fault #55

Open
bobdog6861 opened this issue Sep 29, 2017 · 4 comments
Open

segmentaion fault #55

bobdog6861 opened this issue Sep 29, 2017 · 4 comments

Comments

@bobdog6861
Copy link

valgrind says:

CreateMediaStream
TestChannel[ Call[C02e1f8fb1]-EP[L22cf95bf2] - 0x3c0550f0 ]
assert.cxx(112) PWLib Assertion fail: Attempt to do simultaneous reads from multiple threads: os_handle=24, thread ID=0x1f385700, file ptlib/unix/channel.cxx, line 110OnOpenMediaStream
recording media from local

TestPhone::Main: calling "sip:403#######@192.168.0.12" for 10
Assertion fail: Attempt to do simultaneous reads from multiple threads: os_handle=24, thread ID=0x1f385700, file ptlib/unix/channel.cxx, line 110

I have the latest version of ptlib_dev, any ideas ?

@S-trace
Copy link

S-trace commented Nov 20, 2017

Try this patch:

Author: S-trace <[email protected]>
Date:   Mon Nov 20 16:19:56 2017 +0300

    [CHANNELS] Update written value before CollectAverage call

    Fixes possible SIGSEGV crashes

diff --git a/src/channels.cpp b/src/channels.cpp
index 660800e..edc680a 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -460,9 +460,9 @@ bool RawMediaStream::WriteData(const BYTE *data,
             cout << "silence write failed!" << endl;
             return false;
         }
+        written = m_channel->GetLastWriteCount();
         CollectAverage(silence, written);
     }
-    written = m_channel->GetLastWriteCount();
     // cout << "wrote " << written << endl;
     return true;
     //return OpalRawMediaStream::WriteData(data, length, written);

@ghost
Copy link

ghost commented Nov 30, 2017

I was facing the same issue. This solved it for me

@M3d1c5
Copy link

M3d1c5 commented Jan 20, 2018

This patch solved it for me, too.

@Race666
Copy link

Race666 commented Apr 26, 2019

Same here. Thx.

mwessen added a commit to mwessen/sipcmd that referenced this issue May 11, 2019
tmakkonen added a commit that referenced this issue Aug 5, 2019
Solved issue #55 using patch suggested by S-trace on 20 Nov 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants