Bug 54648 - JMeter GUI on OS X crashes when using CMD+C (keyboard shortcut or UI menu entry) on an element from the tree
Summary: JMeter GUI on OS X crashes when using CMD+C (keyboard shortcut or UI menu ent...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.9
Hardware: Macintosh All
: P2 normal with 4 votes (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
: 56690 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-03-06 17:30 UTC by Adrian S
Modified: 2014-09-10 19:17 UTC (History)
3 users (show)



Attachments
complete stack trace (22.08 KB, text/plain)
2013-03-06 17:30 UTC, Adrian S
Details
jmeter log (debug level) (52.93 KB, application/octet-stream)
2013-04-15 09:51 UTC, Adrian S
Details
jmeter log (debug level) - resubmitted (54.44 KB, text/plain)
2013-04-15 16:10 UTC, Adrian S
Details
sys1 stack trace (15.04 KB, text/plain)
2013-08-02 15:37 UTC, toogoodtopassup
Details
sys2 stack trace (15.71 KB, text/plain)
2013-08-02 15:37 UTC, toogoodtopassup
Details
debug jmeter.log on error (92.01 KB, text/plain)
2013-10-09 18:53 UTC, Matt Kilbride
Details
debug jmeter.log on error (idea plugin removed) (92.47 KB, text/plain)
2013-10-09 20:32 UTC, Matt Kilbride
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian S 2013-03-06 17:30:58 UTC
Created attachment 30025 [details]
complete stack trace

Tested with latest nightly too, just in case someone else noticed it and fixed it in the mean time. Its a problem introduced in 2.9 (works on 2.8, on the same machine).

[environment]
mac os x 10.7 with apple's java version

[steps]
 1. open a test plan or not
 2. select an element from the tree list
 3. try copying it: using the menu or pressing CMD+C
=> the interface crashes and jmeter becomes unusable.

---

[error]
jmeter.gui.action.Copy: Clipboard node read error:com.apple.laf.AquaTreeUI java.io.NotSerializableException: com.apple.laf.AquaTreeUI

further details in attachment.
Comment 1 Adrian S 2013-03-06 17:38:50 UTC
Might be significant: am using "Mac OS X" "look and feel". Without it, the GUI would crash when CMD+C in text fields too. 

Workaround: 2.8... the only alternative to being able to move elements from a test script to another at the moment.
Comment 2 Philippe Mouawad 2013-03-06 18:00:06 UTC
Hello,
I have a Mac OSX 10.6.8 with last Java version and don't reproduce this issue.
Can you switch to CrossPlatform LaF and see if it happens again.

Also What is you java version ?

Thanks
Comment 3 Adrian S 2013-03-07 12:16:03 UTC
Additional details, as requested: 

OS X 10.7.5 (10.7 wasn't in the OS list, this is why bug had 10.6)

java version "1.6.0_41"
Java(TM) SE Runtime Environment (build 1.6.0_41-b02-445-11M4107)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-445, mixed mode)

---

With all styles other than Mac OS X, it also crashes when using Copy (or the keyboard shortcut) in text fields as well as trying to copy nodes (different stack trace though). With Mac OS X style, it crashes only when copying nodes.

I've changed styles in GUI. In jmeter.properties, all such options are commented.
Comment 4 Philippe Mouawad 2013-04-13 20:20:15 UTC
Not reproduced on Mac Os 10.8.2
Comment 5 Philippe Mouawad 2013-04-14 13:45:21 UTC
Hello,
Can you confirm no external plugins was used ?
Thanks
Comment 6 Adrian S 2013-04-15 08:36:33 UTC
Confirmed. 

Downloaded the files again just to make sure.

The issue reproduces on OS X 10.7.5, when copying nodes, using versions 2.9 release/nightly and it does not happen in 2.8. Re-tested without plugins & the java version that Mac OS X provides and using the system/mac os x/cross platform layouts.

It also happens with latest jdk7 installed from oracle download site, just to make sure its not Apple's java related. I'm trying to think of system specifics that can affect this, but I was running on defaults until installing the latest jdk from Oracle. I don't know what additional info to give, all I have is the stacktrace and a system where it reproduces systematically.
Comment 7 Philippe Mouawad 2013-04-15 09:20:56 UTC
Thanks very much for your feedback Adrian.

Can you attach your jmeter.log file after adding this in user.properties and restarting JMeter and playing the scenario to reproduce issue:
log_level.jmeter=DEBUG

In fact it is regular that issue does not occur in 2.8 as Copy/paste feature has been rewritten to allow copy/paste between different JMeter instances.

Regarding crashes, it is really strange as I don't reproduce it on my Mac 10.6.8 and my colleague with a 10.8.2 does not either.

Sorry for this issue, I understand it can bother you but if we cannot reproduce it it is hard to fix it.

Also if you have some time , I would be grateful to you if you can reproduce 54799 bug and if you do provide us a heap dump somewhere as described in bug.
Comment 8 Adrian S 2013-04-15 09:51:22 UTC
Created attachment 30195 [details]
jmeter log (debug level)

Added new information: full jmeter log with debug level set. The test steps are simple, use jmeter.sh to start the application, set layout to system, add a thread group and a sampler than use CMD+C on the sampler. The interface brakes and becomes unusable. 

Mac OS X 10.7
JDK 7u17
Comment 9 Adrian S 2013-04-15 09:56:13 UTC
(In reply to comment #7)
> 
> Also if you have some time , I would be grateful to you if you can reproduce
> 54799 bug and if you do provide us a heap dump somewhere as described in bug.

Its not a matter of frustration, I rolled back to 2.8 for GUI work. Thanks for the assistance. 

I've tried reproducing 54799, but with no luck, it works fine on the same version & settings that help me reproduced current issue.
Comment 10 Adrian S 2013-04-15 16:10:27 UTC
Created attachment 30197 [details]
jmeter log (debug level) - resubmitted
Comment 11 toogoodtopassup 2013-08-02 15:08:50 UTC
I can confirm that this happens on both of my Mac systems.

SYSTEM 1:
The specific system I used to reproduce this on:
OS X 10.8.4 (3.4G Intel Core i7 w/ 16GB RAM) iMac
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

Steps to Reproduce:

1) Open app from terminal window:  java -jar ApacheJMeter.jar
2) Enable logging:  Options | Log Viewer
2) rt-click to Add new thread group
3) rt-click on Thread Group and copy
>> Error dialog is displayed <<
= = = = = = = = = = = = = 
[res_key=clipboard_node_read_error]:
com.apple.laf.AquaTreeUI
= = = = = = = = = = = = = 
The main Tree display becomes blank and unusable at this point, though the menu options at the top of the window continue to work.

