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

Can't make under Windows #1815

Closed
vilkoivshchi opened this issue Feb 17, 2021 · 14 comments · Fixed by #1855
Closed

Can't make under Windows #1815

vilkoivshchi opened this issue Feb 17, 2021 · 14 comments · Fixed by #1855
Assignees
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@vilkoivshchi
Copy link

Hi, can't make under Win10, Visual Studio said:

Error	C2679	binary '<<': no operator found which takes a right-hand operand of type 'const pthread_t' (or there is no acceptable conversion)	srt_virtual	D:\srt-master\srtcore\sync.h	764	

if I change
return str << cid.value;
to
return str << cid;

it works, but only if I make Debug.

If I make Release, app does not accept connection in listener mode.

@vilkoivshchi vilkoivshchi added the Type: Question Questions or things that require clarification label Feb 17, 2021
@maxsharabayko
Copy link
Collaborator

Could you please define which pthread library are you using?
Consider also using C++11 threading with -DENABLE_STDCXX_SYNC=ON CMake build option. See Windows Build Instructions.

@maxsharabayko maxsharabayko self-assigned this Feb 17, 2021
@maxsharabayko maxsharabayko added the [build] Area: Changes in build files label Feb 17, 2021
@maxsharabayko
Copy link
Collaborator

Your error references this code. If pthread-win32 is used, the first if is expected to result to true. Which does not seem to happen in your case.

#if defined(_WIN32) && defined(PTW32_VERSION)
    // This is a version specific for pthread-win32 implementation
    // Here pthread_t type is a structure that is not convertible
    // to a number at all.
    return str << pthread_getw32threadid_np(cid.value);
#else
    return str << cid.value;
#endif

@vilkoivshchi
Copy link
Author

I've installed pthread library through vcpkg.

openssl:x64-windows                                1.1.1i           OpenSSL is an open source project that provides 
pthreads:x64-windows                               3.0.0-6          pthreads for windows

Now i rebuild package:

D:\vcpkg-master>D:\cmake-3.19.5-win64-x64\bin\cmake.exe -DCMAKE_TOOLCHAIN_FILE=D:\\vcpkg-master\\scripts\\buildsystems\\vcpkg.cmake -DENABLE_STDCXX_SYNC=ON -S D:\srt-master -B d:\build

D:\build>d:\cmake-3.19.5-win64-x64\bin\cmake --build .

and when I try to connect to listener in console see:

20:11:48.422000/T1740*E:SRT.cn: processConnectRequest: ROGUE HS RECEIVED. Rejecting

@maxsharabayko
Copy link
Collaborator

Interesting! Would you please collect a wireshark capture of this connection?
Could you also share the command line you use to establish a connection for us to be able to reproduce it?
Do both peers have the same SRT version and built the same way? Are both located on the same or different Windows michenes?

@vilkoivshchi
Copy link
Author

I have both Windows machines.
In listener side Win10 Pro x64 1909 18363.1379
In caller side I usually use Win 10 Pro with VLC v3.0.11, sometimes Larix for IOS, sometimes Larix for Android.
Command for listener:
srt-live-transmit.exe -v udp://233.155.16.250:10000?adapter=192.168.190.55 srt://0.0.0.0:5000?mode=listener&passphrase=1234567890!
Listener have two NIC's.
In VLC at caller side:
srt://192.168.10.92:5000
Passphrase set in VLC settings.

Wireshark pcap:
srt.zip

BTW:
I've delete cache and rebuild:

D:\cmake-3.19.5-win64-x64\bin\cmake.exe -G"Visual Studio 16 2019" -A x64 -S D:\srt-master -B D:\build -DCMAKE_TOOLCHAIN_FILE=D:\vcpkg-master\scripts\buildsystems\vcpkg.cmake

D:\build>D:\cmake-3.19.5-win64-x64\bin\cmake.exe --build .

i.e. only with Cmake. App was build and work with VLC, but when I try to connect with Larix or srt-live-transmit (who has just assembled) caller mode with args:
srt-live-transmit.exe -v srt://192.168.10.92:5000 "udp://224.1.1.2:5000?pkt_size=1316&passphrase=1234567890!"
caller's app crashing

@maxsharabayko
Copy link
Collaborator

From Wireshark capture caller sends the final conclusion handshake request (ready to establish a connection), but listener never replies with conclusion response. Instead induction responce is being sent for the whole time (every 3 seconds for 80 seconds of the capture).
SRT Socket ID 0x34F469C9 - might be related to #1816.

