This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 194186 - CPU Profiling fails for GF from a project's right-click menu
Summary: CPU Profiling fails for GF from a project's right-click menu
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords: REGRESSION
: 194253 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-10 16:57 UTC by Chiana
Modified: 2011-01-19 06:33 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot (116.27 KB, image/x-png)
2011-01-11 17:10 UTC, Chiana
Details
Stackdump from netbeans (28.11 KB, text/plain)
2011-01-11 17:10 UTC, Chiana
Details
Stackdump from JavaDB (4.80 KB, text/plain)
2011-01-11 17:11 UTC, Chiana
Details
Stackdump from glassfish (34.43 KB, text/plain)
2011-01-11 17:11 UTC, Chiana
Details
Netbeans log file (66.27 KB, application/octet-stream)
2011-01-11 17:12 UTC, Chiana
Details
Screenshot (65.80 KB, image/x-png)
2011-01-11 17:18 UTC, Chiana
Details
Another messages.log with GF profiling failing (135.11 KB, text/plain)
2011-01-12 15:24 UTC, J Bachorik
Details
Dump of testrun (279.04 KB, application/x-zip-compressed)
2011-01-13 02:19 UTC, Chiana
Details
messages.log for testrun (57.01 KB, application/octet-stream)
2011-01-13 02:20 UTC, Chiana
Details
messages.log for testrun (79.82 KB, application/octet-stream)
2011-01-13 02:28 UTC, Chiana
Details
message log from my initial entry for Jan 13 2011 (132.88 KB, text/plain)
2011-01-13 18:41 UTC, Vince Kraemer
Details
server log for long entry from Jan 13 2011 (1.25 MB, text/plain)
2011-01-13 18:47 UTC, Vince Kraemer
Details
trimmed server log for long entry from Jan 13 2011 (163.82 KB, text/plain)
2011-01-13 18:53 UTC, Vince Kraemer
Details
Shows that GlassFish server is suspended. (5.06 KB, image/x-png)
2011-01-13 20:00 UTC, Chiana
Details
some info about the java command used to started the server (5.68 KB, text/plain)
2011-01-14 01:44 UTC, Vince Kraemer
Details
Exception output swallowed by NB (1.59 KB, text/plain)
2011-01-17 15:45 UTC, J Bachorik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chiana 2011-01-10 16:57:43 UTC
[ BUILD # : 20110110 ]
[ JDK VERSION : 1.6.23 ]

Get this when trying to profile an application
Comment 1 J Bachorik 2011-01-11 14:37:10 UTC
Please, provide more details - problems decription, IDE log, optionally stack trace and screenshots
Comment 2 Chiana 2011-01-11 17:10:08 UTC
Created attachment 104885 [details]
Screenshot
Comment 3 Chiana 2011-01-11 17:10:53 UTC
Created attachment 104886 [details]
Stackdump from netbeans
Comment 4 Chiana 2011-01-11 17:11:19 UTC
Created attachment 104887 [details]
Stackdump from JavaDB
Comment 5 Chiana 2011-01-11 17:11:45 UTC
Created attachment 104888 [details]
Stackdump from glassfish
Comment 6 Chiana 2011-01-11 17:12:23 UTC
Created attachment 104889 [details]
Netbeans log file

Anything else you need?
Comment 7 Chiana 2011-01-11 17:15:12 UTC
Whops, almost forgot, the description....


When you start a profiling session on a project it will fail just after starting the glassfish server giving a popup with the content "_LOCATIONS failed on Glassfish..."
And also (new info) after you dismiss the dialog it will produce an other with the content "Connection failed" (Screen dump below).
Comment 8 Chiana 2011-01-11 17:18:20 UTC
Created attachment 104890 [details]
Screenshot
Comment 9 J Bachorik 2011-01-12 15:20:20 UTC
Confirmed
Comment 10 J Bachorik 2011-01-12 15:24:19 UTC
Created attachment 104926 [details]
Another messages.log with GF profiling failing
Comment 11 J Bachorik 2011-01-12 16:41:45 UTC
This problem originates from somewhere within the GlassFish server plugin. 

It completely blocks profiling of GlassFish 3 in NetBeans.
It is a regression observed since daily build 20101229000105.

Thus increasing priority to P1.
Comment 12 Vince Kraemer 2011-01-12 17:12:15 UTC
*** Bug 194253 has been marked as a duplicate of this bug. ***
Comment 13 Vince Kraemer 2011-01-12 23:38:48 UTC
http://hg.netbeans.org/web-main/rev/edf73550bc30
Comment 15 Chiana 2011-01-13 01:36:08 UTC
Oki, it will take a few minutes... Don't go anywhere... B-)
Comment 16 Chiana 2011-01-13 01:58:06 UTC
No failure dialog, but the GF is apparently suspended and it looks like it is waiting for the server to connect, I will upload a few screenshots in a moment, should take a few stackdumps first before starting to cut&paste on the screen...
Comment 17 Chiana 2011-01-13 02:19:19 UTC
Created attachment 104943 [details]
Dump of testrun

Here are the stackdump's and a few screenshots showing various states of windows. Notify that after the run I tried to exit the IDE and got a dialog about profiling session beeing active so I clicked "yes" there, I also noted that the Glassfish process never terminated (as seen in taskmgr.png PID 3272)

Here is what I did and in order of doing;
Compressed my original Netbeans directory.
Unpacked the build ontop the Netbeans directory.
Started up Netbeans and the project(s) opened.
Made a Clean&Build on RecieteServer
Made a Build on RecietePrg
Started RecieteServer by using right-click->run
   GlassFish started as it should and the server identified
Started RecietePrg for profiling by right-click->profile
   GlassFish attempted a restart to switch to profiling mode but never finished.

Just noted, forgot to pack messages.log into the .zip file, uploads it separatly
Comment 18 Chiana 2011-01-13 02:20:35 UTC
Created attachment 104944 [details]
messages.log for testrun
Comment 19 Chiana 2011-01-13 02:28:22 UTC
Created attachment 104945 [details]
messages.log for testrun

Sorry, wrong messages.log, this is the correct one...
Comment 20 Vince Kraemer 2011-01-13 02:41:04 UTC
what kind of profiling were you trying to do? [Monitor, CPU, Memory]

which GF build are you trying to start?

where is gf installed?
Comment 21 Vince Kraemer 2011-01-13 06:39:26 UTC
what kind of project is RecieteServer and RecietePrg?
Comment 22 Vince Kraemer 2011-01-13 06:52:29 UTC
(In reply to comment #11)
> This problem originates from somewhere within the GlassFish server plugin. 
> 
> It completely blocks profiling of GlassFish 3 in NetBeans.
> It is a regression observed since daily build 20101229000105.
> 
> Thus increasing priority to P1.

Can you attach a pointer/link to a working daily build and a broken daily build?
Thanks
Comment 23 Chiana 2011-01-13 10:17:44 UTC
(In reply to comment #20)
> what kind of profiling were you trying to do? [Monitor, CPU, Memory]

Mainly CPU, as some of the dialogs experiences lag

> which GF build are you trying to start?

3.1 build 36

> where is gf installed?

c:\glassfish3\ and netbeans is at c:\netbeans\
Comment 24 Chiana 2011-01-13 10:19:53 UTC
(In reply to comment #21)
> what kind of project is RecieteServer and RecietePrg?

RecieteServer is an Enterprice EJB application intended to work as a server for several RecietePrg

RecietePrg is an Enterprice Application client with standalone EAR/JAR accessing RecieteServer
Comment 25 Chiana 2011-01-13 10:23:10 UTC
(In reply to comment #21)
> what kind of project is RecieteServer and RecietePrg?

The testcase supplied for bug 194059 has the same layout as my project if that is any help to you.
Comment 26 Vince Kraemer 2011-01-13 18:32:57 UTC
You may need to be a bit more precise in your directions...

I created a Java EE->Enterprise Application Client project. EAC

There isn't a Profile option on that project type...

So, I created a Java EE->Enterprise Application project. EA

I added the ent app client to the ent app, via the 'Add Java EE Module...' action on the ent app project's right-click menu.

I started gf 3.1 promoted build 36 'normally'... using the Start action on the server's node in the Services explorer.

I switched back to the projects explorer.

I selected the Profile item from my Ent App project's (EA's) right click menu.

I accepted the default JDK as 'the Java Platform to use'

I selected the Monitor option from the dialog titled 'Profile EA'

I checked/selected/ticked both boxes (Enable threads monitoring, Sample threads states)

I pressed the Run button.

The server restarted and the usual graphs appeared.

I stopped the profiler.

I restarted the server in normal mode.


I switched back to the projects explorer.

I selected the Profile item from my Ent App project's (EA's) right click menu.

I accepted the default JDK as 'the Java Platform to use'

I selected the Memory option from the dialog titled 'Profile EA'
  I selected 'Record object creation only'
  I set the 'Track every X object allocations to 10
  'Record stack tace for allocations' and 'Use define Profiling Points' were not selected/checked/ticked.

I pressed the Run button on the Profile EA dialog.

The server restarted.  The profiler attached.

the app deployed.

I pressed the live results button in the Profiler explorer.

I saw graphs.

I stopped profiling the server.

I restarted the server 'normally'

I undeployed EA.

I selected Profile from EA's right-click menu.

I accepted the default JDK as 'the Java Platform to use'

I selected CPU profiling
    Entire application.
    Filter: project and subproject classes
    Unselected the 'Use defined Profiling Points'

I pressed the Run button on the Profile EA dialog.

The server was shutdown.
The server was restarted.
The Live results window started to update

There was a dialog that said that the profiled app was not responding and asked if I wanted to stop profiling...  I choose to continue profiling...  And the Live results window started to update some more...

The server looked like it was going to start up... and then stalled at some point before it was able to tell the IDE that it was 'ready'.

Eventually the IDE stopped waiting for the server to finish starting and the Profile failed....

Attaching relevant data soon.
Comment 27 Vince Kraemer 2011-01-13 18:35:18 UTC
Ant output from failed CPU profiling session....


profile:
start-profiled-server-extraargs:
Stopping the profiler
Profiled server stopped
Server GlassFish Server 3.x is stopping
GlassFish Server 3.x was stopped.
Starting GlassFish Server 3.x
GlassFish Server 3.x is running.
Server is ready waiting for profiler to attach...
Profiler attached, waiting for the server to start up...
/Users/vkraemer/NetBeansProjects/EnterpriseApplication47/nbproject/build-impl.xml:520:
The following error occurred while executing this line:
/Users/vkraemer/NetBeansProjects/EnterpriseApplication47/nbproject/build-impl.xml:531:
Starting of server in profile mode timed-out after 300 secs.
BUILD FAILED (total time: 5 minutes 2 seconds)
Comment 28 Vince Kraemer 2011-01-13 18:41:31 UTC
Created attachment 104966 [details]
message log from my initial entry for Jan 13 2011
Comment 29 Vince Kraemer 2011-01-13 18:47:56 UTC
Created attachment 104967 [details]
server log for long entry from Jan 13 2011
Comment 30 Vince Kraemer 2011-01-13 18:53:02 UTC
Created attachment 104969 [details]
trimmed server log for long entry from Jan 13 2011
Comment 31 Chiana 2011-01-13 18:55:13 UTC
Well, all that info was in the uploaded dump & screenshots...
Comment 32 Vince Kraemer 2011-01-13 19:03:26 UTC
Yardus...  Need your insight on what changes that need to be made to the
startup of the app server when CPU profiling is selected...  Is there a way for
the plugin to 'know' what type of profiling is selected?

One other thing to note....

If I start the server in profile mode and Attach to it, I can select CPU
profiling and the server appears to start correctly.  I am able to access web
apps after the server log displays the line

"INFO: GlassFish Server Open Source Edition 3.1-b36 (36) startup time : Felix
(6,890ms), startup services(19,535ms), total(26,425ms)"
Comment 33 Vince Kraemer 2011-01-13 19:09:46 UTC
Since there is a way to do CPU monitoring for GF, I am going to lower this issue to p2...

This issue is "Major" according to http://netbeans.org/bugzilla/page.cgi?id=fields.html#priority
Comment 34 Chiana 2011-01-13 19:13:10 UTC
Hmm... Just come to think of it, it is NOT the server application I'm trying to profile, it's the application client, that one is not started in the application server. It is just loaded from the server using JavaWebStart.
Comment 35 Vince Kraemer 2011-01-13 19:32:18 UTC
(In reply to comment #34)
> Hmm... Just come to think of it, it is NOT the server application I'm trying to
> profile, it's the application client, that one is not started in the
> application server. It is just loaded from the server using JavaWebStart.

File a different issue for that.  Please do not muddy this issue with something that is so different.

At this point, this issue is about the fact that the server doesn't appear to start when a user decides to do CPU profiling of a project that targets GlassFish IF they use the Profile action that appears in the right-click menu of a project.
Comment 36 Chiana 2011-01-13 19:58:14 UTC
(In reply to comment #35)
> (In reply to comment #34)
> > Hmm... Just come to think of it, it is NOT the server application I'm trying to
> > profile, it's the application client, that one is not started in the
> > application server. It is just loaded from the server using JavaWebStart.
> File a different issue for that.  Please do not muddy this issue with something
> that is so different.
> At this point, this issue is about the fact that the server doesn't appear to
> start when a user decides to do CPU profiling of a project that targets
> GlassFish IF they use the Profile action that appears in the right-click menu
> of a project.

What difference would that make? It fails in the same way anyhow, just tested that on #6457on110113.
Profiling EJB gives
profile:
start-profiled-server-extraargs:
Starting GlassFish Server 3.1
GlassFish Server 3.1 is running.
Server is ready waiting for profiler to attach...
Profiler attached, waiting for the server to start up...

And then just sits there for 300 seconds.
While the server IS suspended, you can clearly see that on the screenshot I'm about to upload...
Comment 37 Chiana 2011-01-13 20:00:09 UTC
Created attachment 104971 [details]
Shows that GlassFish server is suspended.
Comment 38 Vince Kraemer 2011-01-13 23:49:21 UTC
(In reply to comment #37)
> Created an attachment (id=104971) [details]
> Shows that GlassFish server is suspended.

Or the IDE has not been able to detect that the server startup has finished.... which is slightly different.
Comment 39 Vince Kraemer 2011-01-14 01:44:33 UTC
Created attachment 104983 [details]
some info about the java command used to started the server

Shows safe and unsafe... but I tested and the diff doesn't matter...

Unsafe is still unsafe if the user attempts remove the memory dump options from the command-line, by changing the Profiler options...
Comment 40 Quality Engineering 2011-01-14 06:05:44 UTC
Integrated into 'main-golden', will be available in build *201101140000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/edf73550bc30
User: vince kraemer <vkraemer@netbeans.org>
Log: #194186: prevent dialog from interferring with profiling
Comment 41 J Bachorik 2011-01-17 15:44:15 UTC
Back to profiler.
NetBeans stopped logging stdout at some point so the following exception went unnoticed (except that it broke profiling GFv3) (exception attached)
Comment 42 J Bachorik 2011-01-17 15:45:00 UTC
Created attachment 105071 [details]
Exception output swallowed by NB
Comment 43 Tomas Hurka 2011-01-17 15:55:45 UTC
Fixed in profiler-main

changeset:   186516:43a5d34aa113
user:        Tomas Hurka <thurka@netbeans.org>
date:        Mon Jan 17 16:53:26 2011 +0100
summary:     bugfix #191297, #194186, forgotten initialization of modifiledLocalVariableTypeTableOffsets added
Comment 44 Tomas Hurka 2011-01-18 11:24:01 UTC
Additional commit:

changeset:   186519:0b238422ce81
user:        Tomas Hurka <thurka@netbeans.org>
date:        Tue Jan 18 10:50:13 2011 +0100
summary:     bugfix #191297, #194186, incorrect assert removed
Comment 45 Quality Engineering 2011-01-19 06:33:57 UTC
Integrated into 'main-golden', will be available in build *201101190000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/43a5d34aa113
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #191297, #194186, forgotten initialization of modifiledLocalVariableTypeTableOffsets added