xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Opened 9 years ago

Closed 9 years ago

Last modified 16 months ago

#398 closed defect (wontfix)

AVFrameWrapper falling out of scope before being freed by avcodec

Reported by: Antoine Martin Owned by: ahuillet
Priority: critical Milestone: 0.10
Component: client Version: trunk
Keywords: win32 Cc:

Description (last modified by Antoine Martin)

As can be seen in ticket:362#comment:6, it seems to be possible for a framewrapper to fall out of scope before it has been freed by avcodec.

This is caused by the buffer management code in #350 (r3976)

Please post log with XPRA_AVCODEC_DEBUG=1 for just 2 or 3 frames as per ticket:350#comment:6.

Do you need to use a specific application to trigger those warnings?
Can you reproduce with a simple xterm?
Did you apply any patches when you built the installer for win32?
What version of ffmpeg did you build against?
I've uploaded a new win32 beta - please compare this with your build.

Attachments (1)

out-of-scope-debug.log (24.6 KB) - added by Antoine Martin 8 years ago.
log sample for comment:7 (moving large waste of space comment to an attachment)

Download all attachments as: .zip

Change History (13)

comment:1 Changed 9 years ago by Antoine Martin

Description: modified (diff)

comment:2 Changed 9 years ago by Smo

Built new x264 and ffmpeg

ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20130801-2245-stable.tar.bz2
http://www.ffmpeg.org/releases/ffmpeg-1.2.2.tar.bz2

No more AVFrameWrapper messages after packaging a new installer with r4041

comment:3 Changed 9 years ago by Antoine Martin

Resolution: invalid
Status: newclosed

Great - closing as INVALID, must have been an old version of ffmpeg.

(may cause problems for us on some versions of libav/ffmpeg though..)

comment:4 Changed 9 years ago by ahuillet

I see the problem with latest Archlinux (ffmpeg 2.0).

comment:5 Changed 9 years ago by Antoine Martin

Resolution: invalid
Status: closedreopened

Please post some output with XPRA_AVCODEC_DEBUG=1

comment:6 Changed 9 years ago by Antoine Martin

Owner: changed from SmO to ahuillet
Status: reopenednew

comment:7 Changed 9 years ago by ahuillet

Is that enough?

