#1452 Protect accesses to ParserScheduler.state

closed-fixed
nobody
None
5
2012-01-25
2012-01-05
Mohsen Vakilian
No

There is a potential data race on "org.python.pydev.parser.ParserScheduler.state" because this field is shared data between "org.python.pydev.parser.ParserScheduler" <https://github.com/aptana/Pydev/blob/20ee5bd0bd8a02b8dca0d8106e1b79978048abc5/plugins/org.python.pydev.parser/src/org/python/pydev/parser/ParserScheduler.java> and "org.python.pydev.parser.ParsingThread" <https://github.com/aptana/Pydev/blob/20ee5bd0bd8a02b8dca0d8106e1b79978048abc5/plugins/org.python.pydev.parser/src/org/python/pydev/parser/ParsingThread.java> but its accesses are not protected.

Methods"org.python.pydev.parser.ParserScheduler.parseNow(boolean, Object ...)" and "org.python.pydev.parser.run()" may have conflicting concurrent accesses to field "org.python.pydev.parser.ParserScheduler.state". Therefore it is safer to make "org.python.pydev.parser.ParserScheduler.state" volatile.

This is an instance of VNA00-J <https://www.securecoding.cert.org/confluence/display/java/VNA00-J.+Ensure+visibility+when+accessing+shared+primitive+variables> and similar to Bug ID: 3469676, Bug ID: Bug 3469677, and Bug ID: 3469689.

Discussion

  • Fabio Zadrozny
    Fabio Zadrozny
    2012-01-25

    Fixed for 2.4.0

    Git
    2612813 1327515098 2012-01-25 fabioz Marking some fields as volatile in the parsing as they're accessed by multiple threads

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2012-01-25

    • status: open --> closed-fixed