On this system I've discovered that switching to the Generic UI is a workaround IF THE APP IS RESTARTED AFTER THE SWITCH:
1) Switch to the generic UI:  Options | LaF | Generic
2) RESTART
The copy operation now works as expected.

Note that the Options | Look and Feel menu does not indicate the chosen LaF (a separate bug?).


SYSTEM 2:
Similar, but has some different behaviors:
OS X 10.8.4 (2.2G Intel Core i7 w/ 8GB RAM) Laptop
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

Everything behaves same until I switch to the Generic LaF.  Instead of fixing the issue, I just get a slightly different error when copying:
= = = = = = = = = = = = = 
[res_key=clipboard_node_read_error]:
org.apache.log.format.PatternFormatter
= = = = = = = = = = = = = 

I'll attach both debug log files.  I'm switching the status to NEW, since I think I have supplied the needed reproducibility info.
Comment 12 toogoodtopassup 2013-08-02 15:35:14 UTC
As a followup to my previous message, I get very similar results on System 1 when using Java 7:
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
Comment 13 toogoodtopassup 2013-08-02 15:37:11 UTC
Created attachment 30666 [details]
sys1 stack trace

refer to comment from toogoodtopassup.  This is the system 1 stack trace, running w/ the Mac look and feel.
Comment 14 toogoodtopassup 2013-08-02 15:37:42 UTC
Created attachment 30667 [details]
sys2 stack trace

refer to comment from toogoodtopassup.  This is the system 2 stack trace with the Generic LaF.
Comment 15 spiermar 2013-08-22 22:04:49 UTC
I can duplicate the issue. Mac OS 10.7.5, latest vanilla JMeter from trunk (r1516413).
Comment 16 Philippe Mouawad 2013-09-27 22:24:43 UTC
Cannot reproduce on Mac OS X 10.8.5, JDK 6 or 7.
Comment 17 Philippe Mouawad 2013-09-28 20:54:37 UTC
Unable to reproduce with either :
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

Nor:
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

Neither with 2.9 nor Nightly Build.
I do exactly the same scenario as Adrian S or toogoodtopassup.

Neither using System LAF or Cross Platform LAF.
Same spec as toogoodtopassup.

Could it be due to difference in OSX version ?
Comment 18 Adrian S 2013-10-09 13:16:45 UTC
No Philippe, in my tests I could not confirm that it is related to the mac version and apparently neither does the java version matter. We have several stations here (10.7 and 10.8, updated). It reproduces on some of them, it doesn't on others. On those that it reproduces, it does so with 100% reproducibility. 

I was hopping it was a Java bug, but I have several other applications that, I think, use the same UI framework, burp suite and charles and they work fine.

