Parrot-Developers / olympe

Python controller library for Parrot Drones
https://developer.parrot.com/docs/olympe/index.html
BSD 3-Clause "New" or "Revised" License
80 stars 36 forks source link

Fatal Python error: Segmentation fault when using set_streaming_callbacks #7

Closed Baptiste-Pollien closed 5 years ago

Baptiste-Pollien commented 5 years ago

I just installed the version 1.0.1 of olympe and I tried the example code from the documentation.

Sometime this work it works normally, but other time I get this error.

I pdraw_session: state change to OPENING
I pdraw_element: 'StreamDemuxerNet': element state change to CREATED
I pdraw_element: 'StreamDemuxerNet': element state change to STARTING
I rtsp_client: connecting to address 10.202.0.1 port 554
I pdraw_element: 'StreamDemuxerNet': element state change to STARTED
I pdraw_session: state change to OPENED
04/07/2019 14:13:28.807233  _open_url                       Opening pdraw url OK: b'rtsp://10.202.0.1/live'
I rtsp_client: client connected
I pdraw_dmxstrm: RTSP connected
I rtsp_client: send RTSP request OPTIONS: cseq=1 session=-
E pdraw_dmxstrmnet: getSingleStreamLocalStreamPort:231: invalid stream socket err=71(Protocol error)
E pdraw_dmxstrmnet: getSingleStreamLocalControlPort:246: invalid control socket err=71(Protocol error)
I rtsp_client: response to RTSP request OPTIONS: status=200(OK) cseq=1 session=- req_status=OK
Takeoff if necessary...
I rtsp_client: send RTSP request DESCRIBE: cseq=2 session=-
I rtsp_client: response to RTSP request DESCRIBE: status=200(OK) cseq=2 session=- req_status=OK
04/07/2019 14:13:28.809995  _select_demuxer_media           _select_demuxer_media: idx=0 media_id=1 name=DefaultVideo default=True
I pdraw_dmxstrm: application selected media 1 (DefaultVideo)
I rtsp_client: send RTSP request SETUP: cseq=3 session=-
04/07/2019 14:13:28.815323  _send_command                   Ardrone3.Piloting.TakeOff(): has been sent asynchronously
04/07/2019 14:13:28.891328  _recv_cmd_cb                    common.RunState.RunIdChanged(runId='72B139')
I rtsp_client: response to RTSP request SETUP: status=200(OK) cseq=3 session=272db5c0c598246a req_status=OK
I rtsp_client: client session 272db5c0c598246a added
04/07/2019 14:13:28.943331  _ready_to_play                  _ready_to_play(1) called
I rtsp_client: send RTSP request PLAY: cseq=4 session=272db5c0c598246a
I rtsp_client: response to RTSP request PLAY: status=200(OK) cseq=4 session=272db5c0c598246a req_status=OK
I vstrm: receiver: init_source: ssrc=0x2b86acc6 seq=0
I vstrm: receiver: init_seq: seq=0
I pdraw_dmxstrm: new output media
I pdraw_source: 'StreamDemuxerNet': add port for media id=1 type=VIDEO
I vdec_ffmpeg: libavcodec version=57.89.100 - using CPU H.264 decoding
I pdraw_element: 'AvcDecoder': element state change to CREATED
I pdraw_sink: 'AvcDecoder': link media id=1 type=VIDEO
I pdraw_element: 'AvcDecoder': element state change to STARTING
I vdec: dimensions: width=1280 height=720 SAR=1:1
I vdec: crop: left=0 top=0 width=1280 height=720
I vdec: declared framerate: 30000/1001 -> 29.970 fps
I vdec: declared NAL bitrate: 5000000 bit/s (CPB size 3000000 bits)
I pdraw_source: 'AvcDecoder': add port for media id=2 type=VIDEO
I pdraw_element: 'AvcDecoder': element state change to STARTED
I pdraw_source: 'StreamDemuxerNet': link media id=1 type=VIDEO (channel key=0x7f8eac073a00)
W pdraw_decavc: duplicate timestamp (0), incrementing
04/07/2019 14:13:29.276384  _media_added                    _media_added id : 2
I pdraw_element: 'VideoSink': element state change to CREATED
I pdraw_sink: 'VideoSink': link media id=2 type=VIDEO
I pdraw_element: 'VideoSink': element state change to STARTING
I pdraw_element: 'VideoSink': element state change to STARTED
I pdraw_source: 'AvcDecoder': link media id=2 type=VIDEO (channel key=0x7f8eac0d3130)
[h264 @ 0x7f8eac073da0] Reinit context to 1280x720, pix_fmt: yuv420p
04/07/2019 14:13:29.277088      _media_added                    _media_added id : 1
I pdraw_element: 'VideoSink': element state change to CREATED
I pdraw_sink: 'VideoSink': link media id=1 type=VIDEO
I pdraw_element: 'VideoSink': element state change to STARTING
I pdraw_element: 'VideoSink': element state change to STARTED
I pdraw_source: 'StreamDemuxerNet': link media id=1 type=VIDEO (channel key=0x7f8eac0d32a0)
W pdraw_decavc: timestamp rollback from 1 to 0, incrementing
Fatal Python error: Segmentation fault

Current thread 0x00007f8ec1cfc700 (most recent call first):
  File "/sapmnt/home/I509099/code/parrot-groundsdk/packages/olympe/src/olympe/_private/pomp_loop_thread.py", line 246 in _wait_and_process
  File "/sapmnt/home/I509099/code/parrot-groundsdk/packages/olympe/src/olympe/_private/pomp_loop_thread.py", line 234 in run
  File "/usr/lib/python3.6/threading.py", line 916 in _bootstrap_inner
  File "/usr/lib/python3.6/threading.py", line 884 in _bootstrap

Thread 0x00007f8ebf4fb700 (most recent call first):
  File "/sapmnt/home/I509099/code/parrot-groundsdk/packages/olympe/src/olympe/_private/pomp_loop_thread.py", line 267 in add_event_to_loop
  File "/sapmnt/home/I509099/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/pdraw.py", line 707 in _media_added
  File "/sapmnt/home/I509099/code/parrot-groundsdk/out/olympe-linux/final/usr/lib/python/site-packages/olympe_deps.py", line 70 in <lambda>
  File "/sapmnt/home/I509099/code/parrot-groundsdk/packages/olympe/src/olympe/_private/pomp_loop_thread.py", line 246 in _wait_and_process
  File "/sapmnt/home/I509099/code/parrot-groundsdk/packages/olympe/src/olympe/_private/pomp_loop_thread.py", line 234 in run
  File "/usr/lib/python3.6/threading.py", line 916 in _bootstrap_inner
  File "/usr/lib/python3.6/threading.py", line 884 in _bootstrap

Thread 0x00007f8ecedc1740 (most recent call first):
  File "/usr/lib/python3.6/threading.py", line 295 in wait
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 427 in result
  File "/sapmnt/home/I509099/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/expectations.py", line 86 in wait
  File "test.py", line 135 in fly
  File "test.py", line 173 in <module>
Segmentation fault (core dumped)

Thank you,

ndessart commented 5 years ago

Thanks for this bug report.

Olympe 1.0.1b has now been released and should fix this issue. You should update your GroundSDK workspace with the following commands.

$ repo sync
$ ./build.sh -p olympe-linux -A all final -j
Baptiste-Pollien commented 5 years ago

I seems to work,

Thank you