[vlc-devel] [vlc-commits] picture_Hold: add an assertion

Thomas Guillem thomas at gllm.fr
Fri Oct 31 11:27:44 CET 2014



On Fri, Oct 31, 2014, at 11:10, Rémi Denis-Courmont wrote:
> Le 2014-10-31 12:59, Thomas Guillem a écrit :
> > On Thu, Oct 30, 2014, at 20:02, Rémi Denis-Courmont wrote:
> >> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu 
> >> Oct 30
> >> 21:02:43 2014 +0200| [c2b0f25eab8debf0f9d437dbeb298368692dddc6] |
> >> committer: Rémi Denis-Courmont
> >>
> >> picture_Hold: add an assertion
> >>
> >> > 
> >> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c2b0f25eab8debf0f9d437dbeb298368692dddc6
> >> ---
> >>
> >>  src/misc/picture.c |    3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/src/misc/picture.c b/src/misc/picture.c
> >> index 358de65..6aa5b05 100644
> >> --- a/src/misc/picture.c
> >> +++ b/src/misc/picture.c
> >> @@ -284,7 +284,8 @@ picture_t *picture_New( vlc_fourcc_t i_chroma, 
> >> int
> >> i_width, int i_height, int i_
> >>
> >>  picture_t *picture_Hold( picture_t *p_picture )
> >>  {
> >> -    atomic_fetch_add( &p_picture->gc.refcount, 1 );
> >> +    uintptr_t refs = atomic_fetch_add( &p_picture->gc.refcount, 1 
> >> );
> >> +    assert( refs > 0 );
> >>      return p_picture;
> >>  }
> >>
> >
> > this patch breaks avcodec in android, SIGABRT due to an assert:
> >
> > Program received signal SIGABRT, Aborted.
> > [Switching to Thread 9289]
> > 0x40131f78 in tgkill () from
> > 
> > /home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
> > (gdb) bt
> > #0  0x40131f78 in tgkill () from
> > 
> > /home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
> > #1  0x40123010 in pthread_kill () from
> > 
> > /home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
> > #2  0x40123224 in raise () from
> > 
> > /home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
> > #3  0x40121f5a in ?? () from
> > 
> > /home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
> > #4  0x40131830 in abort () from
> > 
> > /home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
> > #5  0x40122a40 in ?? () from
> > 
> > /home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
> > #6  0x40121fb8 in __assert2 () from
> > 
> > /home/tom/work/git/vlc-android/vlc-android/obj/local/armeabi-v7a/libc.so
> > #7  0x75652196 in picture_Hold (p_picture=0x75d8b620 <__func__.8221>,
> > p_picture at entry=0x77fa8d98) at ../../src/misc/picture.c:288
> > #8  0x75653064 in picture_pool_Get (pool=0x75cf44dc) at
> > ../../src/misc/picture_pool.c:284
> 
> That code path does not exist in that commit hash...
> 
> I blame your local changes.

Ah yes, it was reproduced due to "Revert "picture_pool: fix race
condition""


> 
> -- 
> Rémi Denis-Courmont
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list