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 107865 - Need throttling on message logging for profiler
Summary: Need throttling on message logging for profiler
Status: VERIFIED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@profiler
URL:
Keywords:
: 107864 (view as bug list)
Depends on: 83820 108814
Blocks:
  Show dependency tree
 
Reported: 2007-06-22 17:11 UTC by apb
Modified: 2007-09-11 15:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Here is some of the log file (68.68 KB, application/octet-stream)
2007-06-22 17:53 UTC, apb
Details
JVM error log -- I've submitted this to sun (99.36 KB, text/plain)
2007-06-22 18:39 UTC, apb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description apb 2007-06-22 17:11:15 UTC
Whenever I make a profile for my project, which is a very large 
codebase with very large files and deeply recursive, I get *huge* 
log files in my .netbeans/5.5.1/var/log. I just ran a profile last night
and ended up with 125GB log file and a 31GB log file. Yes, that is gigabytes!
This has happened to me before too. I don't have the log files any more
because I had to get rid of them because they where causing issues for other
users on the system. Next time this happens
I'll try to get a snippet of what is being logged before I remove the files.
Comment 1 Tomas Hurka 2007-06-22 17:23:51 UTC
Wow that is a huge file. We are not aware of any periodic or useless logging from profiler. Maybe there is thread dump which is repeated over and over. 
Anyway it is important to get part of your log. You don't need to wait to have a few gigabyte log - check the size earlier. I believe if you compress or zip such 
log file it will be significantly smaller and you can attach it to the issue. Lowering priority to P3 - it looks like that this is not general issue.
Comment 2 Tomas Hurka 2007-06-22 17:25:10 UTC
*** Issue 107864 has been marked as a duplicate of this issue. ***
Comment 3 apb 2007-06-22 17:29:55 UTC
Looks like it is printing out extremely many messages like:

*** Profiler engine warning: critical: stack integrity violation on method exit.
*** methodId on simulated stack top: 34036, received methodId (should match) = 1268
*** Please report this problem to feedback@profiler.netbeans.org
Comment 4 apb 2007-06-22 17:30:53 UTC
I ran the profiler for about 1 minute and got a 33MB log file.
Comment 5 Tomas Hurka 2007-06-22 17:33:05 UTC
Ok, so problem is not big log file, but this error message. Please provide some way how to reproduce it.
Comment 6 Tomas Hurka 2007-06-22 17:42:45 UTC
few hundreds kilobytes from beginning of var/log/messages.log will be also useful.
Comment 7 apb 2007-06-22 17:45:35 UTC
I'm not sure how to tell you to reproduce the problem since this is a large 
proprietary codebase that I'm profiling. I do get a warnings when I 
start up saying that more than 64K methods have been instrumented and 
some methods will not be instrumented. When I try to instrument from a root though
the profiler just crashes on me so I always end up having to do full profiles.
I have had other problems related to this codebase though with other parts of the
system because of pervasive internal netbeans use of characters to hold offsets and 
after instrumentation, some of the methods might be bigger than would be allowed 
by a 2 byte offset.

I really think there are 2 critical issues here:
  1. It shouldn't be possible to generate 125GB log files (independent of anything else) ever!
  2. The profiler error:
** Profiler engine warning: critical: stack integrity violation on method exit.
*** methodId on simulated stack top: 34049, received methodId (should match) = 1281
and similar error messages that I'm receiving.
Comment 8 apb 2007-06-22 17:53:40 UTC
Created attachment 44278 [details]
Here is some of the log file
Comment 9 Tomas Hurka 2007-06-22 18:06:41 UTC
You really do not want to profiler more than 64K methods and with this huge codebase you do not want to profile entire application. It will create too much 
overhead. You should limit scope of profiling by either filtering out JDK and library classes and/or using root methods. 
Issue with log file cannot be solved by profiler, since there is a lot of other code, which logs into log file. 
Looking at  'stack integrity violation on method ' methodId in hex, you will get
0x84F4
0x04F4
- are you using 'Exact Call Tree, Sampled Timing' ? If so, this is known problem (issue #83820) probably caused by bug in HotSpot compiler.
  
Comment 10 apb 2007-06-22 18:34:37 UTC
1. I'm using exact call tree and timings but part of the bug seems like 
it might be related to issue #8382
2. I always do filter out JDK class calls.
3. Like I said before, it is impossible for me to run the profiler instrumenting from roots, 
because that crashes the not just Netbeans but the the JVM itself!


# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00002aaaab57cace, pid=28969, tid=1090754880
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.6.0-b105 mixed mode)
# Problematic frame:
# V  [libjvm.so+0x45eace]
#
# An error report file with more information is saved as hs_err_pid28969.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Comment 11 apb 2007-06-22 18:39:31 UTC
Created attachment 44280 [details]
JVM error log -- I've submitted this to sun
Comment 12 apb 2007-06-22 20:01:49 UTC
Just to note, profiling the entire appilcation seems to work 
fine (except for the extreme slowdown from all the exception 
handling and logging and the *huge* log files themselves). I
have a decent machine with 4 processors and 16GB of memory and my 
_JAVA_OPTIONS allows Java heaps to grow to 12GB. So overhead really 
isn't an issue for me.
Comment 13 J Bachorik 2007-07-03 12:23:59 UTC
according to the messages.log attached to this issue you are trying to profile your application using 'Exact Call Tree,
Sampled Timing' - (this is 'cpuProfilingType = 1' entry - which means you use sampled timing; if you had used exact
timing the cpuProfiling would have been of value 0)
thus setting this issue as a duplicate of the issue #83820

