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

Bug 480150

Summary: NPE in ClipboardProxy.getFunc or JVM Crash on JNI_ArgumentPusherVaArg when simulating copy/paste on Linux
Product: [Eclipse Project] Platform Reporter: Leon Blakey <leon.m.blakey>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, ericwill
Version: 4.6Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
BreakClipboard.java
none
JVM Crash none

Description Leon Blakey CLA 2015-10-19 13:22:29 EDT
Created attachment 257361 [details]
BreakClipboard.java

I'm experiencing either a JVM crash or a NPE inside Clipboard proxy when using SWTBot for copy and paste tests. The attached test will open a window, try to cut and paste text, close, then repeat. A copy and paste will be successful the first time but will fail the second time. Usually I will get a NPE, but if there is text on the clipboard from Netbeans I'll usually get a JVM crash. 

JVM Crash: See comment 2
or
Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.swt.dnd.ClipboardProxy.getFunc(Unknown Source)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(Unknown Source)
	at org.eclipse.swt.widgets.Display.eventProc(Unknown Source)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(Unknown Source)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
	at org.aph.swtcrash.BreakClipboard.doPendingSWTWork(BreakSWT.java:55)
	at org.aph.swtcrash.BreakClipboard.runTest(BreakSWT.java:43)
	at org.aph.swtcrash.BreakClipboard.main(BreakSWT.java:19)

This is reproducible on 2 different machines. Nether has glippy or other clipboard managers running. I was not able to reproduce on Gnome nor Windows 7 or 10. 

Both Environments:
Java: Oracle JDK 1.8.0_60-b27
SWT: 4.5.1 (also happened on 4.5)
org.eclipse.swtbot.swt.finder: 2.3.0.201506081302-2-SNAPSHOT
org.eclipse.jface: 3.12.0.v20150914-1638-SNAPSHOT

Environment 1:
OS: Ubuntu 14.04
DE: Openbox 3.5.2-6

Environment 2:
OS: Debian Testing
DE: i3 4.11-1

To reproduce:
Run attached BreakClipboard class with SWT, SWTBot, JFace, and hamcrest

I can provide more information if needed
Comment 1 Leon Blakey CLA 2015-10-19 13:23:13 EDT
Created attachment 257362 [details]
JVM Crash
Comment 2 Alexander Kurtakov CLA 2017-12-15 15:36:58 EST
Is this still reproducible?
Comment 3 Eric Williams CLA 2018-08-16 11:19:17 EDT
(In reply to Alexander Kurtakov from comment #2)
> Is this still reproducible?

No comment in months, closing this ticket now. Please reopen it if the issue occurs again.