Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320581

Summary: [Widgets] [GTK2.18] JVM crash when call Control.moveAbove(Control control)
Product: [Eclipse Project] Platform Reporter: Ryan Xu <xuruoyu1979>
Component: SWTAssignee: Lakshmi P Shanmugam <lshanmug>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, martin.gutschelhofer, mober.at+eclipse, remy.suen, Silenio_Quarti
Version: 3.5.2Flags: eclipse.felipe: review+
Silenio_Quarti: review+
Target Milestone: 3.6.1   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=287307
Whiteboard:
Attachments:
Description Flags
A snippet can reproduce this issue
none
The log file of JVM
none
A simple patch of moveAbove()
none
Patch none

Description Ryan Xu CLA 2010-07-21 23:14:42 EDT
Build Identifier: 20100218-1602

Under my working environment (Ubuntu 10.04 with JDK 1.5.0_16-b02), call function Control.moveAbove(Control control) to move a control above itself will cause JVM crash.

Reproducible: Always

Steps to Reproduce:
1.write a simple snippet
2.Call Control.moveAbove(Control control) to move a control above itself.
3.JVM crash under ubuntu 9.10(GTK+ 2.18.3) and ubuntu 10.04(GTK+ 2.20.1)
Comment 1 Ryan Xu CLA 2010-07-21 23:20:39 EDT
Created attachment 174940 [details]
A snippet can reproduce this issue

This snippet can reproduce this issue under ubuntu 10.04 (GTK+ 2.20.1) with eclipse >= 3.5.2
Comment 2 Ryan Xu CLA 2010-07-21 23:23:56 EDT
Created attachment 174942 [details]
The log file of JVM

From the log file of JVM, the exception happend in the native call gdk_window_restack, this function call is added after eclipse 3.5.2(tag 3557).

See bug 287307.
Comment 3 Ryan Xu CLA 2010-07-21 23:32:56 EDT
Created attachment 174943 [details]
A simple patch of moveAbove()

Add one line to detect if the sibling control is the same control.
Comment 4 Felipe Heidrich CLA 2010-07-22 09:20:54 EDT
Lakshmi, do you have GTK 2.18 ?

Can you confirm the crash and release fix ? It looks pretty easy.
Comment 5 Lakshmi P Shanmugam CLA 2010-07-22 10:33:47 EDT
Created attachment 174982 [details]
Patch

I can reproduce the crash on my machine.
The patch prevents the crash. 
Added similar check in Control.moveBelow() too, though it doesn't crash it'll avoid the call to setZOrder().
Comment 6 Martin Oberhuber CLA 2010-07-22 14:47:54 EDT
CQ:WIND00223995
Comment 7 Lakshmi P Shanmugam CLA 2010-07-26 04:53:40 EDT
Fixed in HEAD > 20100726
Comment 8 Lakshmi P Shanmugam CLA 2010-07-26 04:54:21 EDT
.
Comment 9 Ryan Xu CLA 2010-08-02 04:05:58 EDT
(In reply to comment #7)
> Fixed in HEAD > 20100726

Hi,Lakshmi

Do we have any plan to backport this fix to 3.6?

Regards
Comment 10 Lakshmi P Shanmugam CLA 2010-08-02 04:54:34 EDT
Hi Felipe, can this go for 3.6.1?
Comment 11 Felipe Heidrich CLA 2010-08-04 11:26:23 EDT
Yes
Comment 12 Lakshmi P Shanmugam CLA 2010-08-05 03:32:42 EDT
Fixed in 3.6.1 branch.