Bug 129525 - Don't Dump Bytecodes to Syserr in LTW
Summary: Don't Dump Bytecodes to Syserr in LTW
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-27 03:18 EST by Ron Bodkin CLA
Modified: 2006-08-25 04:30 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2006-02-27 03:18:33 EST
The load-time weaving system can produce truly massive quantities of output when there's a weaving error, since the system dumps the bytecode to syserr. It would be much better to produce an ajcore file and just point to it, or use some other log.
Comment 1 Matthew Webster CLA 2006-03-10 08:20:47 EST
I agree we should make better use of ajcore files. However they will be times when, due to a SecurityManager, the weaver does not have access to the disk and all data will still need to be sent to stderr.

What other log do you suggest?
Comment 2 Ron Bodkin CLA 2006-03-10 10:07:43 EST
I would suggest:
1) try to write an ajcore file
2) failing that, try to use java.util.logging to log the information at an error level
3) failing that, writing to System.error
Comment 3 Matthew Webster CLA 2006-08-24 12:56:03 EDT
I have changed the LTW message handler so that it no longer causes an AbortException when an error is issued. My original intention was to fail the loading of the class concerned but this doesn't happen because the exception is caught somewhere else in weaver/loadtime and it may not be desirable anyway. This should result in fewer "trouble in: ..." type messages where there is actually no problem with weaving.

I have opened Bug 155033 "Use ajcore for LTW problems" to look at a more appropriate method of information capture.
Comment 4 Ron Bodkin CLA 2006-08-24 19:17:29 EDT
I ran into a case where the new code still dumps a spectacular amount of data to the console by dumping bytecode for each class, this with a very recent dev build. I reran with stdout and stderr redirected and have 2 megs of output from startup. This is the kind of scenario that would be greatly improved with ajcore files!

In this case, it was a circularity error from some test advice (which was obscured badly by the obscure message and the volumes of bytecode dumped):
[PolicyClassLoader@13631582] error at glassbox\monitor\AbstractMonitor.aj:115::0
 can't determine precedence between two or more pieces of advice that apply to t
he same join point: method-execution...
[PolicyClassLoader@13631582] abort trouble in:
...
Comment 5 Matthew Webster CLA 2006-08-25 04:30:39 EDT
Fix available in aspectj-DEVELOPMENT-20060824191234.jar.