2013-08-07 14:31:45,028 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 752, 'width': 1348, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:2047, {'quality': 20, 'frame': 1, 'speed': 20, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 1348, 752, 24))-(AVFrameWrapper(0x7fe474276850))
[swscaler @ 0x7fe48041bbe0] Warning: data is not aligned! This can lead to a speedloss
2013-08-07 14:31:45,038 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe474276850)
2013-08-07 14:31:45,038 xpra_free(0x7fe474276850) framewrapper=AVFrameWrapper(0x7fe474276850)
2013-08-07 14:31:45,038 AVFrameWrapper(0x7fe474276850).xpra_free()
2013-08-07 14:31:45,045 AVImageWrapper.free() av_frame=None
2013-08-07 14:31:45,050 dec_avcodec.Decoder.init_context(396, 244, YUV420P) self={'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 14:31:45,052 add_framewrapper(0x7fe48063f0b0L, AVFrameWrapper(0x7fe48063f0b0)) known frame keys: []
2013-08-07 14:31:45,054 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:5117, {'quality': 20, 'frame': 1, 'speed': 20, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 396, 244, 24))-(AVFrameWrapper(0x7fe48063f0b0))
2013-08-07 14:31:45,055 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe48063f0b0)
2013-08-07 14:31:45,055 xpra_free(0x7fe48063f0b0) framewrapper=AVFrameWrapper(0x7fe48063f0b0)
2013-08-07 14:31:45,055 AVFrameWrapper(0x7fe48063f0b0).xpra_free()
2013-08-07 14:31:45,056 AVImageWrapper.free() av_frame=None
2013-08-07 14:31:46,151 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 752, 'width': 1348, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 14:31:46,151 clean_decoder() cloning pixels for images still in use: []
2013-08-07 14:31:46,151 clean_decoder() freeing AVFrame: 0x7fe480072b80L
2013-08-07 14:31:46,152 clean_decoder() freeing AVCodecContext: 0x7fe480003de0L
2013-08-07 14:31:46,154 clean_decoder() done
2013-08-07 14:31:46,156 dec_avcodec.Decoder.init_context(1348, 752, YUV444P) self={'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 752, 'width': 1348, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 14:31:46,161 add_framewrapper(0x7fe480079bf0L, AVFrameWrapper(0x7fe480079bf0)) known frame keys: []
2013-08-07 14:31:46,167 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 752, 'width': 1348, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:8757, {'quality': 95, 'frame': 2, 'speed': 0, 'csc_pixel_format': 5})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV444P:(0, 0, 1348, 752, 24))-(AVFrameWrapper(0x7fe480079bf0))
2013-08-07 14:31:46,177 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe480079bf0)
2013-08-07 14:31:46,177 xpra_free(0x7fe480079bf0) framewrapper=AVFrameWrapper(0x7fe480079bf0)
2013-08-07 14:31:46,177 AVFrameWrapper(0x7fe480079bf0).xpra_free()
2013-08-07 14:31:46,183 AVImageWrapper.free() av_frame=None
2013-08-07 14:31:46,381 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 14:31:46,381 clean_decoder() cloning pixels for images still in use: []
2013-08-07 14:31:46,381 clean_decoder() freeing AVFrame: 0x7fe480440d20L
2013-08-07 14:31:46,381 clean_decoder() freeing AVCodecContext: 0x7fe4804408a0L
2013-08-07 14:31:46,382 clean_decoder() done
2013-08-07 14:31:46,384 dec_avcodec.Decoder.init_context(396, 244, YUV444P) self={'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 244, 'width': 396, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 14:31:46,386 add_framewrapper(0x7fe480699510L, AVFrameWrapper(0x7fe480699510)) known frame keys: []
2013-08-07 14:31:46,393 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:29883, {'quality': 95, 'frame': 2, 'speed': 0, 'csc_pixel_format': 5})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV444P:(0, 0, 396, 244, 24))-(AVFrameWrapper(0x7fe480699510))
2013-08-07 14:31:46,394 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe480699510)
2013-08-07 14:31:46,395 xpra_free(0x7fe480699510) framewrapper=AVFrameWrapper(0x7fe480699510)
2013-08-07 14:31:46,395 AVFrameWrapper(0x7fe480699510).xpra_free()
2013-08-07 14:31:46,396 AVImageWrapper.free() av_frame=None
2013-08-07 14:32:00,164 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 14:32:00,165 clean_decoder() cloning pixels for images still in use: []
2013-08-07 14:32:00,165 clean_decoder() freeing AVFrame: 0x7fe480443500L
2013-08-07 14:32:00,165 clean_decoder() freeing AVCodecContext: 0x7fe4804351a0L
2013-08-07 14:32:00,166 clean_decoder() done
2013-08-07 14:32:00,168 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'closed': True, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 14:32:00,169 clean_decoder() cloning pixels for images still in use: []
2013-08-07 14:32:00,169 clean_decoder() freeing AVFrame: 0x0L
2013-08-07 14:32:00,170 clean_decoder() freeing AVCodecContext: 0x0L
2013-08-07 14:32:00,170 clean_decoder() done
Exception AssertionError: 'AVFrameWrapper falling out of scope before being freed by avcodec!' in <xpra.codecs.dec_avcodec.decoder.AVFrameWrapper object at 0x203e3f0> ignored
2013-08-07 14:32:00,171 dec_avcodec.Decoder.init_context(396, 244, YUV420P) self={'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 14:32:00,173 add_framewrapper(0x7fe48068ee10L, AVFrameWrapper(0x7fe48068ee10)) known frame keys: []
2013-08-07 14:32:00,178 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:8219, {'quality': 32, 'frame': 3, 'speed': 96, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 396, 244, 24))-(AVFrameWrapper(0x7fe48068ee10))
2013-08-07 14:32:00,180 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe48068ee10)
2013-08-07 14:32:00,180 xpra_free(0x7fe48068ee10) framewrapper=AVFrameWrapper(0x7fe48068ee10)
2013-08-07 14:32:00,180 AVFrameWrapper(0x7fe48068ee10).xpra_free()
2013-08-07 14:32:00,181 AVImageWrapper.free() av_frame=None
2013-08-07 14:32:00,182 add_framewrapper(0x7fe480982030L, AVFrameWrapper(0x7fe480982030)) known frame keys: ['0x7fe48068ee10']
[h264 @ 0x7fe4804351a0] Cannot parallelize deblocking type 1, decoding such frames in sequential order
2013-08-07 14:32:00,182 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 2, 'type': 'x264', 'buffers': 2}).decompress_image(<type 'str'>:22, {'quality': 32, 'frame': 4, 'speed': 96, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 396, 244, 24))-(AVFrameWrapper(0x7fe480982030))
2013-08-07 14:32:00,186 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe480982030)
2013-08-07 14:32:00,186 xpra_free(0x7fe480982030) framewrapper=AVFrameWrapper(0x7fe480982030)
2013-08-07 14:32:00,186 AVFrameWrapper(0x7fe480982030).xpra_free()
2013-08-07 14:32:00,188 AVImageWrapper.free() av_frame=None
2013-08-07 14:32:01,346 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 2, 'type': 'x264', 'buffers': 2}).clean_decoder()
2013-08-07 14:32:01,346 clean_decoder() cloning pixels for images still in use: []
2013-08-07 14:32:01,346 clean_decoder() freeing AVFrame: 0x7fe480443500L
2013-08-07 14:32:01,347 clean_decoder() freeing AVCodecContext: 0x7fe4804351a0L
2013-08-07 14:32:01,349 clean_decoder() done
2013-08-07 14:32:01,351 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'closed': True, 'frames': 2, 'type': 'x264', 'buffers': 2}).clean_decoder()
2013-08-07 14:32:01,352 clean_decoder() cloning pixels for images still in use: []
2013-08-07 14:32:01,352 clean_decoder() freeing AVFrame: 0x0L
2013-08-07 14:32:01,352 clean_decoder() freeing AVCodecContext: 0x0L
2013-08-07 14:32:01,353 clean_decoder() done
Exception AssertionError: 'AVFrameWrapper falling out of scope before being freed by avcodec!' in <xpra.codecs.dec_avcodec.decoder.AVFrameWrapper object at 0x203e3f0> ignored
Exception AssertionError: 'AVFrameWrapper falling out of scope before being freed by avcodec!' in <xpra.codecs.dec_avcodec.decoder.AVFrameWrapper object at 0x7fe48044fb40> ignored
2013-08-07 14:32:01,355 dec_avcodec.Decoder.init_context(396, 244, YUV444P) self={'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 244, 'width': 396, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 14:32:01,357 add_framewrapper(0x7fe480695630L, AVFrameWrapper(0x7fe480695630)) known frame keys: []
2013-08-07 14:32:01,363 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:29883, {'quality': 95, 'frame': 5, 'speed': 0, 'csc_pixel_format': 5})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV444P:(0, 0, 396, 244, 24))-(AVFrameWrapper(0x7fe480695630))
2013-08-07 14:32:01,365 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe480695630)
2013-08-07 14:32:01,365 xpra_free(0x7fe480695630) framewrapper=AVFrameWrapper(0x7fe480695630)
2013-08-07 14:32:01,365 AVFrameWrapper(0x7fe480695630).xpra_free()
2013-08-07 14:32:01,366 AVImageWrapper.free() av_frame=None
2013-08-07 14:38:06,183 server is not responding, drawing spinners over the windows
2013-08-07 14:38:06,285 server is OK again
2013-08-07 14:40:16,229 server is not responding, drawing spinners over the windows
2013-08-07 14:40:16,532 server is OK again
2013-08-07 14:41:06,265 server is not responding, drawing spinners over the windows
2013-08-07 14:41:07,073 server is OK again
2013-08-07 14:42:26,337 server is not responding, drawing spinners over the windows
2013-08-07 14:42:26,540 server is OK again
2013-08-07 15:10:28,113 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 15:10:28,114 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:28,114 clean_decoder() freeing AVFrame: 0x7fe480443500L
2013-08-07 15:10:28,114 clean_decoder() freeing AVCodecContext: 0x7fe4804351a0L
2013-08-07 15:10:28,116 clean_decoder() done
2013-08-07 15:10:28,117 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'closed': True, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 15:10:28,118 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:28,118 clean_decoder() freeing AVFrame: 0x0L
2013-08-07 15:10:28,118 clean_decoder() freeing AVCodecContext: 0x0L
2013-08-07 15:10:28,119 clean_decoder() done
Exception AssertionError: 'AVFrameWrapper falling out of scope before being freed by avcodec!' in <xpra.codecs.dec_avcodec.decoder.AVFrameWrapper object at 0x7fe48044fb40> ignored
2013-08-07 15:10:28,120 dec_avcodec.Decoder.init_context(396, 244, YUV420P) self={'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 15:10:28,122 add_framewrapper(0x7fe48068baf0L, AVFrameWrapper(0x7fe48068baf0)) known frame keys: []
2013-08-07 15:10:28,127 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:10177, {'quality': 40, 'frame': 6, 'speed': 98, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 396, 244, 24))-(AVFrameWrapper(0x7fe48068baf0))
2013-08-07 15:10:28,129 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe48068baf0)
2013-08-07 15:10:28,130 xpra_free(0x7fe48068baf0) framewrapper=AVFrameWrapper(0x7fe48068baf0)
2013-08-07 15:10:28,130 AVFrameWrapper(0x7fe48068baf0).xpra_free()
2013-08-07 15:10:28,131 AVImageWrapper.free() av_frame=None
2013-08-07 15:10:28,143 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 752, 'width': 1348, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 15:10:28,143 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:28,143 clean_decoder() freeing AVFrame: 0x7fe480072b40L
2013-08-07 15:10:28,143 clean_decoder() freeing AVCodecContext: 0x7fe4800726e0L
2013-08-07 15:10:28,144 clean_decoder() done
2013-08-07 15:10:28,144 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'closed': True, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 15:10:28,144 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:28,144 clean_decoder() freeing AVFrame: 0x0L
2013-08-07 15:10:28,145 clean_decoder() freeing AVCodecContext: 0x0L
2013-08-07 15:10:28,145 clean_decoder() done
Exception AssertionError: 'AVFrameWrapper falling out of scope before being freed by avcodec!' in <xpra.codecs.dec_avcodec.decoder.AVFrameWrapper object at 0x203e390> ignored
2013-08-07 15:10:28,145 dec_avcodec.Decoder.init_context(1348, 752, YUV420P) self={'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 752, 'width': 1348, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 15:10:28,147 add_framewrapper(0x7fe480079cb0L, AVFrameWrapper(0x7fe480079cb0)) known frame keys: []
2013-08-07 15:10:28,153 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 752, 'width': 1348, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:3009, {'quality': 35, 'frame': 3, 'speed': 86, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 1348, 752, 24))-(AVFrameWrapper(0x7fe480079cb0))
2013-08-07 15:10:28,160 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe480079cb0)
2013-08-07 15:10:28,161 xpra_free(0x7fe480079cb0) framewrapper=AVFrameWrapper(0x7fe480079cb0)
2013-08-07 15:10:28,161 AVFrameWrapper(0x7fe480079cb0).xpra_free()
2013-08-07 15:10:28,167 AVImageWrapper.free() av_frame=None
2013-08-07 15:10:28,287 add_framewrapper(0x7fe4807f49d0L, AVFrameWrapper(0x7fe4807f49d0)) known frame keys: ['0x7fe48068baf0']
[h264 @ 0x7fe4804351a0] Cannot parallelize deblocking type 1, decoding such frames in sequential order
2013-08-07 15:10:28,291 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 2, 'type': 'x264', 'buffers': 2}).decompress_image(<type 'str'>:76, {'quality': 47, 'frame': 7, 'speed': 96, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 396, 244, 24))-(AVFrameWrapper(0x7fe4807f49d0))
2013-08-07 15:10:28,294 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe4807f49d0)
2013-08-07 15:10:28,295 xpra_free(0x7fe4807f49d0) framewrapper=AVFrameWrapper(0x7fe4807f49d0)
2013-08-07 15:10:28,295 AVFrameWrapper(0x7fe4807f49d0).xpra_free()
2013-08-07 15:10:28,297 AVImageWrapper.free() av_frame=None
2013-08-07 15:10:29,113 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 752, 'width': 1348, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 15:10:29,113 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:29,114 clean_decoder() freeing AVFrame: 0x7fe4806b9d20L
2013-08-07 15:10:29,114 clean_decoder() freeing AVCodecContext: 0x7fe4800726e0L
2013-08-07 15:10:29,114 clean_decoder() done
2013-08-07 15:10:29,116 dec_avcodec.Decoder.init_context(1348, 752, YUV444P) self={'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 752, 'width': 1348, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 15:10:29,121 add_framewrapper(0x7fe4806d4bb0L, AVFrameWrapper(0x7fe4806d4bb0)) known frame keys: []
2013-08-07 15:10:29,131 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 752, 'width': 1348, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:9291, {'quality': 95, 'frame': 4, 'speed': 0, 'csc_pixel_format': 5})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV444P:(0, 0, 1348, 752, 24))-(AVFrameWrapper(0x7fe4806d4bb0))
2013-08-07 15:10:29,142 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe4806d4bb0)
2013-08-07 15:10:29,142 xpra_free(0x7fe4806d4bb0) framewrapper=AVFrameWrapper(0x7fe4806d4bb0)
2013-08-07 15:10:29,142 AVFrameWrapper(0x7fe4806d4bb0).xpra_free()
2013-08-07 15:10:29,147 AVImageWrapper.free() av_frame=None
2013-08-07 15:10:30,333 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 2, 'type': 'x264', 'buffers': 2}).clean_decoder()
2013-08-07 15:10:30,334 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:30,334 clean_decoder() freeing AVFrame: 0x7fe480443500L
2013-08-07 15:10:30,334 clean_decoder() freeing AVCodecContext: 0x7fe4804351a0L
2013-08-07 15:10:30,335 clean_decoder() done
2013-08-07 15:10:30,337 dec_avcodec.Decoder.init_context(396, 244, YUV444P) self={'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 244, 'width': 396, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 15:10:30,339 add_framewrapper(0x7fe4806895f0L, AVFrameWrapper(0x7fe4806895f0)) known frame keys: []
2013-08-07 15:10:30,350 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:29883, {'quality': 95, 'frame': 8, 'speed': 0, 'csc_pixel_format': 5})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV444P:(0, 0, 396, 244, 24))-(AVFrameWrapper(0x7fe4806895f0))
2013-08-07 15:10:30,352 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe4806895f0)
2013-08-07 15:10:30,352 xpra_free(0x7fe4806895f0) framewrapper=AVFrameWrapper(0x7fe4806895f0)
2013-08-07 15:10:30,352 AVFrameWrapper(0x7fe4806895f0).xpra_free()
2013-08-07 15:10:30,353 AVImageWrapper.free() av_frame=None
2013-08-07 15:10:30,753 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 15:10:30,754 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:30,755 clean_decoder() freeing AVFrame: 0x7fe480345340L
2013-08-07 15:10:30,755 clean_decoder() freeing AVCodecContext: 0x7fe48048de40L
2013-08-07 15:10:30,756 clean_decoder() done
2013-08-07 15:10:30,758 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'closed': True, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 15:10:30,758 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:30,758 clean_decoder() freeing AVFrame: 0x0L
2013-08-07 15:10:30,758 clean_decoder() freeing AVCodecContext: 0x0L
2013-08-07 15:10:30,759 clean_decoder() done
Exception AssertionError: 'AVFrameWrapper falling out of scope before being freed by avcodec!' in <xpra.codecs.dec_avcodec.decoder.AVFrameWrapper object at 0x7fe480457c60> ignored
2013-08-07 15:10:30,759 dec_avcodec.Decoder.init_context(396, 244, YUV420P) self={'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 15:10:30,760 add_framewrapper(0x7fe4806896f0L, AVFrameWrapper(0x7fe4806896f0)) known frame keys: []
2013-08-07 15:10:30,763 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:14491, {'quality': 56, 'frame': 9, 'speed': 99, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 396, 244, 24))-(AVFrameWrapper(0x7fe4806896f0))
2013-08-07 15:10:30,764 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe4806896f0)
2013-08-07 15:10:30,764 xpra_free(0x7fe4806896f0) framewrapper=AVFrameWrapper(0x7fe4806896f0)
2013-08-07 15:10:30,764 AVFrameWrapper(0x7fe4806896f0).xpra_free()
2013-08-07 15:10:30,765 AVImageWrapper.free() av_frame=None
2013-08-07 15:10:30,766 add_framewrapper(0x7fe4806304b0L, AVFrameWrapper(0x7fe4806304b0)) known frame keys: ['0x7fe4806896f0']
[h264 @ 0x7fe48048de40] Cannot parallelize deblocking type 1, decoding such frames in sequential order
2013-08-07 15:10:30,766 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 2, 'type': 'x264', 'buffers': 2}).decompress_image(<type 'str'>:172, {'quality': 36, 'frame': 10, 'speed': 99, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 396, 244, 24))-(AVFrameWrapper(0x7fe4806304b0))
2013-08-07 15:10:30,767 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe4806304b0)
2013-08-07 15:10:30,767 xpra_free(0x7fe4806304b0) framewrapper=AVFrameWrapper(0x7fe4806304b0)
2013-08-07 15:10:30,767 AVFrameWrapper(0x7fe4806304b0).xpra_free()
2013-08-07 15:10:30,767 AVImageWrapper.free() av_frame=None
2013-08-07 15:10:31,143 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 244, 'width': 396, 'frames': 2, 'type': 'x264', 'buffers': 2}).clean_decoder()
2013-08-07 15:10:31,143 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:31,144 clean_decoder() freeing AVFrame: 0x7fe480345340L
2013-08-07 15:10:31,144 clean_decoder() freeing AVCodecContext: 0x7fe48048de40L
2013-08-07 15:10:31,145 clean_decoder() done
2013-08-07 15:10:31,243 dec_avcodec.Decoder({'colorspace': 'YUV444P', 'actual_colorspace': 'YUV444P', 'height': 752, 'width': 1348, 'frames': 1, 'type': 'x264', 'buffers': 1}).clean_decoder()
2013-08-07 15:10:31,244 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:31,244 clean_decoder() freeing AVFrame: 0x7fe48048db80L
2013-08-07 15:10:31,244 clean_decoder() freeing AVCodecContext: 0x7fe480435700L
2013-08-07 15:10:31,245 clean_decoder() done
2013-08-07 15:10:31,247 dec_avcodec.Decoder.init_context(1348, 752, YUV420P) self={'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 752, 'width': 1348, 'frames': 0, 'type': 'x264', 'buffers': 0}
2013-08-07 15:10:31,250 add_framewrapper(0x7fe480222550L, AVFrameWrapper(0x7fe480222550)) known frame keys: []
2013-08-07 15:10:31,253 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 752, 'width': 1348, 'frames': 1, 'type': 'x264', 'buffers': 1}).decompress_image(<type 'str'>:3307, {'quality': 41, 'frame': 5, 'speed': 87, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 1348, 752, 24))-(AVFrameWrapper(0x7fe480222550))
2013-08-07 15:10:31,262 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe480222550)
2013-08-07 15:10:31,262 xpra_free(0x7fe480222550) framewrapper=AVFrameWrapper(0x7fe480222550)
2013-08-07 15:10:31,262 AVFrameWrapper(0x7fe480222550).xpra_free()
2013-08-07 15:10:31,263 AVImageWrapper.free() av_frame=None
2013-08-07 15:10:31,318 add_framewrapper(0x7fe480496a10L, AVFrameWrapper(0x7fe480496a10)) known frame keys: ['0x7fe480222550']
[h264 @ 0x7fe480072b20] Cannot parallelize deblocking type 1, decoding such frames in sequential order
2013-08-07 15:10:31,328 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 752, 'width': 1348, 'frames': 2, 'type': 'x264', 'buffers': 2}).decompress_image(<type 'str'>:97, {'quality': 41, 'frame': 6, 'speed': 87, 'csc_pixel_format': 0})=<class 'xpra.codecs.dec_avcodec.decoder.AVImageWrapper'>(YUV420P:(0, 0, 1348, 752, 24))-(AVFrameWrapper(0x7fe480496a10))
2013-08-07 15:10:31,337 AVImageWrapper.free() av_frame=AVFrameWrapper(0x7fe480496a10)
2013-08-07 15:10:31,337 xpra_free(0x7fe480496a10) framewrapper=AVFrameWrapper(0x7fe480496a10)
2013-08-07 15:10:31,337 AVFrameWrapper(0x7fe480496a10).xpra_free()
2013-08-07 15:10:31,342 AVImageWrapper.free() av_frame=None
2013-08-07 15:10:31,395 dec_avcodec.Decoder({'colorspace': 'YUV420P', 'actual_colorspace': 'YUV420P', 'height': 752, 'width': 1348, 'frames': 2, 'type': 'x264', 'buffers': 2}).clean_decoder()
2013-08-07 15:10:31,395 clean_decoder() cloning pixels for images still in use: []
2013-08-07 15:10:31,395 clean_decoder() freeing AVFrame: 0x7fe480345340L
2013-08-07 15:10:31,395 clean_decoder() freeing AVCodecContext: 0x7fe480072b20L
2013-08-07 15:10:31,396 clean_decoder() done

