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

[BUG] Possible crash while sending crypto keys. #2553

Closed
maxsharabayko opened this issue Nov 25, 2022 · 3 comments · Fixed by #2568
Closed

[BUG] Possible crash while sending crypto keys. #2553

maxsharabayko opened this issue Nov 25, 2022 · 3 comments · Fixed by #2568
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@maxsharabayko
Copy link
Collaborator

A crash in Travis CI was observed once in #2548. The PR itself does not look related to the issue.
There may be a chance it is related to #2541.

[ RUN      ] TestEnforcedEncryption.CASE_D_4_NonBlocking_Enforced_Off_Off_Pwd_None_Set
09:05:31.484224/SRT:RcvQ:w75!W:SRT.cn: @254575997: HS EXT: Agent declares encryption, but Peer does not (Agent can still receive unencrypted packets from Peer).
09:05:31.485487/SRT:RcvQ:w75!W:SRT.cn: @254575997: createSrtHandshake: Agent has PW, but Peer sent no KMREQ. Sending error KMRSP response
Epoll wait result: 1 FOUND: @254575998 in [R]
09:05:31.485936/SRT:RcvQ:w76!W:SRT.cn: @254575999: HS KMREQ: Peer declares encryption, but agent does not - still allowing connection.
09:05:31.485958/SRT:RcvQ:w76!W:SRT.cn: processSrtMsg_KMRSP: received failure report. STATE: NOSECRET
ACCEPT: done, result=254575997
[T] ACCEPT SUCCEEDED: @254575997
/home/travis/.travis/functions: line 109:  7067 Segmentation fault      ./test-srt --gtest_filter="-$TESTS_IPv6"
@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Nov 25, 2022
@maxsharabayko maxsharabayko added this to the v1.6.0 milestone Nov 25, 2022
@maxsharabayko
Copy link
Collaborator Author

Also observed in #2546, Travis, Linux Debug.

TestEnforcedEncryption.CASE_C_1_NonBlocking_Enforced_Off_On_Pwd_Set_Set_Match
Epoll wait result: 1 FOUND: @359828802 in [R]
ACCEPT: done, result=359828801
[T] ACCEPT SUCCEEDED: @359828801
/home/travis/.travis/functions: line 109:  6985 Segmentation fault      ./test-srt --gtest_filter="-$TESTS_IPv6"

@maxsharabayko
Copy link
Collaborator Author

Also observed in #2433 on Travis, Linux Debug.2.

Debug BUILD_OPTS='-DENABLE_LOGGING=OFF -DUSE_ENCLIB=mbedtls -DENABLE_MONOTONIC_CLOCK=ON -DENABLE_BONDING=ON -DCMAKE_CXX_FLAGS="-Werror"'
ReuseAddr.SameAddr2
Bind to: 10.30.0.15:5000
Connecting to: 10.30.0.15:5000
Accepted from: 10.30.0.15:36927
Client exit
Server exit
Bind to: 10.30.0.15:5000
Connecting to: 10.30.0.15:5000
Accepted from: 10.30.0.15:55347
Client exit
Server exit
/home/travis/.travis/functions: line 109:  6975 Segmentation fault      ./test-srt --gtest_filter="-$TESTS_IPv6"

@maxsharabayko
Copy link
Collaborator Author

Master ef17a24, Travis Linux Debug.2.

[ RUN      ] TestEnforcedEncryption.CASE_A_1_Blocking_Enforced_On_On_Pwd_Set_Set_Match
ACCEPT: done, result=560786322
[T] ACCEPT SUCCEEDED: @560786322
/home/travis/.travis/functions: line 109:  6415 Segmentation fault      (core dumped) ./test-srt --gtest_filter="-$TESTS_IPv6"
[New LWP 6432]
[New LWP 6415]
[New LWP 6430]
[New LWP 6435]
[New LWP 6431]
[New LWP 6434]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./test-srt --gtest_filter=-TestMuxer.IPv4_and_IPv6:TestIPv6.v6_calls_v6*:ReuseA'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f5d2d63bd44 in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0
[Current thread is 1 (Thread 0x7f5d2b76f700 (LWP 6432))]
#0  0x00007f5d2d63bd44 in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00000000008acd38 in srt::sync::Mutex::lock (this=0x98) at /home/travis/build/Haivision/srt/srtcore/sync_posix.cpp:220
#2  0x00000000008acd9e in srt::sync::ScopedLock::ScopedLock (this=0x7f5d2b76ec50, m=...) at /home/travis/build/Haivision/srt/srtcore/sync_posix.cpp:236
#3  0x0000000000851f86 in srt::CCryptoControl::sendKeysToPeer (this=0x0, sock=0x7f5d20000978, iSRTT=100000) at /home/travis/build/Haivision/srt/srtcore/crypto.cpp:452
#4  0x0000000000832cfb in srt::CUDT::checkSndTimers (this=0x7f5d20000978) at /home/travis/build/Haivision/srt/srtcore/core.cpp:5894
#5  0x0000000000840e6e in srt::CUDT::checkRexmitTimer (this=0x7f5d20000978, currtime=...) at /home/travis/build/Haivision/srt/srtcore/core.cpp:11184
#6  0x0000000000841258 in srt::CUDT::checkTimers (this=0x7f5d20000978) at /home/travis/build/Haivision/srt/srtcore/core.cpp:11281
#7  0x000000000087d026 in srt::CRcvQueue::worker_ProcessAddressedPacket (this=0x14c5680, id=560786322, unit=0x14d1db8, addr=...) at /home/travis/build/Haivision/srt/srtcore/queue.cpp:1444
#8  0x000000000087c962 in srt::CRcvQueue::worker (param=0x14c5680) at /home/travis/build/Haivision/srt/srtcore/queue.cpp:1219
#9  0x00007f5d2d6396ba in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#10 0x00007f5d2c87951d in clone () from /lib/x86_64-linux-gnu/libc.so.6
  Id   Target Id         Frame 
* 1    Thread 0x7f5d2b76f700 (LWP 6432) 0x00007f5d2d63bd44 in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0
  2    Thread 0x7f5d2da5e740 (LWP 6415) 0x00007f5d2d63a98d in pthread_join () from /lib/x86_64-linux-gnu/libpthread.so.0
  3    Thread 0x7f5d2c771700 (LWP 6430) 0x00007f5d2c83e38d in nanosleep () from /lib/x86_64-linux-gnu/libc.so.6
  4    Thread 0x7f5d29f6c700 (LWP 6435) 0x00007f5d2d64294d in recvmsg () from /lib/x86_64-linux-gnu/libpthread.so.0
  5    Thread 0x7f5d2bf70700 (LWP 6431) 0x00007f5d2d63f360 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
  6    Thread 0x7f5d2af6e700 (LWP 6434) 0x00007f5d2d63f360 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0

@maxsharabayko maxsharabayko changed the title [BUG] TestEnforcedEncryption crash [BUG] Possible crash while sending crypto keys. Jan 6, 2023
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.

1 participant