[visad] Display bug found in VisAD: Geometry Disappears

Hi All, I believe I have found a display bug in VisAD.

This bug was observed in an operational system and through a process of exploration and testing it has been distilled to a VisAD code example (attached).

The bug was observed in code that programmatically removed old data references then added new data references to a DisplayImplJ3D. The bug is manifest by disappearance (from the screen) of the geometry of one of the data references that was recently added.

The bug is intermittent, although occurs approximately 1/2 runs in our operational system, and approximately 1/20 in the standalone code example. The probability of occurrence appears to increase with the increase in the amount of manipulation of the geometry being drawn (fonts, line thickness, transforms, etc).

Analysis shows the geometry is still in the scene graph, and is live. Minimizing, resizing, further add/remove data references, and forced doAction on the display do not correct the bug. Major operations on the display that force a full re-draw (switching virtual desktops on Linux, zoom operation in our application) will cause the geometry to be displayed again.

Further analysis shows that the bug is invariant to making the remove/add data reference calls from the same and different threads. The bug may be related to a race condition, but it is likely deeper within the VisAd infrastructure (or even Java3D!?).

This bug was observed operationally on Linux machines (redhat), in development (fedora12), and has been reproduced on a windows machine (winXP). The bug occurs with both Sun Java 1.5, 1.6, and Open JDK 1.6. Java3D version 1.5.1 was used in all cases. The bug occurs with VisAD release 20100224 (Wed Feb 24 09:48:08 CST 2010) and the nightly build 20100418. I believe all test machines had multiple cores.

I have attached a sample program (bug.ReproduceVISADBug) that will generate the bug (please add visad.jar to the lib directory). The test program draws a line and some text, then removes/adds data references, the result is either the normal case (line and text are displayed) or the bug case (either text or line are not displayed). I have included an ant script and target (run-many) that can be used to launch the program 20 times, one of which is likely to show an example of the bug. The attached archive also includes some screenshots of the normal and bug cases experienced with the sample application (for verification).

The sample code is intentionally lean and may use some bad practices, although I believe that the bug is invariant. Nevertheless, I am wide open to suggestions and critiques.

I've been climbing through VisAD without luck. Please let me know if I can gather further evidence in order to help resolve this issue.

Sincerely,

Dr Jason Brownlee
Software Engineer
Australian Bureau of Meteorology

Attachment: VisADBug.tar.gz
Description: GNU Zip compressed data