Strange crash while loading some .mp4 videos (Ubuntu 9.10 / x64), can someone reproduce?

224 views
Skip to first unread message

Dmitry Chichkov

unread,
Oct 24, 2011, 3:55:46 PM10/24/11
to pyglet...@googlegroups.com

Can somebody try reproducing the following:
-----
1) wget  http://wpcvn.com/tmp/2816522621.mp4

2)  >>> import pyglet.media
source = pyglet.media.load("2816522621.mp4")
timestamp = source.get_next_video_timestamp()
-----

With this specific video Pyglet 1.4 (Ubuntu 9.10/x64, avbin 7.1) crashes on on me with the segmentation fault :(
The crash is specific to this video. I want to know - would it crash for everyone, or is it just my system....

-- Best, Dmitry




----
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff1998ab7 in ?? () from /usr/lib/libswscale.so.0
(gdb) bt
#0  0x00007ffff1998ab7 in ?? () from /usr/lib/libswscale.so.0
#1  0x00007ffff198503f in sws_scale () from /usr/lib/libswscale.so.0
#2  0x00007ffff2afe51e in avbin_decode_video () from /usr/lib/libavbin.so
#3  0x00007ffff6da7bec in ffi_call_unix64 ()
   from /usr/lib/python2.6/lib-dynload/_ctypes.so
#4  0x00007ffff6da72d3 in ffi_call ()
   from /usr/lib/python2.6/lib-dynload/_ctypes.so
#5  0x00007ffff6da1d64 in _CallProc ()
   from /usr/lib/python2.6/lib-dynload/_ctypes.so
#6  0x00007ffff6d99bf7 in ?? () from /usr/lib/python2.6/lib-dynload/_ctypes.so
#7  0x000000000041d6e7 in PyObject_Call ()
#8  0x00000000004a199c in PyEval_EvalFrameEx ()
#9  0x00000000004a2e47 in PyEval_EvalFrameEx ()
#10 0x00000000004a2e47 in PyEval_EvalFrameEx ()
#11 0x00000000004a2e47 in PyEval_EvalFrameEx ()
#12 0x00000000004a40e0 in PyEval_EvalCodeEx ()
#13 0x00000000004a41b2 in PyEval_EvalCode ()
#14 0x00000000004c33a0 in PyRun_FileExFlags ()
#15 0x00000000004c3564 in PyRun_SimpleFileExFlags ()
#16 0x0000000000418ab7 in Py_Main ()
-----

Dmitry Chichkov

unread,
Oct 25, 2011, 3:20:13 PM10/25/11
to pyglet...@googlegroups.com
I've tried it with the latest development code and it doesn't crash.

-- Best, Dmitry

Dmitry Chichkov

unread,
Oct 25, 2011, 5:08:52 PM10/25/11
to pyglet...@googlegroups.com
Actually it still crashes with the development code, just slightly later:


1) wget  http://wpcvn.com/tmp/2816522621.mp4

2)  >>> import pyglet.media
source = pyglet.media.load("2816522621.mp4")
timestamp = source.get_next_video_timestamp()
source.get_next_video_frame()
source.get_next_video_frame()
source.get_next_video_frame()

Nathan

unread,
Oct 25, 2011, 5:44:53 PM10/25/11
to pyglet...@googlegroups.com
No errors for me on OS X Lion, using your method below and the custom avbin version I emailed about last night.

~ Nathan



--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pyglet-users/-/kEl3rkrF21YJ.

To post to this group, send email to pyglet...@googlegroups.com.
To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.

Dmitry Chichkov