Version 0, edited 9 years ago by ahuillet (next)

comment:8 Changed 9 years ago by Antoine Martin

It seems to me like this happens when a window is destroyed, or resized, right? Is this with ffmpeg 2.x?
Can I get a bit more context?


What I think is happening is that when we clean the decoder context, we clone the pixel data which calls xpra_free(), then when we call avcodec_close it calls av_free() and all is well. We lose all the references to the wrappers, they get garbage collected and we check that it is safe to free the reference (as the buffer should already have been freed by then).
That's on *my* version of ffmpeg... (Linux, OSX and win32)


But here, I am not seeing a single av_free at all. It looks like the avcodec_release_buffer function is never called.

comment:9 Changed 9 years ago by ahuillet

This is with ffmpeg 2.0. I did not check if it happened when a window was destroyed or resized, but I think it is a reasonable assumption - I remember I got my terminal flooded with those messages when I resized a xterm from very small to very big.

comment:10 Changed 9 years ago by Antoine Martin

I am closing this ticket after testing on most supported platforms with ffmpeg 1.2.x. If this problem re-occurs with a supported version of ffmpeg, then we can re-open this ticket.

Support for ffmpeg 2.0 is now moved to #415


Note: the buffer support change was messy (esp compat for older versions - patches, etc):

comment:11 Changed 9 years ago by Antoine Martin

Resolution: wontfix
Status: newclosed

(actually closing it)

Changed 8 years ago by Antoine Martin

Attachment: out-of-scope-debug.log added

log sample for comment:7 (moving large waste of space comment to an attachment)

comment:12 Changed 16 months ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/398

Note: See TracTickets for help on using tickets.