Bug 553848 - [win32] Crash on focus change with Chinese input method
Summary: [win32] Crash on focus change with Chinese input method
Status: CLOSED DUPLICATE of bug 551067
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.14   Edit
Hardware: PC Windows 10
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-05 22:43 EST by gong md CLA
Modified: 2019-12-12 01:10 EST (History)
2 users (show)

See Also:


Attachments
The crash logs (34.35 KB, application/octet-stream)
2019-12-05 22:46 EST, gong md CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description gong md CLA 2019-12-05 22:43:55 EST
I write a RCP program with eclipse3.8 a long time ago, recently, I upgraded it to eclipse4.13.
Then, I find, When I use input Chinese characters, it always crashes.
But when I use the English input method, it works well.


-- Configuration Details --
Product: Eclipse IDE 4.13.0.20190917-0000 (org.eclipse.epp.package.rcp.product)Installed Features:
 org.eclipse.platform 4.13.0.v20190916-1323
Comment 1 gong md CLA 2019-12-05 22:46:51 EST
Created attachment 280890 [details]
The crash logs

The crash logs
Comment 2 gong md CLA 2019-12-06 04:40:34 EST
I found a little clue:

maybe is the autoScaleDown method in the org.eclipse.swt.internal.DPIUtil.java caused the crash.

When I use the following methods:
gc.drawImage(icon, x, y)
gc.getFontMetrics().getAverageCharacterWidth()

it call autoScaleDown,then crash.

I used a 4k HiDPI screen(3840*2160), and with scale 250%, windows10 system.

