casseopea2 / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Spinlock is not reentrant #160

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Experienced this with an error during shutdown of a dll triggering the 
load of a dll for resources to generate a message.  The spinlock deadlocks 
in the same thread under these circumstances.

What is the expected output? What do you see instead?
Expected that spinlock not deadlock when the current thread has 
ownership.  Instead it spun in slowlock forever.

What version of the product are you using? On what operating system?
Perftools 1.3

Please provide any additional information below.

I changed the spinlock to track the current thread id instead along with 
an ownership reference count.  

Note these are using win32 apis and are not portable.  I'm not sure what 
the apis are on other platforms.

Original issue reported on code.google.com by escri...@hotmail.com on 21 Jul 2009 at 2:48

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for taking the time to put together a patch.

I have two concerns:
Do you have the original callstacks of the deadlock?  A DLL getting loaded 
while the 
spinlock is held seems like a very bad condition indeed - we may want to ensure 
that 
doesn't happen rather than this fix.  Further, threads should not be exiting 
while 
holding the lock - so something else fishy may be going on as well.  (To this 
end, 
you may have more luck using the statically linked version of tcmalloc?)

Second, the changes to spinlock.cc are all windows-specific, but that is cross 
platform code, so this patch will need more work (but I hope we can tackle the 
root 
issue)

Original comment by mike%belshe.com@gtempaccount.com on 21 Jul 2009 at 7:43

GoogleCodeExporter commented 9 years ago
Ping -- any more info on this?  I've not seen this problem myself, so I'm going 
to
have to close the bug as CannotReproduce unless we can get a bit more data 
about it.

Original comment by csilv...@gmail.com on 14 Oct 2009 at 11:08

GoogleCodeExporter commented 9 years ago
Oh well.  Closing.

Original comment by csilv...@gmail.com on 10 Mar 2010 at 6:15