Regarding crash, also interesting. The third problem already :)
IT might help if you could share the binary.
Do I understand correctly, that when you try connecting srt-live-transmit listener with VLC v3.0.11 caller - srt-live-transmit crashes?

@maxsharabayko maxsharabayko added [core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior and removed Type: Question Questions or things that require clarification [build] Area: Changes in build files labels Feb 18, 2021
@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Feb 18, 2021
@vilkoivshchi
Copy link
Author

I can make Wireshark captures from both sides if it necessary.

About crashes:
srt-live-transmit.exe -v srt://192.168.10.92:5000 "udp://224.1.1.2:5000?pkt_size=1316&passphrase=1234567890!"
and VLC as caller work fine.
Crashes happen if I trying to connect to listener from Larix IOS or srt-live-transmit as caller.

binaries:
debug.zip

@maxsharabayko
Copy link
Collaborator

Using the binaries you've provided I ran a test on a localhost:

# SRT caller
 .\srt-live-transmit.exe -v "srt://127.0.0.1:4200?pkt_size=1316&passphrase=1234567890!" "udp://127.0.0.1:4201"

# SRT Listener
./srt-live-transmit.exe -v "udp://:4202" "srt://:4200?mode=listener&passphrase=1234567890!"

Connection is established.

What would be the steps to reproduce the crash?

Crashes happen if I trying to connect to listener from Larix IOS or srt-live-transmit as caller.

So using the same build of srt-live-transmit as a caller on another Windows machine?
What is the RTT of your link?

Could you contact me in the #development channel on Slack?

@ethouris
Copy link
Collaborator

@vilkoivshchi just in case, please retest the latest version. The fix for the socket ID check is there.

@vilkoivshchi
Copy link
Author

I've build latest version (commit 1c7da11) with option -DENABLE_STDCXX_SYNC=ON and it work good. Connecting and no crashes. Thank you.

@maxsharabayko
Copy link
Collaborator

A small update on this.

I had missed it the first time, but VLC has HSv4 (some SRT version prior to v1,3.0). That might explain something...
So I've checked with SRT commit 3754562 (before the fix).
No crash, but seeing this error messages.

15:36:02.648000/T1376*E:SRT.cn: processConnectRequest: ROGUE HS RECEIVED. Rejecting
15:36:02.898000/T1376*E:SRT.cn: processConnectRequest: ROGUE HS RECEIVED. Rejecting
15:36:03.150000/T1376*E:SRT.cn: processConnectRequest: ROGUE HS RECEIVED. Rejecting

Just as they were reported here.

I can reproduce the crash using srt-live-tranmsit binaries provided earlier by @vilkoivshchi .
However there is no PDB file for debugging supplied.

Need SRT version (commit ID) used to build those binaries and build instructions. I assume some build instructions are shared here.
SRT commit ID is what's missing.

@ethouris

This comment has been minimized.

@maxsharabayko
Copy link
Collaborator

Status update

1. Crash Reported

Status: the assumption is that the current master does not have the crash. Waiting for @vilkoivshchi to confirm.

A pre-built srt-live-transmit was shared by @vilkoivshchi in slack.
The crash is 100% reproducible with that build. It happens in an attempt to write an error log message.

The crash itself happens due to an infinite recursive call to this function

template <class Stream>
inline Stream& operator<<(Stream& str, const CThread::id& cid)
{
#if defined(_WIN32) && defined(PTW32_VERSION)
    // This is a version specific for pthread-win32 implementation
    // Here pthread_t type is a structure that is not convertible
    // to a number at all.
    return str << pthread_getw32threadid_np(cid.value);
#else
    return str << cid.value;
#endif
}

However, the function used in the pre-built version seems to be modified, as the debugger complains about mismatching file sync.h. I can assume it was modified because of the initial build issues reported.
Waiting for @vilkoivshchi to confirm.

2. Build Issue

Reproduction steps are missing.
@vilkoivshchi Could you please define which pthread version to use to get the build error? Is it pthreads from vcpkg?

@maxsharabayko
Copy link
Collaborator

Confirmed Windows build issue with latest pthreads from vcpkg:

  • vcpkgversion 2021-01-13-d67989bce1043b98092ac45996a8230a059a2d7e
  • pthreads:x64-windows 3.0.0-6 pthreads for windows
    Version: 3.0.0-6
    Homepage: https://sourceware.org/pub/pthreads-win32/
    Description: pthreads for windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants