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 186779 - Detaching should not try to shutdown target process
Summary: Detaching should not try to shutdown target process
Status: RESOLVED INVALID
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-27 05:05 UTC by Nam Nguyen
Modified: 2010-05-27 14:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Detach dialog (18.84 KB, image/png)
2010-05-27 14:43 UTC, Jiri Sedlacek
Details
Reset button in Profiler Options (59.26 KB, image/png)
2010-05-27 14:44 UTC, Jiri Sedlacek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nam Nguyen 2010-05-27 05:05:46 UTC
I attached NB profiler to JDeveloper for CPU profiling.  When I am done with profiling, during detach i got this exception from the target process:

Profiler Agent: Connection with agent closed
Uncaught exception
oracle.ide.ExitNotAllowedException
	at oracle.ide.IdeCore$1.checkExit(IdeCore.java:266)
	at java.lang.Runtime.exit(Runtime.java:88)
	at java.lang.System.exit(System.java:904)
	at org.netbeans.lib.profiler.server.ProfilerServer.doExit(ProfilerServer.java:1674)
	at org.netbeans.lib.profiler.server.ProfilerServer.handleClientCommand(ProfilerServer.java:1545)
	at org.netbeans.lib.profiler.server.ProfilerServer.listenToClient(ProfilerServer.java:1714)
	at org.netbeans.lib.profiler.server.ProfilerServer.run(ProfilerServer.java:682)

This is reproducible consistently.

I think that the profiler agent should not attempt to shutdown target process if the process is not started by the profiler.  Also, the detach should be handled / negotiated smoothly with target process.
Comment 1 Nam Nguyen 2010-05-27 05:08:14 UTC
Product Version: NetBeans IDE 6.8 (Build 200912041610)
Java: 1.6.0_18; Java HotSpot(TM) Client VM 16.0-b13
System: Linux version 2.6.18-164.0.0.0.1.el5xen running on i386; UTF-8; en_US (nb)
Comment 2 Tomas Hurka 2010-05-27 06:32:29 UTC
Of course that the profiler does not terminate profiled application on its own. There is a dialog asking you if you want to terminate target application on detach. If you say 'No' the application is not terminated.
Comment 3 Nam Nguyen 2010-05-27 14:31:13 UTC
Please note that the bug filed NB 6.8.  The behavior is: when issue menu command:  Profile > Detach..., at the time of the stack trace, *no dialogs* are displayed to ask whether to shutdown target process.  Why handleClientCommand() happen before the dialog?
Comment 4 Tomas Hurka 2010-05-27 14:39:59 UTC
It does not matter if it is NB 6.8 - this works the same from the beginning. If you don't see the dialog than you probably checked 'Do not ask me again' checkbox when you used it in the past. To revert to default behavior go to 'Tool->Options->Miscellaneous->Profiler' and click 'Reset' button. This will reset the state of 'Do Not Show Again' confirmations.
Comment 5 Jiri Sedlacek 2010-05-27 14:43:13 UTC
Attaching screenshots of the related dialogs.
Comment 6 Jiri Sedlacek 2010-05-27 14:43:44 UTC
Created attachment 99548 [details]
Detach dialog
Comment 7 Jiri Sedlacek 2010-05-27 14:44:15 UTC
Created attachment 99549 [details]
Reset button in Profiler Options
Comment 8 Nam Nguyen 2010-05-27 14:55:22 UTC
Thanks, i verified about resetting all 'do not show' profiler options.  It works as expected.