This is why we need to try something different. Would a heap dump be of any use, do we need to make a different log configuration? I'm even willing to setup a remote desktop session, it depends on how you prioritise this issue, but its not clear what kind of information you require.

Thanks.
Comment 19 Matt Kilbride 2013-10-09 18:41:44 UTC
I have this problem as well on 10.7.5. I'm uploading my debug log. I went back to 2.8 for now.
Comment 20 Matt Kilbride 2013-10-09 18:53:11 UTC
Created attachment 30914 [details]
debug jmeter.log on error
Comment 21 Philippe Mouawad 2013-10-09 19:22:44 UTC
@Matt,
 It seems you have jmeter-idea-plugin-1.4.jar in lib/ext.
Could you try removing it, restart and see if you reproduce ?

@Adrian, is it exactly the same bundle when you reproduce and don't ? Could you try switching the zips ? put the broken on the machine where it does work and the working one on the machine where it does not work .

Are the machines equivalent in Power ? What is the difference ?


Regarding priority , my big issue is that I don't reproduce it on none of my Mac Osx machines. So how to fix it ? 
Maybe try putting log level to debug ?

Also any weird option in starter ? try doing a ps -eaf | grep java and show results here .

Thanks
Comment 22 Matt Kilbride 2013-10-09 20:32:04 UTC
Created attachment 30915 [details]
debug jmeter.log on error (idea plugin removed)

The issue remains after removing the jmeter-idea-plugin-1.4.jar.
Comment 23 Matt Kilbride 2013-10-09 23:51:45 UTC
This is my java process:  /usr/bin/java -server -XX:+HeapDumpOnOutOfMemoryError -Xms512m -Xmx512m -XX:NewSize=128m -XX:MaxNewSize=128m -XX:MaxTenuringThreshold=2 -Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000 -XX:PermSize=64m -XX:MaxPermSize=128m -Xms2g -Xmx2g -jar /Applications/jmeter_2.9/bin/ApacheJMeter.jar
Comment 24 Adrian S 2013-10-15 09:44:21 UTC
(In reply to Philippe Mouawad from comment #21)

> Are the machines equivalent in Power ? What is the difference ?
> 
There are no differences in hardware configuration between the MacBooks.
Comment 25 Matt Kilbride 2013-10-21 19:57:59 UTC
I think I've tracked my issue down. I use TextExpander (which uses "assistive devices"). When I shut TextExpander down, JMeter stopped crashing. I don't have this problem in 2.8. 

Other details:
 - I upgraded to Mountain Lion, and still had the issue
 - I can copy repeatedly without issue if I use right-click, even with TextExpander on
 - I started being able to sometimes get one copy without a crash after my OS upgrade
 - Copy seems to be the problem. Paste does not cause the error. (copy - copy will crash on the second copy. copy - paste - paste - paste - copy will crash on the second copy)
 - The crash only occurs when copying a tree element. In a script, CMD-A, CMD-C isn't a problem.
Comment 26 Philippe Mouawad 2013-10-21 20:01:22 UTC
Hello,
@Matt, when you disable TextExpander on 10.8.5 does it still crash ?
If not, then issue is not a JMeter one.

@Adrian, do you have this utility also installed on your machine ?

Thanks
Comment 27 Matt Kilbride 2013-10-21 21:25:07 UTC
With TextExpander off, it doesn't crash. It does have an option to exclude certain OSX apps (via a GUI interface), but I haven't gotten it to exclude JMeter. TextExpander & JMeter are two apps that I'd have a hard time living without. I'll try to find a workaround, or continue using 2.8. 

Thanks Philippe!
Comment 28 Philippe Mouawad 2013-10-21 21:29:03 UTC
Did you try excluding java from TextExpander ?

Maybe you could report issue to TextExpander .

Have also a look at:
http://www.smilesoftware.com/help/TextExpander/scriptingte.html

>
>avoid expansion bundle prefixes
>
>    A list of text strings with the bundle IDs (or partial prefixes, eg. >com.mozilla will cover com.mozilla.firefox and com.mozilla.camino, etc.) of >applications to avoid expanding or correcting capitalization in.

>    By default, TextExpander avoids expanding into applications where the bundle >ID begins with com.parallels or com.vmware.

>    This can be useful to prevent TextExpander from interacting with certain >applications or Java applets which do not appear in the "all applications, >except..." listing in Expansion Preferences. (To prevent expansion in Java >applets, add com.apple.javajdk16.cmd to this list (change appropriately for >different versions of the JDK).)
Comment 29 Philippe Mouawad 2013-10-21 21:29:24 UTC
it would be sad to stay in  2.8 now 2.10 is out ;-)
Comment 30 Matt Kilbride 2013-10-21 23:57:57 UTC
Considering the performance and UI improvements that I'm missing, it would be sad.  Smile Support is downloading JMeter to attempt to reproduce the issue.
Comment 31 Matt Kilbride 2013-10-22 23:02:20 UTC
Smile Support was able to reproduce the issue, but they were not able to provide a workaround. The hidden prefix filter option was supposed to work, but it didn't, and they didn't sound moved to fix it.

