To keep a Graphical User Interface (GUI) responsive and active, a GUI application often has a main UI thread (or event dispatching thread) and spawns separate threads to handle lengthy operations in the background. Many GUI frameworks require all GUI objects to be accessed exclusively by the UI thread. If a GUI object is accessed through a non-UI thread, an invalid thread access error occurs and the whole application may abort.
This project investigates new techniques to find such invalid thread access errors in multithreaded GUI applications. We formulate finding invalid thread access errors as a call graph reachability problem with thread spawning as the sources and GUI object accessing as the sinks.
An initial implementation supports four popular Java GUI platforms: SWT, the Eclipse plugin development framework, Swing, and Android. In an evaluation of 9 programs comprising 67000 LOC, our technique found both previously known and unknown errors.