Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Cannot parse SDP message in python demo #25

Closed
vhdirk opened this issue Jun 21, 2018 · 14 comments
Closed

Cannot parse SDP message in python demo #25

vhdirk opened this issue Jun 21, 2018 · 14 comments

Comments

@vhdirk
Copy link

vhdirk commented Jun 21, 2018

The function SDPMessage.new_from_text does not exist in my case?

res, sdpmsg = GstSdp.SDPMessage.new_from_text(sdp)

What python version is this using? On my system I have python3-gst-1.0 1.14.1-1 (from debian buster)

@sdroege
Copy link
Contributor

sdroege commented Jun 21, 2018

This was just added in GIT master: https://bugzilla.gnome.org/show_bug.cgi?id=796563

It should use the old way in the demos IMHO, want to send a PR? Old way is

    res, msg = GstSdp.SDPMessage.new()
    GstSdp.sdp_message_parse_buffer(bytes(text.encode()), msg)

@vhdirk
Copy link
Author

vhdirk commented Jun 21, 2018

I tried that already, but it's greeting me with a good old:

free(): invalid pointer

@sdroege
Copy link
Contributor

sdroege commented Jun 21, 2018

Can you get a backtrace for that, or even better run in valgrind?

@MathieuDuponchelle, any ideas?

@vhdirk
Copy link
Author

vhdirk commented Jun 21, 2018

Here's backtrace gotten from gdb:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeb0a8700 (LWP 1034)]
[New Thread 0x7fffea433700 (LWP 1036)]
[New Thread 0x7fffe2d37700 (LWP 1039)]
application/x-gst-promise, offer=(GstWebRTCSessionDescription)NULL;
[New Thread 0x7fffe2536700 (LWP 1040)]
[New Thread 0x7fffe1d35700 (LWP 1041)]
[New Thread 0x7fffe1534700 (LWP 1042)]
[New Thread 0x7fffe0d33700 (LWP 1043)]
[New Thread 0x7fffc7fff700 (LWP 1044)]
Sending offer:
v=0
o=- 5987065807280142380 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
m=video 9 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=setup:actpass
a=ice-ufrag:R658jYZB94Yh7oCb8gOS1TBG/YxL+j+Z
a=ice-pwd:CaTpJcYIJRQFS/hr2IwydfmuiLp8wthT
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:97 VP8/90000
a=rtcp-fb:97 nack
a=rtcp-fb:97 nack pli
a=mid:video0
a=fingerprint:sha-256 48:F5:B7:AA:35:38:E8:81:93:7B:10:F1:BE:74:8D:54:EB:8C:51:ED:4D:9B:84:D2:88:4A:EC:B7:7D:7C:2E:00
m=audio 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=setup:actpass
a=ice-ufrag:45tgI956BdVyxu5XNh/rnvDGpPrB+dJR
a=ice-pwd:G4d5/HwQkKp56NwiHl3rhdYZzl6k58oF
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 OPUS/48000/2
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=mid:audio1
a=fingerprint:sha-256 48:F5:B7:AA:35:38:E8:81:93:7B:10:F1:BE:74:8D:54:EB:8C:51:ED:4D:9B:84:D2:88:4A:EC:B7:7D:7C:2E:00

[New Thread 0x7fffc77fe700 (LWP 1045)]
[New Thread 0x7fffc6ffd700 (LWP 1046)]
[New Thread 0x7fffc67fc700 (LWP 1047)]
[New Thread 0x7fffc5ffb700 (LWP 1048)]
[New Thread 0x7fffc57fa700 (LWP 1049)]
[New Thread 0x7fffc4ff9700 (LWP 1050)]
[New Thread 0x7fffa7fff700 (LWP 1051)]
[New Thread 0x7fffa77fe700 (LWP 1052)]
[New Thread 0x7fffa6ffd700 (LWP 1053)]
[New Thread 0x7fffa67fc700 (LWP 1055)]
[New Thread 0x7fffa5ffb700 (LWP 1056)]
[New Thread 0x7fffa57fa700 (LWP 1057)]
Received answer:
v=0
o=- 6985988093201023069 2 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS ly0KJHm5lAKSkd5wtXcjBNUKpD0msAE4Gsav
m=video 9 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:bFQw
a=ice-pwd:91LZHOmu/Zah2EPfBgFKQx6N
a=ice-options:trickle
a=fingerprint:sha-256 C0:23:E9:54:40:53:BF:C5:E0:59:D2:1C:20:FB:69:18:CD:C0:A9:54:C7:0B:8B:BA:81:09:44:85:54:3E:0A:CC
a=setup:active
a=mid:video0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:97 VP8/90000
a=rtcp-fb:97 nack
a=rtcp-fb:97 nack pli
m=audio 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:RfF1
a=ice-pwd:DOk77RF7t4EgtGJSdXqWJy8b
a=ice-options:trickle
a=fingerprint:sha-256 C0:23:E9:54:40:53:BF:C5:E0:59:D2:1C:20:FB:69:18:CD:C0:A9:54:C7:0B:8B:BA:81:09:44:85:54:3E:0A:CC
a=setup:active
a=mid:audio1
a=sendrecv
a=rtcp-mux
a=rtpmap:96 OPUS/48000/2
a=fmtp:96 minptime=10;useinbandfec=1
a=ssrc:1030008169 cname:Y6OCWD9JWJc4H+RE
a=ssrc:1030008169 msid:ly0KJHm5lAKSkd5wtXcjBNUKpD0msAE4Gsav f452f26f-8970-4218-86f0-20060d4fc7a1
a=ssrc:1030008169 mslabel:ly0KJHm5lAKSkd5wtXcjBNUKpD0msAE4Gsav
a=ssrc:1030008169 label:f452f26f-8970-4218-86f0-20060d4fc7a1