I've set up a hot-key to enable/disable TextExpander quickly. I also verified that save works after I hit the error, so I can recover when I forget to turn it off. Not a great solution, but it'll do. I've moved to 2.10. Thanks for your assistance Philippe!
Comment 32 Adrian S 2013-11-07 17:55:53 UTC
The issue might not be related to TextExpander as it was not used on the system where I reproduced the issue initially. It might be affected by something that TextExpander uses and was used on my system as well. 

I've made a clean upgrade of the OS on the same hardware, to 10.8.5 and now the issue reproduces only if I change the layout to other than MacOSX or CrossPlatform. I consider this behaviour to be different to the one that I've initially reported as on the older system I could reproduce the issue on any layout.
Comment 33 Philippe Mouawad 2013-11-23 14:06:39 UTC
Closing this bug as it is not a JMeter bug but a side effect of a third party application breaking some JVM behaviour on Mac OSX.
Comment 34 Philippe Mouawad 2014-07-02 20:19:05 UTC
*** Bug 56690 has been marked as a duplicate of this bug. ***
Comment 35 Philippe Mouawad 2014-09-08 21:10:44 UTC
After installing Mavericks (10.9.4), I reproduce the issue, scenario:
- Open GenTest210.jmx
- Select all elements under root
- Copy => It fails with NotSerializableException
Comment 36 Philippe Mouawad 2014-09-08 21:21:36 UTC
Date: Mon Sep  8 21:20:24 2014
New Revision: 1623589

URL: http://svn.apache.org/r1623589
Log:
Bug 54648 - JMeter GUI on OS X crashes when using CMD+C (keyboard shortcut or UI menu entry) on an element from the tree

Bugzilla Id: 54648

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeNode.java
Comment 37 Philippe Mouawad 2014-09-08 21:22:31 UTC
@Users who reported this bug, it would be nice to test nightly build tomorrow to see if bug is fixed:

http://jmeter.apache.org/nightly.html


 Installing JMeter runtime
Download the _bin and _lib files
Unpack the archives into the same directory structure
The other archives are not needed to run JMeter.
Comment 38 Sebb 2014-09-08 21:54:07 UTC
(In reply to Philippe Mouawad from comment #35)
> After installing Mavericks (10.9.4), I reproduce the issue, scenario:
> - Open GenTest210.jmx
> - Select all elements under root
> - Copy => It fails with NotSerializableException

What version of Java was that with?

It does not fail for me on Mavericks 10.9.4 with Java 1.8.0_11 nnor 1.7.0_6 nor 1.6.0_65
Comment 39 Adrian S 2014-09-09 08:57:36 UTC
@Sebb: 
the issue does not reproduce on all systems having the same setup, but does reproduce consistently on those systems where it was encountered. Doesn't depend on the java or system version.

@Philippe: 
Good news, the issue doesn't reproduce on nightly r1623612. On the same machine I still experience the issue while using 2.11 released version. Both installations of jmeter are standalone (no plugins, default startup scripts).
Comment 40 Philippe Mouawad 2014-09-09 11:25:58 UTC
@Sebb java version "1.6.0_65"
@Adrian , thanks a lot for feedback.

Happy it works.
Comment 41 Philippe Mouawad 2014-09-09 11:35:13 UTC
Date: Tue Sep  9 11:25:38 2014
New Revision: 1623759

URL: http://svn.apache.org/r1623759
Log:
Bug 54648 - JMeter GUI on OS X crashes when using CMD+C (keyboard shortcut or UI menu entry) on an element from the tree
Put back final.
Bugzilla Id: 54648

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeNode.java
    
    
Date: Tue Sep  9 11:34:11 2014
New Revision: 1623762

URL: http://svn.apache.org/r1623762
Log:
Bug 54648 - JMeter GUI on OS X crashes when using CMD+C (keyboard shortcut or UI menu entry) on an element from the tree
Add 54648 to list of changes
Bugzilla Id: 54648

Modified:
    jmeter/trunk/xdocs/changes.xml
Comment 42 Adrian S 2014-09-09 14:31:55 UTC
(In reply to Philippe Mouawad from comment #40)
> 
> @Adrian , thanks a lot for feedback.
> 
> Happy it works.

Same here. A lot of people will be happy about this fix.
Comment 43 Matt Kilbride 2014-09-10 19:17:34 UTC
I have also confirmed that your fix worked for me. My test was 2.11 vs nightly (r1623894), with TextExpander running.