[gst-devel] cothread and basic scheduler issues (fwd'd)

Erik Walthinsen omega at temple-baptist.com
Fri Jun 28 07:47:15 CEST 2002

***** Forwarded for Thomas Vander Stichele *****


so as some of you might now, I'm trying to fix the basic scheduler to work
decently with cothreads.  The code is pretty hairy and not very
defensively programmed ;)

So I'm adding checks and doublechecks and seeing some weird stuff I'm
trying to correct.

a) in a lot of cases cothread 0 got destroyed while high cothreads in that
thread were still active.  I don't think that's a good idea, is it ? In
that case, I added code to first destroy all the other cothreads

b) I was trying to clean up cothreads nicely in cothreads_destroy.  Part
of this was doing a g_mutex_free on the lock.  However, that segfaults.
Anyone have an idea why that would be ? Is the lock in use at that moment
somehow ?

c) I get a segfault in the player at the exact moment when this happens :

cothread x gets flagged for destruction
cothread x + 1 gets created
switch from cothread x to 0 happens
cothread x gets destroyed
destroy does an munmap on cothread x -> segfault

It looks like

d) should the flag MAP_GROWSDOWN be used on the mmap somehow ? I'm not
familiar enough with mmap to be able to decide on my own.

e) I added a magic number to each cothread to guard against mem corruption
when trying to free it.  This might be unnecessary, so tell me why if it

At this point, segfaults still happen :
a) for cleanup3, which creates and destroys a pipeline a bunch of thimes
   the pthreads manager thread segfaults, I'm trying to use glibc-debug
   to see why exactly
b) for gst-player, on playing an mpeg, in the case described above.
   I'd like for someone to help me create a simple testsuite app that
   does the sequence described above.

Any help is much appreciated, I'd like to find some kind of fix and
release without a huge memory hole ;)



The Dave/Dina Project : future TV today ! - http://davedina.apestaart.org/
<-*-                      -*->
Say what you mean
or you won't mean a thing to me
<-*- thomas at apestaart.org -*->
URGent, the best radio on the Internet - 24/7 ! - http://urgent.rug.ac.be/

More information about the gstreamer-devel mailing list