also, maybe org.eclipse.swt.graphics.GC.drawTextInPixels caused crash?
Comment 3 gong md CLA 2019-12-06 05:07:17 EST
I also call gc.setLineWidth() method, and use Chinese input method when the control loses focus,it crash!
Comment 4 Paul Pazderski CLA 2019-12-06 05:13:24 EST
(In reply to gong md from comment #3)
> when the control loses focus,it crash!

Do all your experiments some steps involving focus? Could you try with a more recent version, e.g. 4.14M3? This might be bug 551067 which is fixed since 4.14M1.
Comment 5 Andrey Loskutov CLA 2019-12-06 08:47:52 EST
Yes, sounds like a duplicate of bug 551067. Please reopen if the crash still occurs with 4.14 M1 or higher version.

*** This bug has been marked as a duplicate of bug 551067 ***
Comment 6 gong md CLA 2019-12-06 23:28:29 EST
I will test it on version 4.14RC2
Comment 7 gong md CLA 2019-12-11 06:36:47 EST
I tested on version 4.14RC2, still crash...
Comment 8 gong md CLA 2019-12-11 06:48:34 EST
In version 4.13, when the control loses focus,only use chinese input method can cause crash, use english input method not crash。

but in version4.14RC2, when the control loses focus, the frequency of crashes has been reduced so much that I once thought that the bug was resolved。But occasionally it still crashes, whether using Chinese input method or English input method。
Comment 9 gong md CLA 2019-12-11 06:56:28 EST
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffed63caca8, pid=8364, tid=0x0000000000000cf8
#
# JRE version: Java(TM) SE Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.202-b08 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [MSCTF.dll+0x2aca8]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x000000000351e000):  JavaThread "main" [_thread_in_native, id=3320, stack(0x0000000003520000,0x0000000003620000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000020

Registers:
RAX=0x0000000000000000, RBX=0x000000003478a0d0, RCX=0x00000000015b4900, RDX=0x0000000000000002
RSP=0x0000000003619ea0, RBP=0x0000000000000000, RSI=0x0000000000000000, RDI=0x0000000040000000
R8 =0x000000000157c2a0, R9 =0x0000000000000000, R10=0x000000000361a090, R11=0x0000000003619f10
R12=0x00000000ffffffff, R13=0x0000000000000000, R14=0x0000000000000000, R15=0x0000000000000000
RIP=0x00007ffed63caca8, EFLAGS=0x0000000000010206

Top of Stack: (sp=0x0000000003619ea0)
0x0000000003619ea0:   0000000000000000 00007ffed41eaa3b
0x0000000003619eb0:   0000000000000000 000000000361a138
0x0000000003619ec0:   00000000015b7c30 0000000000000001
0x0000000003619ed0:   0000000000000000 0000000000000000
0x0000000003619ee0:   0000000001534db0 00007ffed63be4da
0x0000000003619ef0:   0000e5f7a2077609 0000000000000001
0x0000000003619f00:   0000000000000001 0000000001cefe80
0x0000000003619f10:   0000000000000000 0000000000000002
0x0000000003619f20:   000000003478a108 00007ffed63ca6cd
0x0000000003619f30:   00007ffed6492848 0000000000000002
0x0000000003619f40:   0000000000000000 0000000000000000
0x0000000003619f50:   ffffffffc50a07f7 0000000000000000
0x0000000003619f60:   0000000700000000 00000005c2efdc78
0x0000000003619f70:   ffffffffc50a07f7 0000000003881b1c
0x0000000003619f80:   000000000000000b 0000000034789b60
0x0000000003619f90:   0000000000290d3e 000000000361a100 

Instructions: (pc=0x00007ffed63caca8)
0x00007ffed63cac88:   c9 74 0d 48 8b 01 48 8b 40 10 ff 15 30 0e 0d 00
0x00007ffed63cac98:   ff c6 3b 77 38 0f 8d 8e fd ff ff eb bb 48 8b 01
0x00007ffed63caca8:   48 8b 40 20 e9 05 ff ff ff 4d 8b 66 48 4d 85 e4
0x00007ffed63cacb8:   0f 85 c0 f5 02 00 4d 8b 76 18 4d 85 f6 0f 84 5d 


Register to memory mapping:

RAX=0x0000000000000000 is an unknown value
RBX=0x000000003478a0d0 is an unknown value
RCX=0x00000000015b4900 is an unknown value
RDX=0x0000000000000002 is an unknown value
RSP=0x0000000003619ea0 is pointing into the stack for thread: 0x000000000351e000
RBP=0x0000000000000000 is an unknown value
RSI=0x0000000000000000 is an unknown value
RDI=0x0000000040000000 is an unknown value
R8 =0x000000000157c2a0 is an unknown value
R9 =0x0000000000000000 is an unknown value
R10=0x000000000361a090 is pointing into the stack for thread: 0x000000000351e000
R11=0x0000000003619f10 is pointing into the stack for thread: 0x000000000351e000
R12=0x00000000ffffffff is an unknown value
R13=0x0000000000000000 is an unknown value
R14=0x0000000000000000 is an unknown value
R15=0x0000000000000000 is an unknown value


Stack: [0x0000000003520000,0x0000000003620000],  sp=0x0000000003619ea0,  free space=999k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 3574  org.eclipse.swt.internal.win32.OS.CallWindowProc(JJIJJ)J (0 bytes) @ 0x0000000003881a96 [0x0000000003881a40+0x56]
J 4705 C1 org.eclipse.swt.widgets.Text.callWindowProc(JIJJ)J (1170 bytes) @ 0x00000000045e88fc [0x00000000045e6f40+0x19bc]
J 4698 C2 org.eclipse.swt.widgets.Control.windowProc(JIJJ)J (1980 bytes) @ 0x00000000045f2198 [0x00000000045f1ae0+0x6b8]
J 4704 C1 org.eclipse.swt.widgets.Text.windowProc(JIJJ)J (465 bytes) @ 0x00000000045e5b64 [0x00000000045e4ea0+0xcc4]
J 4084 C2 org.eclipse.swt.widgets.Display.windowProc(JJJJ)J (108 bytes) @ 0x00000000044965f8 [0x00000000044964c0+0x138]
v  ~StubRoutines::call_stub
J 3574  org.eclipse.swt.internal.win32.OS.CallWindowProc(JJIJJ)J (0 bytes) @ 0x0000000003881a96 [0x0000000003881a40+0x56]
J 4705 C1 org.eclipse.swt.widgets.Text.callWindowProc(JIJJ)J (1170 bytes) @ 0x00000000045e88fc [0x00000000045e6f40+0x19bc]
j  org.eclipse.swt.widgets.Widget.wmSetFocus(JJJ)Lorg/eclipse/swt/internal/win32/LRESULT;+7
j  org.eclipse.swt.widgets.Control.WM_SETFOCUS(JJ)Lorg/eclipse/swt/internal/win32/LRESULT;+7
J 4698 C2 org.eclipse.swt.widgets.Control.windowProc(JIJJ)J (1980 bytes) @ 0x00000000045f29dc [0x00000000045f1ae0+0xefc]
J 4704 C1 org.eclipse.swt.widgets.Text.windowProc(JIJJ)J (465 bytes) @ 0x00000000045e5b64 [0x00000000045e4ea0+0xcc4]
J 4084 C2 org.eclipse.swt.widgets.Display.windowProc(JJJJ)J (108 bytes) @ 0x0000000004496534 [0x00000000044964c0+0x74]
v  ~StubRoutines::call_stub
j  org.eclipse.swt.internal.win32.OS.SetFocus(J)J+0
j  org.eclipse.swt.widgets.Control.forceFocus()Z+69
j  org.eclipse.swt.widgets.Control.setFocus()Z+18
Comment 10 gong md CLA 2019-12-12 01:06:41 EST
This bug has been marked as a duplicate of bug 551067,and already been fixed!
Comment 11 Andrey Loskutov CLA 2019-12-12 01:10:45 EST

*** This bug has been marked as a duplicate of bug 551067 ***