Community
Participate
Working Groups
Build Identifier: I20100520-1744 Using moveAbove to move a Label in a Composite after a Label from that Composite has previously been disposed results in a segfault in the circumstances described in "Steps to Reproduce". The test case works fine with Eclipse 3.5.1 (M20090917-0800), SWT jarfile org.eclipse.swt.gtk.linux.x86.source_3.5.1.v3555a.jar. It crashes with 3.6RC2 (SWT jarfile org.eclipse.swt.gtk.linux.x86.source_3.6.0.v3649.jar). Reproducible: Always Steps to Reproduce: 1. Run attached test case. 2. Click "Crash Me". Or, 1. Add a Label widget and then a Text widget to a Composite. 2. Dispose the Label. 3. Add a new Label widget to the Composite and use moveAbove to move it above the Text widget.
Created attachment 170726 [details] Test case that demonstrates the bug.
Created attachment 170727 [details] Sample JVM crash report.
Created attachment 170740 [details] Patch This is bad. SWT is incorrectly trying to get the accesibility for the disposed label, due to which native crash is seen. The fix is to make sure SWT does not remove relation when the label control is disposed. Silenio, I believe this is an important fix that should be released. Please review and post your comments.
Created attachment 170810 [details] final patch The patch above avoided the crash but left a relation to the disposed control. This patch removes the relation before the widget is disposed.
Boris/John please review this for RC4.
Reviewed together with Silenio. We think there might be a similar bug in the Cocoa code, but we'll treat it separately because it might not cause a crash.
Based on review with Silenio and John.
I confirmed that cocoa/carbon (which have similar code in Control.release(boolean) do not crash with this test case. The difference is that, in cocoa/carbon, the control does not have a reference to the label. I will open a bug to considered making similar changes in cocoa/carbon post 3.6.
Fixed > 20100602