double free or corruption (out)

Thread 1 "python3" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff6c4ae7b in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff6c4c231 in __GI_abort () at abort.c:79
#2  0x00007ffff6c8d7b7 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff6d960f3 "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff6c93d5a in malloc_printerr (str=str@entry=0x7ffff6d97de0 "double free or corruption (out)") at malloc.c:5350
#4  0x00007ffff6c95810 in _int_free (av=0x7ffff6fcac40 <main_arena>, p=0x114def0, have_lock=<optimized out>) at malloc.c:4278
#5  0x00007ffff17f4918 in gst_sdp_message_init () at /usr/lib/x86_64-linux-gnu/libgstsdp-1.0.so.0
#6  0x00007ffff17f4d72 in gst_sdp_message_uninit () at /usr/lib/x86_64-linux-gnu/libgstsdp-1.0.so.0
#7  0x00007ffff17f4e8e in gst_sdp_message_free () at /usr/lib/x86_64-linux-gnu/libgstsdp-1.0.so.0
#8  0x00007ffff13a05b2 in gst_webrtc_session_description_free () at /usr/lib/x86_64-linux-gnu/libgstwebrtc-1.0.so.0
#9  0x00007ffff3fed01b in g_boxed_free () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x00007ffff44d70d0 in  () at /usr/lib/python3/dist-packages/gi/_gi.cpython-36m-x86_64-linux-gnu.so
#11 0x0000000000563caa in _PyCFunction_FastCallDict ()
#12 0x000000000058f971 in _PyObject_FastCallDict ()
#13 0x0000000000613843 in  ()
#14 0x000000000055e3e5 in PyObject_CallFinalizerFromDealloc ()
#15 0x0000000000534537 in  ()
#16 0x000000000056fb18 in  ()
#17 0x0000000000585a92 in  ()
#18 0x00000000004f1c20 in _PyEval_EvalFrameDefault ()
#19 0x0000000000585968 in  ()
#20 0x00007ffff4d68ea9 in  () at /usr/lib/python3.6/lib-dynload/_asyncio.cpython-36m-x86_64-linux-gnu.so
#21 0x000000000058f30e in PyObject_Call ()
#22 0x00000000004f1a34 in _PyEval_EvalFrameDefault ()
#23 0x000000000050b495 in  ()
#24 0x000000000050c14d in  ()
#25 0x00000000004f05f9 in _PyEval_EvalFrameDefault ()
#26 0x000000000050b495 in  ()
#27 0x000000000050c14d in  ()
#28 0x00000000004f05f9 in _PyEval_EvalFrameDefault ()
#29 0x000000000050b495 in  ()
#30 0x000000000050c14d in  ()
#31 0x00000000004f05f9 in _PyEval_EvalFrameDefault ()
#32 0x000000000050b495 in  ()
#33 0x000000000050c14d in  ()
#34 0x00000000004f05f9 in _PyEval_EvalFrameDefault ()
#35 0x00000000004ee787 in  ()
#36 0x00000000004efe73 in PyEval_EvalCode ()
#37 0x0000000000637b92 in  ()
#38 0x0000000000637c4a in PyRun_FileExFlags ()
#39 0x0000000000639bf8 in PyRun_SimpleFileExFlags ()
#40 0x000000000062b8fa in Py_Main ()
#41 0x00000000004b2790 in main ()

@sdroege
Copy link
Contributor

sdroege commented Jun 21, 2018

@vhdirk
Copy link
Author

