Operator187 / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

Thread-safety bug in ExtensionCollection cache #577

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Manipulate ContactEntry objects from multiple threads at once.

What is the expected output? What do you see instead?

I'd expect the API to be thread-safe in regard to the data-only objects, but it 
isn't. The internal cache in Google.GData.Extensions.ExtensionCollection is 
static and it is not properly locked for concurrent access.

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

Google Contacts API, Windows 7

Please provide any additional information below.

System.NullReferenceException ( Object reference not set to an instance of an 
object. ) 
System.Collections.Generic.Dictionary`2.Insert(<UnknownType> key, <UnknownType> 
value, System.Boolean add)+241
Google.GData.Extensions.ExtensionCollection`1.CtorXmlName+37
Google.GData.Extensions.ExtensionCollection`1..ctor(Google.GData.Client.IExtensi
onContainer containerElement)+0
Google.GData.Contacts.ContactEntry.get_Emails+8
Google.Contacts.Contact.get_Emails+0

Original issue reported on code.google.com by filip.na...@gmail.com on 14 Mar 2012 at 12:32

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks Filip, I committed your patch in rev. 1164:

http://code.google.com/p/google-gdata/source/detail?r=1164

Original comment by ccherub...@google.com on 14 Mar 2012 at 5:05