On Sat, 7 Sep 2013 10:54:21 -0300 Felipe Magno de Almeida
<[email protected]> said:

> On Sat, Sep 7, 2013 at 3:31 AM, Carsten Haitzler <[email protected]> wrote:
> > On Sat, 7 Sep 2013 00:46:25 +0000 Felipe Magno de Almeida
> > <[email protected]> said:
> >
> >> Hello,
> >>
> >> There's a deadlock in eina_stringshare_del/eina_share_common_del
> >> because the function eina_share_common_del locks _mutex_big, but it
> >> then goes to call eina_share_common_population_del which also tries to
> >> lock _mutex_big.
> >
> > i'm staring at eina_stringshare_del and i see it taking NO mutexes on big
> > mutexes. there is a small mutes it takes and releases and
> > _eina_stringshare_small_del does no locking itself or in children...  that i
> > can find... are we looking at the same src?
> 
> Sorry, should've filled more details. I'm using efl from git, master branch.
> The eina_stringshare_del doesn't take any mutexes. But, it calls
> eina_share_common_del
> at eina_stringshare.c:596.

aaaah so not stringshare related at all. it's a problem inside
share_common... :) next level down. from your mail it sounded like a conflict
of mutexes between stringshare and share_common... thus my confusion when i saw
none. :)

yup - you are right. eina_share_common_del calls
eina_share_common_population_del and both try and get a mutex lock on
_mutex_big.  recursive lock... but how has this been working so far? this
SHOULD deadlock each and every time we del a string > 4 chars in length from
stringshare.. and we do that VERY OFTEN.

> And, in eina_share_common_del at eina_share_common.c:813 we have
> the the following statement:
> 
>    eina_lock_take(&_mutex_big);
> 
> at line 823.
> 
> And then at line 830 we have the call to eina_share_common_population_del as
> follows:
> 
>    eina_share_common_population_del(share, slen);
> 
> Then at line 260 we have:
> 
> void
> eina_share_common_population_del(Eina_Share *share, int slen)
> {
>    eina_lock_take(&_mutex_big);
> 
>    share->population.count--;
>    if (slen < 4)
>       share->population_group[slen].count--;
> 
>    eina_lock_release(&_mutex_big);
> }
> 
> 
> Locking again _mutex_big. Which causes the deadlocks. I'm actually seeing this
> with most elementary use when compiling efl with profile=debug. It
> doesn't actually
> assert though, it just logs error (with a printf at
> eina_inline_lock_posix.x:189) and
> continues without locking (pthread_mutex_lock fails with EDEADLK) assuming
> the lock succeeded, if I read the code correctly.

oooh pthread has been detecting a recursive lock (deadlock) (within the same
thread) and surviving? but we don't SEE the problem until we enable debug... and
thus your noise? got it! 

> 
> > --
> > ------------- Codito, ergo sum - "I code, therefore I am" --------------
> > The Rasterman (Carsten Haitzler)    [email protected]
> 
> Kind regards,
> -- 
> Felipe Magno de Almeida
> 
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    [email protected]


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to