vhdirk commented Jun 21, 2018

When is that due?
Since this is purely documentation, I would only have to regenerate the python bindings?

@sdroege
Copy link
Contributor

sdroege commented Jun 21, 2018

You have to change the GstWebRTC-1.0.gir file for that function and then also regenerate the .typelib file with gobject-introspection.

@sdroege
Copy link
Contributor

sdroege commented Jun 21, 2018

When is that due?

Probably next week

@MathieuDuponchelle
Copy link
Contributor

@sdroege , there's no workaround I can think of no, if it was a (mini)object the refcount could be manipulated from python but that's not the case :(

@sdroege
Copy link
Contributor

sdroege commented Jun 22, 2018

Ok so then this should be documented in the repository :)

@MathieuDuponchelle
Copy link
Contributor

It is: 9a26415 ;)

@sdroege
Copy link
Contributor

sdroege commented Jun 25, 2018

Ok so what has to be done here still is to not use the new API from master (or get it backported for 1.14.2) and then document that 1.14.2 is needed for the Python example. Seems suboptimal to require GIT master :)

MathieuDuponchelle added a commit that referenced this issue Jun 25, 2018
@MathieuDuponchelle
Copy link
Contributor

Closing manually, this is addressed

@Jackovic
Copy link

Jackovic commented Jan 19, 2019

Hello,

I just tried :

$ python3 webrtc-sendrecv.py 7497

But I get :

...
...
...
free(): invalid pointer
Abandon (core dumped)

I am using GStreamer 1.15.1 and I don't know if this issue is fixed or if there is a workaround ?
Any clue ?
Thanks !

Here a backtrace with gdb :

$ gdb python3
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...(no debugging symbols found)...done.
(gdb) run webrtc-sendrecv.py 7497
Starting program: /usr/bin/python3 webrtc-sendrecv.py 7497
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff185f700 (LWP 10767)]
[New Thread 0x7fffe5b6e700 (LWP 10769)]
[New Thread 0x7fffdec88700 (LWP 10770)]
[New Thread 0x7fffde487700 (LWP 10771)]
[New Thread 0x7fffddc86700 (LWP 10772)]
[New Thread 0x7fffdd485700 (LWP 10773)]
[New Thread 0x7fffdcc84700 (LWP 10774)]
[New Thread 0x7fffc7fff700 (LWP 10775)]
[New Thread 0x7fffc77fe700 (LWP 10776)]
[New Thread 0x7fffc69ca700 (LWP 10777)]
[New Thread 0x7fffc61c9700 (LWP 10778)]
[New Thread 0x7fffc59c8700 (LWP 10779)]
[New Thread 0x7fffc51c7700 (LWP 10780)]
[New Thread 0x7fffc49c6700 (LWP 10781)]
Sending offer:
v=0
o=- 2134037024467758539 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
a=group:BUNDLE video0 audio1
m=video 9 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=setup:actpass
a=ice-ufrag:7tUa8voqRVXJ6S9MBe+vqtlK5sbWF8Ip
a=ice-pwd:JKmrqgcsJMVCrKw32oI3+bfF0NQvoES9
a=rtcp-mux
a=rtcp-rsize
a=sendrecv
a=rtpmap:97 VP8/90000
a=rtcp-fb:97 nack pli
a=framerate:30
a=ssrc:3696890204 msid:user302002250@host-1a90e139 webrtctransceiver0
a=ssrc:3696890204 cname:user302002250@host-1a90e139
a=mid:video0
a=fingerprint:sha-256 10:7B:1F:0A:53:96:4C:63:83:3C:0C:AD:5C:C4:E7:24:53:09:A8:B4:1A:30:76:ED:2F:C6:08:16:FB:79:35:18
m=audio 0 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=setup:actpass
a=ice-ufrag:7tUa8voqRVXJ6S9MBe+vqtlK5sbWF8Ip
a=ice-pwd:JKmrqgcsJMVCrKw32oI3+bfF0NQvoES9
a=bundle-only
a=rtcp-mux
a=rtcp-rsize
a=sendrecv
a=rtpmap:96 OPUS/48000/2
a=rtcp-fb:96 nack pli
a=fmtp:96 sprop-maxcapturerate=48000;sprop-stereo=0
a=ssrc:4037710646 msid:user302002250@host-1a90e139 webrtctransceiver1
a=ssrc:4037710646 cname:user302002250@host-1a90e139
a=mid:audio1
a=fingerprint:sha-256 10:7B:1F:0A:53:96:4C:63:83:3C:0C:AD:5C:C4:E7:24:53:09:A8:B4:1A:30:76:ED:2F:C6:08:16:FB:79:35:18

