Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320581 - [Widgets] [GTK2.18] JVM crash when call Control.moveAbove(Control control)
Summary: [Widgets] [GTK2.18] JVM crash when call Control.moveAbove(Control control)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.6.1   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-21 23:14 EDT by Ryan Xu CLA
Modified: 2010-08-25 10:56 EDT (History)
5 users (show)

See Also:
eclipse.felipe: review+
Silenio_Quarti: review+


Attachments
A snippet can reproduce this issue (2.10 KB, application/octet-stream)
2010-07-21 23:20 EDT, Ryan Xu CLA
no flags Details
The log file of JVM (32.00 KB, application/octet-stream)
2010-07-21 23:23 EDT, Ryan Xu CLA
no flags Details
A simple patch of moveAbove() (513 bytes, text/plain)
2010-07-21 23:32 EDT, Ryan Xu CLA
no flags Details
Patch (961 bytes, patch)
2010-07-22 10:33 EDT, Lakshmi P Shanmugam CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.