Hi, not sure if this is related. GIL trouble anyway. Noticed this while I was tinkering with ffmpeg for Symbian. It's probably too slow on the phones, but I just want to see if I get it working... Anyway, there are several lines like this one: ... if(threaded) GRABGIL ... if(threaded) RELEASEGIL ...
Might seem like nothing wrong, but once the preprocessor expands those macros: if(threaded) // GRABGIL PyEval_AcquireLock(); _oldtstate = PyThreadState_Swap(movie->_tstate); The PyThreadState_Swap is called even if 'threaded' is false, without acquiring the lock, causing a crash. I suggest always using curly braces with 'if' :) Hopefully this helps. ____________________ Jussi Toivola 2009/8/22 Tyler Laing <trinio...@gmail.com>: > "tstate mix-up". I've looked, and there are no Python calls done without > having the GIL. Like I said, its an extremely weird bug. It also occurs if > you do five play throughs(play(0)) sequentially. > > -Tyler > > On Fri, Aug 21, 2009 at 6:11 PM, Lenard Lindstrom <le...@telus.net> wrote: >> >> Hi, >> >> Is it always a "tstate mix-up". If so, then it is likely a threading >> problem. Absolutely no Python api calls should be made while the GIL is >> released. If not then probably a memory problem. >> >> Lenard >> >> Tyler Laing wrote: >>> >>> Yeah I know about that. Its because of everything that is done to the >>> video file in the example code. Its a very hard error to pindown. Sometimes >>> it happens during debugging, sometimes not. It happens on various kinds of >>> videos, so its not format dependent, and it only happens after stopping and >>> restarting, and adding surfaces. I haven't found it happening any other way. >>> >>> Thanks for the feedback. >>> >>> -Tyler >>> >>> On Thu, Aug 20, 2009 at 2:05 PM, Lenard Lindstrom <le...@telus.net >>> <mailto:le...@telus.net>> wrote: >>> >>> Hi, >>> >>> It builds and installs in Debian lenny now. The __movie_test.py >>> even works for the most part, though fails at the end with this error: >>> >>> Unpausing... >>> True >>> True >>> Stopping..., sleeping for 3 seconds >>> Playing again... >>> done restart play... >>> Surface time... >>> ValueError: surface does not have the same aspect ratio as the >>> video. This would cause surface corruption. >>> Fatal Python error: ceval: tstate mix-up >>> Aborted >>> >>> I was playing an .flv file, so maybe that had something to do with it. >>> >>> Lenard >>> >>> Tyler Laing wrote: >>> >>> Fixed that, sorry. I should have done an else, but I did an >>> endif >.> >>> >>> -Tyler >>> >>> On Thu, Aug 20, 2009 at 1:09 PM, Lenard Lindstrom >>> <le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>>> wrote: >>> >>> Hi Tyler, >>> >>> It is finding the headers, but now I am getting this >>> compiler error: >>> >>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall >>> -Wstrict-prototypes -fPIC -D_REENTRANT -I/usr/X11R6/include >>> -I/usr/include/SDL -I/usr/include/ffmpeg -I/usr/include/ffmpeg >>> -I/usr/include/SDL -I/usr/include/python2.5 -c src/_gmovie.c -o >>> build/temp.linux-i686-2.5/src/_gmovie.o >>> >>> src/_gmovie.c: In function ‘video_image_display’: >>> src/_gmovie.c:516: warning: unused variable ‘_oldtstate’ >>> src/_gmovie.c: In function ‘queue_picture’: >>> src/_gmovie.c:826: warning: unused variable ‘_oldtstate’ >>> src/_gmovie.c: In function ‘stream_open’: >>> src/_gmovie.c:1482: warning: unused variable >>> ‘wanted_subti_stream’ >>> >>> src/_gmovie.c: In function ‘video_render’: >>> src/_gmovie.c:2444: error: ‘AVCodecContext’ has no member named >>> ‘reordered_opaque’ >>> >>> error: command 'gcc' failed with exit status 1 >>> l >>> >>> Here is the version information returned by ffmpeg: >>> >>> $/usr/bin/ffmpeg >>> FFmpeg version r11872+debian_0.svn20080206-17+lenny1, Copyright >>> (c) 2000-2008 Fabrice Bellard, et al. >>> configuration: --enable-gpl --enable-libfaad --enable-pp >>> --enable-swscaler --enable-x11grab --prefix=/usr >>> --enable-libgsm >>> --enable-libtheora --enable-libvorbis --enable-pthreads >>> --disable-strip --enable-libdc1394 --disable-armv5te >>> --disable-armv6 --disable-altivec --disable-vis --enable-shared >>> --disable-static >>> libavutil version: 49.6.0 >>> libavcodec version: 51.50.0 >>> libavformat version: 52.7.0 >>> libavdevice version: 52.0.0 >>> built on Apr 28 2009 02:12:01, gcc: 4.3.2 >>> >>> Though ffmpeg is statically linked I assume it use the same >>> library versions as the share libraries. >>> >>> Lenard >>> >>> Tyler Laing wrote: >>> >>> And I've now committed a fix for throwing exceptions if the >>> surface given has the wrong aspect ratio. >>> >>> -Tyler >>> >>> On Thu, Aug 20, 2009 at 9:46 AM, Tyler Laing >>> <trinio...@gmail.com <mailto:trinio...@gmail.com> >>> <mailto:trinio...@gmail.com <mailto:trinio...@gmail.com>> >>> <mailto:trinio...@gmail.com >>> <mailto:trinio...@gmail.com> <mailto:trinio...@gmail.com >>> <mailto:trinio...@gmail.com>>>> wrote: >>> >>> I have this fixed, with it committed in revision >>> 2628. I have a >>> custom Dependency class that adds extra directories >>> to the >>> include >>> search path(like libavformat or ffmpeg). This >>> prevents any >>> accidental conflict of namespaces. Let me know if this >>> works or not. >>> >>> -Tyler >>> >>> >>> On Tue, Aug 18, 2009 at 5:17 PM, Lenard Lindstrom >>> <le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>> >>> <mailto:le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>>>> wrote: >>> >>> Hi, >>> >>> No, I don't see any Debian specific predefined >>> compiler >>> macros. ffmpeg library information is available >>> through >>> pkg-config. >>> >>> Lenard >>> >>> Tyler Laing wrote: >>> >>> Does debian have a unique compile time flag >>> I can use? >>> >>> -Tyler >>> >>> On Tue, Aug 18, 2009 at 12:09 PM, Lenard >>> Lindstrom >>> <le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>> >>> <mailto:le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>>> >>> <mailto:le...@telus.net >>> <mailto:le...@telus.net> <mailto:le...@telus.net >>> <mailto:le...@telus.net>> >>> <mailto:le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>>>>> wrote: >>> >>> Hi Tyler, >>> >>> /usr/include is included in the default >>> header >>> search >>> paths. What >>> is installed is >>> /usr/include/ffmpeg/avformat.h, not >>> >>> /usr/include/ffmpeg/libavformat/avformat.h. This >>> may be >>> a quirk of >>> the Debian dev package and not the >>> general case. >>> >>> Lenard >>> >>> Tyler Laing wrote: >>> >>> You don't have -l/usr/include >>> actually. What >>> I will >>> do is add >>> to the directories searched, for the >>> specific >>> libraries to >>> search in /usr/include/ffmpeg && >>> /usr/include/<relevant >>> library name> for if people install >>> from source. >>> Does that >>> sound like a good solution? >>> >>> -Tyler >>> >>> On Tue, Aug 18, 2009 at 9:03 AM, Lenard >>> Lindstrom >>> <le...@telus.net >>> <mailto:le...@telus.net> <mailto:le...@telus.net >>> <mailto:le...@telus.net>> >>> <mailto:le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>>> >>> <mailto:le...@telus.net >>> <mailto:le...@telus.net> <mailto:le...@telus.net >>> <mailto:le...@telus.net>> >>> <mailto:le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>>>> >>> <mailto:le...@telus.net >>> <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>> >>> <mailto:le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>>> >>> <mailto:le...@telus.net >>> <mailto:le...@telus.net> <mailto:le...@telus.net >>> <mailto:le...@telus.net>> >>> <mailto:le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>>>>>> wrote: >>> >>> Ok, when I add >>> >>> _movie src/_gsound.c src/_gmovie.c >>> src/_gcommand.c src/gmovie.c >>> $(SDL) $(AVFORMAT) $(SWSCALE) $(MIXER) >>> $(DEBUG) >>> >>> to Setup I get these build errors: >>> >>> >>> building 'pygame._movie' extension >>> gcc -pthread -fno-strict-aliasing >>> -DNDEBUG -g >>> -fwrapv -O2 -Wall >>> -Wstrict-prototypes -fPIC -D_REENTRANT >>> -I/usr/X11R6/include >>> -I/usr/include/SDL -I/usr/include/SDL >>> -I/usr/include/python2.5 -c >>> src/_gsound.c -o >>> build/temp.linux-i686-2.5/src/_gsound.o >>> In file included from >>> src/_gsound.c:35: >>> src/_gsound.h:36:34: error: >>> libavformat/avformat.h: No such >>> file >>> or directory >>> src/_gsound.c: In function >>> ‘seekBuffer’: >>> src/_gsound.c:403: error: >>> ‘AV_NOPTS_VALUE’ >>> undeclared >>> (first use >>> in this function) >>> src/_gsound.c:403: error: (Each >>> undeclared >>> identifier is >>> reported >>> only once >>> src/_gsound.c:403: error: for each >>> function it >>> appears in.) >>> error: command 'gcc' failed with exit >>> status 1 >>> >>> The Debian dev package installs >>> avformat.h in >>> ffmpeg, not >>> libavformat. >>> >>> Lenard >>> >>> >>> Lenard Lindstrom wrote: >>> >>> Hi René, >>> >>> My mistake. I didn't pay >>> attention to >>> the error. >>> _movie.so was >>> not event built since the >>> _movie entry is >>> missing in >>> Setup.in. >>> I had to manually enter it to >>> Setup >>> the last >>> time, and that >>> was clobbered when I reran >>> config.py. >>> >>> Lenard >>> >>> >>> René Dudfield wrote: >>> >>> On Tue, Aug 18, 2009 at >>> 4:47 PM, >>> Lenard >>> Lindstrom<le...@telus.net >>> <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>> >>> <mailto:le...@telus.net >>> <mailto:le...@telus.net> <mailto:le...@telus.net >>> <mailto:le...@telus.net>>> >>> <mailto:le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>> >>> <mailto:le...@telus.net >>> <mailto:le...@telus.net> <mailto:le...@telus.net >>> <mailto:le...@telus.net>>>> >>> <mailto:le...@telus.net >>> <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>> >>> <mailto:le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>>> >>> <mailto:le...@telus.net >>> <mailto:le...@telus.net> <mailto:le...@telus.net >>> <mailto:le...@telus.net>> >>> <mailto:le...@telus.net <mailto:le...@telus.net> >>> <mailto:le...@telus.net <mailto:le...@telus.net>>>>>> wrote: >>> >>> Hi Tyler, >>> >>> The module now builds, >>> but the >>> _movie_test.py unit >>> tests fail: >>> >>> ERROR: >>> MovieTypeTest.test_height >>> >>> ---------------------------------------------------------------------- >>> Traceback (most recent >>> call >>> last): >>> File >>> >>> "/home/lenard/.local/lib/python2.5/site-packages/pygame/tests/_movie_test.py", >>> >>> line 125, in test_height >>> movie = >>> gmovie.Movie(movie_file) >>> AttributeError: 'NoneType' >>> object has no >>> attribute 'Movie' >>> >>> If "movie_file" is missing >>> shouldn't >>> gmovie.Movie >>> raise an exception? >>> >>> Lenard >>> >>> >>> hi, >>> >>> check out the try/except >>> at the >>> top of >>> that test... >>> maybe >>> it is >>> raising an exception, and >>> catching it. >>> >>> that try/except was added >>> to try >>> and get >>> the build >>> bot to >>> build again. >>> >>> cheers, >>> >>> >>> >>> >>> >>> >>> -- Visit my blog at >>> http://oddco.ca/zeroth/zblog >>> >>> >>> >>> >>> >>> -- Visit my blog at >>> http://oddco.ca/zeroth/zblog >>> >>> >>> >>> >>> >>> >>> -- Visit my blog at http://oddco.ca/zeroth/zblog >>> >>> >>> >>> >>> -- Visit my blog at http://oddco.ca/zeroth/zblog >>> >>> >>> >>> >>> >>> -- Visit my blog at http://oddco.ca/zeroth/zblog >>> >>> >>> >>> >>> >>> -- >>> Visit my blog at http://oddco.ca/zeroth/zblog >> > > > > -- > Visit my blog at http://oddco.ca/zeroth/zblog >