Faculty of Information Technology
Software Engineering Group

Opened 7 years ago

Closed 7 years ago

#57 closed defect (fixed)

Possible race condition when resolving references

Reported by: Jan Vraný Owned by: Jan Vraný
Priority: major Milestone: milestone:
Component: stx:libjava Keywords:
Cc: hlopkmar


There's a possibility of race condition when resolving references. For example, when resolving field, not only ref's valueCache slot is filled but also an offset and type instvars.

Imagine thread A is actually resolving the field and already filled ref's valueCache but not yet filled the offset and type slots.
Now other thread B wants to access the field identified by the same field ref. valueCache is not nil so it assumes the field is resolved but offset is nil. We have a problem :-)

The solution would be to synchronize (by means of MONITORENTER / MONITOREXIT) on class objects. However, this would require to fix monitor handling to use thinlocks for Java classes as well for fat locks are slow.

Change History (1)

comment:1 Changed 7 years ago by Jan Vraný

Resolution: fixed
Status: newclosed

Was fixed in d4963adcb114

Note: See TracTickets for help on using tickets.