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.

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.

> --
> ------------- 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

Reply via email to