unread,
Nov 7, 2011, 3:05:05 PM11/7/11
to pyglet...@googlegroups.com
I've tried building avbin (for linux/x64) from your custom repository and it fails with:
----
gcc -c -DAVBIN_VERSION=8 -DFFMPEG_REVISION=15943 -fPIC -fno-stack-protector -O3 -m64 -I include -I ffmpeg -o build/avbin.o src/avbin.c
ld -shared -soname libavbin.so.8 -o dist/linux-x86-64/libavbin.so.8 build/avbin.o -whole-archive ffmpeg/libavformat/libavformat.a ffmpeg/libavcodec/libavcodec.a ffmpeg/libavutil/libavutil.a -no-whole-archive
ld: ffmpeg/libavcodec/libavcodec.a(fft_mmx.o): relocation R_X86_64_PC32 against symbol `ff_cos_16' can not be used when making a shared object; recompile with -fPIC
ld: final link failed: Bad value
----

-- Best, Dmitry


-- Best, Dmitry

Dmitry Chichkov

unread,
Nov 7, 2011, 6:34:22 PM11/7/11
to pyglet...@googlegroups.com
Tried it on the x86 linux box, and it doesn't crash. Issue is definitely specific to the x64 linux build.
Again, steps to reproduce the segfault - on Linux/x64:

-----

1) wget  http://wpcvn.com/tmp/2816522621.mp4

2)  >>> import pyglet.media
source = pyglet.media.load("2816522621.mp4")
timestamp = source.get_next_video_timestamp()
source.get_next_video_frame()
source.get_next_video_frame()
source.get_next_video_frame()
-----

Adam Bark

unread,
Nov 7, 2011, 7:46:20 PM11/7/11
to pyglet...@googlegroups.com

I just tried it out on 64 bit linux (mint 11) and got a segfault at the
first source.get_next_video_frame() but I got this message just before:
[swscaler @ 0x7f0cd806a3b0]No accelerated colorspace conversion found
from yuv420p to rgb24.
I guess that's why it's specific to that video because it uses yuv420p.
It might be an ffmpeg problem, if I play the video with ffplay and then
try to expand the window at a certain size it dies with a X error.

Dmitry Chichkov

unread,
Nov 7, 2011, 8:51:08 PM11/7/11
to pyglet...@googlegroups.com
I doubt that it is related to this "No accelerated colorspace conversion" message. I'm not getting this message on older ubuntu box, and getting it on a newer one. And I'm getting the segfault on both boxes - regardless of the message. I'm getting this message for many other videos (for which I'm not getting the crash).

Just tried ffplay (+resizing) and decoding the video with ffmpeg - works for me.

This video have somewhat strange resolution - 500x375, can this be a problem?

Nathan

unread,
Nov 8, 2011, 6:47:57 PM11/8/11
to pyglet...@googlegroups.com
Which version of which distro were you using?

~ Nathan

Dmitry Chichkov

unread,
Nov 10, 2011, 4:21:25 PM11/10/11
to pyglet...@googlegroups.com
I've tried these combinations:
* Ubuntu 9.10 / x64 /  libavbin 7-1build1 / pyglet 2.0 (head), 1.1.4, 1.1.2
* Ubuntu 11.04 / x64 / libavbin-dev 7-1.1 / pyglet 2.0 (head), 1.1.4

For me it segfaults on all of them.


Dmitry Chichkov

unread,
Nov 10, 2011, 6:44:11 PM11/10/11
to pyglet...@googlegroups.com
It looks like this crash is limited to VP6F encoded files (created by FlixEngineLinux):
 * I can see a bunch of such (vp6f) encoded files on which I'm getting the crash;
 * I haven't seen a single crash on a variety of other encodings (including VP6, VP61, VP62, VP7).

Nathan

unread,
Nov 15, 2011, 12:38:29 AM11/15/11
to pyglet...@googlegroups.com
Dmitry,

would you mind checking out the current subversion trunk (
http://code.google.com/p/avbin/source/checkout ) and seeing if it
crashes with the same error when you try to compile it for
linux-x86-64? I think I've successfully merged my Github changes back
into the Googlecode project, so I would expect identical compilation
crashes at this point.

~ Nathan

> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/pyglet-users/-/8MgR4xQT5NYJ.

Nathan

unread,
Nov 15, 2011, 7:30:32 PM11/15/11
to pyglet...@googlegroups.com
Dmitry,

I started looking into this on amd64 Ubuntu 11.10 (since I had an
existing VM with that on it), and to my surprise it built successfully
on the first try. I uploaded it to the project page as a beta
download.

Please give it a try and see if it works on your Ubuntu machines (I
have not tried it):

http://avbin.googlecode.com/files/avbin-linux-x86-64-8.tar.gz

~ Nathan

Dmitry Chichkov

unread,
Nov 16, 2011, 10:47:28 PM11/16/11
to pyglet...@googlegroups.com
Thanks.  I've tried it, and it worked for that particular file (encoded with vp6f)! But.
At least on my box it had stopped working for a large number of other files (in particular encoded with h.264)!

Here's link to a sample file: http://wpcvn.com/tmp/h.264.mp4

-- Dmitry

Nathan

unread,
Nov 17, 2011, 10:43:01 AM11/17/11
to pyglet...@googlegroups.com

When you say "stopped working" do you mean it crashes, or displays
garbled video?

~ Nathan

Dmitry Chichkov

unread,
Nov 17, 2011, 8:37:40 PM11/17/11
to pyglet...@googlegroups.com

I should have been more specific. Your libavbin version had fixed http://wpcvn.com/tmp/2816522621.mp4
But on the h.264 videos (for example http://wpcvn.com/tmp/h.264.mp4 ) now it returns empty frames and None in timestamps.
On ubuntu 11.04/x.64/pyglet from dev trunk/your libavbin).

wget http://wpcvn.com/tmp/h.264.mp4

>>> import pyglet.media
source = pyglet.media.load("h.264.mp4")
print source
print source.get_next_video_timestamp(), source.get_next_video_frame()
print source.get_next_video_timestamp(), source.get_next_video_frame()
print source.get_next_video_timestamp(), source.get_next_video_frame()
print source.get_next_video_timestamp(), source.get_next_video_frame()
print source.get_next_video_timestamp(), source.get_next_video_frame()

Results in:
<pyglet.media.avbin.AVbinSource object at 0xdc0750>
0.0 None
None <ImageData 640x512>
0.04 <ImageData 640x512>
0.08 <ImageData 640x512>
0.12 <ImageData 640x512>

With the standard ubuntu libavbin&piglet these h.264 files were working fine:
<pyglet.media.avbin.AVbinSource object at 0x7f9c249a0a10>
0.0 <ImageData 640x512>
0.04 <ImageData 640x512>
0.08 <ImageData 640x512>
0.12 <ImageData 640x512>
0.16 <ImageData 640x512>



Intrestingly, with standard libavbin in Ubuntu 11.04 and NEW pyglet from the github I'm also getting somewhat strange results:

[aac @ 0xfed510]Transition from an ONLY_LONG or LONG_STOP to an EIGHT_SHORT sequence detected. If you heard an audible artifact, please submit the sample to the FFmpeg developers.
<pyglet.media.avbin.AVbinSource object at 0xff8750>
    Last message repeated 3 times
[h264 @ 0x113c750]Missing reference picture
[h264 @ 0x113c750]decode_slice_header error
[h264 @ 0x113c750]concealing 1280 DC, 1280 AC, 1280 MV errors
None None
[h264 @ 0x113c750]Missing reference picture
[swscaler @ 0x7f00502abc60]No accelerated colorspace conversion found from yuv420p to rgb24.
0.04 <ImageData 640x512>
[h264 @ 0x113c750]Missing reference picture
[swscaler @ 0x7f005040daa0]No accelerated colorspace conversion found from yuv420p to rgb24.
0.08 <ImageData 640x512>
[h264 @ 0x113c750]Missing reference picture
[swscaler @ 0x7f0050411ea0]No accelerated colorspace conversion found from yuv420p to rgb24.
0.12 <ImageData 640x512>
[swscaler @ 0x7f005042e470]No accelerated colorspace conversion found from yuv420p to rgb24.
0.16 <ImageData 640x512>

-- Dmitry

Nathan

unread,
Nov 26, 2011, 8:30:57 PM11/26/11
to pyglet...@googlegroups.com
I've got an updated version of ffmpeg merged in, but so far
linux-x86-64 is giving me fits. I've figured out everything except
the final linking error:

ld -shared -soname libavbin.so.8 -o dist/linux-x86-64/libavbin.so.8
build/avbin.o -whole-archive ffmpeg/libavformat/libavformat.a
ffmpeg/libavcodec/libavcodec.a ffmpeg/libavutil/libavutil.a

ffmpeg/libavcore/libavcore.a ffmpeg/libswscale/libswscale.a
-no-whole-archive -R /usr/local/lib -R .
ld: dist/linux-x86-64/libavbin.so.8: version node not found for symbol
av_dup_packet@LIBAVFORMAT_52
ld: failed to set dynamic section sizes: Bad value
make: *** [dist/linux-x86-64/libavbin.so.8] Error 1

I'm asking about it on one of the FFmpeg mailing lists. I can't
figure out this weird "version node" stuff.

~ Nathan

> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/pyglet-users/-/7LAKw7gmOakJ.

Nathan

unread,
Dec 2, 2011, 12:56:31 AM12/2/11
to pyglet...@googlegroups.com
Dmitry, (and anyone else on 64-bit Linux) can you try the new
Libav-based linux-x86-64 version I just put together?

The FFmpeg people haven't been any help, and I found that there's an
active fork of FFmpeg called Libav.

https://github.com/downloads/AVbin/AVbin/avbin-linux-x86-64-v8-libavfork.tar.bz2

~ Nathan

Nathan

unread,
Dec 6, 2011, 12:05:08 AM12/6/11
to pyglet...@googlegroups.com
On Sat, Nov 26, 2011 at 6:30 PM, Nathan <nathan...@gmail.com> wrote:
> I've got an updated version of ffmpeg merged in, but so far
> linux-x86-64 is giving me fits.  I've figured out everything except
> the final linking error:
>
> ld -shared -soname libavbin.so.8 -o dist/linux-x86-64/libavbin.so.8
> build/avbin.o -whole-archive ffmpeg/libavformat/libavformat.a
> ffmpeg/libavcodec/libavcodec.a ffmpeg/libavutil/libavutil.a
> ffmpeg/libavcore/libavcore.a ffmpeg/libswscale/libswscale.a
> -no-whole-archive -R /usr/local/lib -R .
> ld: dist/linux-x86-64/libavbin.so.8: version node not found for symbol
> av_dup_packet@LIBAVFORMAT_52
> ld: failed to set dynamic section sizes: Bad value
> make: *** [dist/linux-x86-64/libavbin.so.8] Error 1
>
> I'm asking about it on one of the FFmpeg mailing lists.  I can't
> figure out this weird "version node" stuff.
>
> ~ Nathan

Solved!

http://forums.devshed.com/c-programming-42/linking-error-version-node-not-found-for-symbol-av-dup-867987.html

~ Nathan

Reply all
Reply to author
Forward
0 new messages