[Live-devel] Crash with camera and bad network condition

Eric Beuque eric.beuque at seek-one.fr
Tue Sep 16 01:03:23 PDT 2025


Hello,

I'm in a scenario with very bad network conditions on IP cameras.

I found a random crash on Windows on the decodUrl function calling on
assert function because isxdigit function implementation on Windows
requires values between -1 and 255..

It seems sometimes i lost packet and data come not correctly.

I reproduce the assertion on Linux by modif with the call to isxdigit by
p_isxdigit.

static int p_isxdigit( int ch )
{
  assert(ch >= -1 && ch <= 255);
  return isxdigit(ch);
}

Here a sample of printed data i received.

R�"P~ @ c�� ���� q�3RS�ZS�� � �� [H��u�{{� [\#s��'?�4V��������� ��
���\2ER7�X^:e� ��]�p ��Z�C��p[�M�������I� ��D0D��Po�"��n�R� � � ����gr-;�(
P�/S ,f�R� ��2� ����nt��a�����C< x��2F�" �Q�W����� yr q��a
4 \s#�� !u��� � �( KA | p�]RH�!�G]0.����� ��68%�Ct ��_�+�L���F����5m��bZP�
lV���N����2qN~�rZ?�Y� ��R�vZ�:�� M�ku���A���5~��|���� �2�� ����/
u"���`5����)�?�\ Sl�*� �(�! �� ����e=�T������f����O��6 �)'�9 e�R ��
��4�q�#;��~���� �_ ��C��lYD����AP �s�V��RTSP/1.0 200 OK
CSeq: 12
Public: OPTIONS, DESCRIBE, PLAY, PAUSE, SETUP, TEARDOWN, SET_PARAMETER,
GET_PARAMETER
Date:  Mon, Sep 15 2025 16:53:45 GMT

I understand we come here because be found an RTSP/ string and before it a
/ in the parseRTSPRequestString.

I think we can fix the assertion by forcing the call to isxdigit(cursor[1])
by isxdigit((char)cursor[1]), but I don't know if something should be done
before that, to prevent further problems.

Here my program backtrace.

(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized
out>) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at
./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo at entry=6) at
./nptl/pthread_kill.c:89
#3  0x00007ffff164527e in __GI_raise (sig=sig at entry=6) at
../sysdeps/posix/raise.c:26
#4  0x00007ffff16288ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff162881b in __assert_fail_base (fmt=0x7fffd95ad446
"%s%s%s :%u : %s%s l'assertion « %s » a échoué.\n%n",
assertion=assertion at entry=0x7ffff7da728f "ch >= -1 && ch <= 255",
file=file at entry=0x7ffff7da7280 "RTSPCommon.cpp", line=line at entry=31,
function=function at entry=0x7ffff7da726c "int p_isxdigit(int)") at
./assert/assert.c:96
#6  0x00007ffff163b517 in __assert_fail (assertion=0x7ffff7da728f "ch >= -1
&& ch <= 255", file=0x7ffff7da7280 "RTSPCommon.cpp", line=31,
function=0x7ffff7da726c "int p_isxdigit(int)") at ./assert/assert.c:105
#7  0x00007ffff7d5c69c in p_isxdigit (ch=-58) at RTSPCommon.cpp:31
#8  0x00007ffff7d5c703 in decodeURL (url=0x7ffeed7e9391
"%\306Ct\002\355\315_\247+\257Lݖ\227F\3005m\232\312bZP\312\017lV\263\362\351N\271\214\206\2452qN~\361rZ?\304Y\231\035\004\024\342\367R\266vZ4\b\346:\233\317\001M\353kuޖ\200A\371>\260\2635~\243\374|\216\372\242\206\033\3522\275\317\025\316嬖")
at RTSPCommon.cpp:40
#9  0x00007ffff7d5cca4 in parseRTSPRequestString (reqStr=0x7ffee0010a70
"R\322\"P~\016@\vc\342\310\030ƿ\335\307\177q\2473RS\327ZS\236\325\006\344\020\326\300\002[H\241\313u\230{{\274\v[\\#s\256\204'?\3114V᷍\217\271\221\222\231\317\037\024\256\210\027\020·\315\\2ER7\224X^:e\226\003\372\375]\242p\032\303\302Z",
reqStrSize=615, resultCmdName=0x7ffeed7e9260
"R\322\"P~\016@\vc\342\310\030ƿ\335\307\177q\2473RS\327ZS\236\325\006\344\020\326\300\002[H\241\313u\230{{\274\v[\\#s\256\204'?\3114V᷍\217\271\221\222\231\317\037\024\256\210\027\020·\315\\2ER7\224X^:e\226\003\372\375]\242p\032\303\302Z",
resultCmdNameMaxSize=200, resultURLPreSuffix=0x7ffeed7e9330 "
\226\2162\231\017\341\262ܳnt\342\372a\203\362\220\326\332C<\003x\270>\2642F\374\"\177\023\272Q\212W\302\324ʝ\352\ayr\027q\232\260a\n4\023\\s#\370\227\006!u\340\325\337\v\314\002\305(\026KA\034|\033p\276]RH\335!\346G]0.\245\363\302ƿ\026\346\21368%\306Ct\002\355\315_\247+\257Lݖ\227F\3005m\232\312bZP\312\017lV\263\362\351N\271\214\206\2452qN~\361rZ?\304Y\231\035\004\024\342\367R\266vZ4\b\346:\233\317\001M\353kuޖ\200A\371>\260\2635~\243\374|\216\372\242\206\033\3522\275\317\025\316嬖",
resultURLPreSuffixMaxSize=200, resultURLSuffix=0x7ffeed7e9400
"\au\"\276ț`5\232\225\202\234)\334?\203\\\021\030Sl\235*\351\032\314(\237!\005\351\250\030\262\247\236\213e=\356T\375\245\260\301\300\330f\230\205\267\253O\214\3176\027\351)'\3049
e\224R\022\210\260\003\261\2074\270q\334#;\351\323~\353\270\361\221\034\301_\005\242\230C\300\273lYD\361ک\232AP\030\371s\361V\276\245",
resultURLSuffixMaxSize=200, resultCSeq=0x7ffeed7e94d0 " ",
resultCSeqMaxSize=200, resultSessionIdStr=0x7ffeed7e95a0
"\200}\020\340\376\177", resultSessionIdStrMaxSize=200,
contentLength=@0x7ffeed7e925c: 32766, urlIsRTSPS=@0x7ffeed7e925b: 0 '\000')
at RTSPCommon.cpp:156
#10 0x00007ffff7d57b52 in RTSPClient::handleIncomingRequest
(this=0x7ffee001bff0) at RTSPClient.cpp:1099
#11 0x00007ffff7d5a59e in RTSPClient::handleResponseBytes
(this=0x7ffee001bff0, newBytesRead=1) at RTSPClient.cpp:1796
#12 0x00007ffff7d5946d in RTSPClient::handleAlternativeRequestByte1
(this=0x7ffee001bff0, requestByte=10 '\n') at RTSPClient.cpp:1494
#13 0x00007ffff7d593bf in RTSPClient::handleAlternativeRequestByte
(rtspClient=0x7ffee001bff0, requestByte=10 '\n') at RTSPClient.cpp:1480
#14 0x00007ffff7d44038 in SocketDescriptor::tcpReadHandler1
(this=0x7ffee000b1b0, mask=2) at RTPInterface.cpp:563
#15 0x00007ffff7d43e37 in SocketDescriptor::tcpReadHandler
(socketDescriptor=0x7ffee000b1b0, mask=2) at RTPInterface.cpp:517
#16 0x00007ffff7c37e15 in BasicTaskScheduler::SingleStep
(this=0x7ffee001afc0, maxDelayTime=0) at BasicTaskScheduler.cpp:171
#17 0x00007ffff7c36790 in BasicTaskScheduler0::doEventLoop
(this=0x7ffee001afc0, watchVariable=0x7ffee001af40 "") at
BasicTaskScheduler0.cpp:87
#18 0x0000555555e7f526 in LiveMediaAccessModuleContext::start
(this=0x7ffee001ae30, szMRL=0x7ffee4002560 "rtsp://
192.168.100.27/Streaming/channels/101",

Regard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20250916/2bc2dcd0/attachment.htm>


More information about the live-devel mailing list