*** This issue has been marked as a duplicate of 83820 ***
Comment 14 apb 2007-07-03 17:18:53 UTC
This is not a duplicate. Only a portion of this bug is a duplicate.

The other point about throttling of message is extremely valid.

The profiler, under this circumstance, is abusing the services of the 
general logging mechanism. A profiler should never, ever, ever, ever
cause a dozen people at my workplace to halt work becuase it causes the system
to fill up all the available diskspace with 150GB+ worth of log files in a very
short timee.
Comment 15 Jiri Sedlacek 2007-07-03 18:24:36 UTC
Once Issue 83820 will be fixed the logfile won't grow this way. Moreover, there is a simple workaround for now to use
exact call tree and timing. For these reasons changing the priority to P3.

In general, logfile is a way for IDE modules to log important actions/settings/states and it's absolutely OK to log all
these things. If the IDE provides logging facility, it should also control logfile behavior incl. size, there's no way
how to do this from the modules. So it seems to me that this should be rather an ENHANCEMENT for logging support of the
IDE than a DEFECT in profiler.
Comment 16 apb 2007-07-03 20:11:51 UTC
There is not a simple workaround, because I have to use sample calling with very
large sample times to get to the piece of code in any sort of reasonable time.
My appilcation preforms a lot of work that takes a very long time, so I use sample timing
at very large sample rate until I get to the part that I want to sample, then set it
to exact timings. I can't use profiling from root because that crashes the JVM which
I've described already.

This issue will also creep up in any similar types of profiler bugs as well. Having, 
Netbeans have the ability to cause critical work-stoppages because of the refusal 
to put in some simple throttling to prevent logging abuses just seems incredibly 
silly and almost negligent. The need for throttling is bigger than just bug 83820.
Comment 17 Jiri Sedlacek 2007-07-03 21:00:21 UTC
Every module which logs its events may cause exactly the same problem, not just the profiler. It would be silly to
implement proprietary "throttling" in each module separately. At the profiler side the best we can do is to fix all the
bugs causing enormous logging. I definitely agree with you that some mechanism to (for example) define maximum logfile
size to prevent problems like this would be useful.

To make some kind of summary:

 - there is a "stack integrity violation on method exit" bug tracked by Issue 83820 - will be fixed for 6.0
 - there is a bug preventing you from using Part of Application mode, according to your comment already submitted to Sun
 - there is a general problem with the logfile eventually consuming all the disk space, currently happens because of
Issue 83820 - at the profiler side we will do our best to decrease logging and fix this Issue 107865, then we can search
for some more general solution for logging as such
Comment 18 apb 2007-07-03 21:30:05 UTC
That sounds exactly right 8-).
Comment 19 apb 2007-07-03 21:38:32 UTC
This issue might be more appropriately moved under the logging component or a sub-issue 
of this bug maybe. Having some sort of message throttling/limiting in the most general 
place possible will most likely have the greatest chance of defeating similar sorts
of critical failures in the future.
Comment 20 apb 2007-07-03 21:57:07 UTC
I created issue 108814 to address the general logging issues.
Comment 21 J Bachorik 2007-08-07 16:43:44 UTC
the bug causing the logging problem was resolved by issue #83820
the logger throttling is being discussed in issue #108814
closing this issue as fixed; there is nothing more to be done in profiler
Comment 22 Alexander Kouznetsov 2007-09-10 14:11:37 UTC
This issue doesn't seem to be fixed. Please consider resolving it as wontfix.
Comment 23 Tomas Hurka 2007-09-11 14:00:52 UTC
The issue is fixed. Profiler no longer creates huge log file. 
Comment 24 Alexander Kouznetsov 2007-09-11 15:32:42 UTC
There is an issue 115164 which can probably lead to creation of a huge log file. Marking as verified according to your
comment.