[New Thread 0x7fffaffff700 (LWP 10782)]
Received answer:
v=0
o=- 6794521953566038920 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE video0 audio1
a=msid-semantic: WMS
m=video 9 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:UxlJ
a=ice-pwd:xnCtopozHLxgzpVsg8Ji6oCq
a=ice-options:trickle
a=fingerprint:sha-256 C9:DA:E4:42:4C:F2:82:90:D0:6D:D0:48:23:58:7C:4C:47:23:15:AC:0E:3B:AA:F2:11:0D:C0:D9:D6:9A:64:8F
a=setup:active
a=mid:video0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:97 VP8/90000
a=rtcp-fb:97 nack pli
m=audio 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:UxlJ
a=ice-pwd:xnCtopozHLxgzpVsg8Ji6oCq
a=ice-options:trickle
a=fingerprint:sha-256 C9:DA:E4:42:4C:F2:82:90:D0:6D:D0:48:23:58:7C:4C:47:23:15:AC:0E:3B:AA:F2:11:0D:C0:D9:D6:9A:64:8F
a=setup:active
a=mid:audio1
a=recvonly
a=rtcp-mux
a=rtpmap:96 OPUS/48000/2
a=fmtp:96 minptime=10;useinbandfec=1

double free or corruption (out)

Thread 1 "python3" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff7a22e97 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff7a24801 in __GI_abort () at abort.c:79
#2  0x00007ffff7a6d897 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7b9ab9a "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff7a7490a in malloc_printerr (str=str@entry=0x7ffff7b9c870 "double free or corruption (out)") at malloc.c:5350
#4  0x00007ffff7a7be75 in _int_free (have_lock=0, p=0x1002c60, av=0x7ffff7dcfc40 <main_arena>) at malloc.c:4278
#5  0x00007ffff7a7be75 in __GI___libc_free (mem=0x1002c70) at malloc.c:3124
#6  0x00007ffff013d658 in gst_sdp_message_init (msg=msg@entry=0xfd28b0)
    at gstsdpmessage.c:281
#7  0x00007ffff013dab2 in gst_sdp_message_uninit (msg=msg@entry=0xfd28b0)
    at gstsdpmessage.c:314
#8  0x00007ffff013dbce in gst_sdp_message_free (msg=0xfd28b0) at gstsdpmessage.c:446
#9  0x00007fffebbb3b92 in gst_webrtc_session_description_free (desc=0xfd3780)
    at rtcsessiondescription.c:94
#10 0x00007ffff3d7c1bb in g_boxed_free () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#11 0x00007ffff421efd0 in  ()
    at /usr/lib/python3/dist-packages/gi/_gi.cpython-36m-x86_64-linux-gnu.so
#12 0x0000000000565cda in _PyCFunction_FastCallDict ()
#13 0x00000000005a3761 in _PyObject_FastCallDict ()
#14 0x000000000061a2bd in  ()
#15 0x000000000055e895 in PyObject_CallFinalizerFromDealloc ()
#16 0x0000000000554567 in  ()
#17 0x0000000000586108 in  ()
#18 0x000000000058c702 in  ()
#19 0x0000000000507e02 in _PyEval_EvalFrameDefault ()
#20 0x000000000058c5d8 in  ()
#21 0x00007ffff4a6faf7 in  ()
    at /usr/lib/python3.6/lib-dynload/_asyncio.cpython-36m-x86_64-linux-gnu.so
#22 0x000000000059ebbe in PyObject_Call ()
#23 0x0000000000507c17 in _PyEval_EvalFrameDefault ()
#24 0x0000000000502209 in  ()
#25 0x0000000000502f3d in  ()
#26 0x0000000000506859 in _PyEval_EvalFrameDefault ()
#27 0x0000000000502209 in  ()
#28 0x0000000000502f3d in  ()
#29 0x0000000000506859 in _PyEval_EvalFrameDefault ()
#30 0x0000000000502209 in  ()
#31 0x0000000000502f3d in  ()
#32 0x0000000000506859 in _PyEval_EvalFrameDefault ()
#33 0x0000000000502209 in  ()
#34 0x0000000000502f3d in  ()
#35 0x0000000000506859 in _PyEval_EvalFrameDefault ()
#36 0x0000000000504c28 in  ()
#37 0x0000000000506393 in PyEval_EvalCode ()
#38 0x0000000000634d52 in  ()
#39 0x0000000000634e0a in PyRun_FileExFlags ()
#40 0x00000000006385c8 in PyRun_SimpleFileExFlags ()
---Type <return> to continue, or q <return> to quit---q
Quit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants