Bug 12740 - Stack trace infrastructure improvements
Summary: Stack trace infrastructure improvements
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 3.4.0
: P2 enhancement
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 13603 1907 5773 11780 13139 13604
  Show dependency treegraph
 
Reported: 2003-10-23 03:35 UTC by Bryce McKinlay
Modified: 2006-03-08 18:36 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-24 15:54:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryce McKinlay 2003-10-23 03:35:56 UTC
Stack traces are used by the Throwable class, security checks, calling-classloader lookup, and 
reflection accessibility checks. However, the current implementation is not conductive to 
supporting all these uses in an efficient manner. It needs to be refactored and improved.

Specifically:

- libgcc's unwinder machinery should be used instead of backtrace()
- allocation during stack tracing should be avoided where possible
- for security/classloader/accessibility checks, we should only walk the stack as far as needed to 
complete the check, not the entire stack
- native "RawData" pointers should not be passed around in Java code

The idea is to put common stack-trace infrastructure - code used for both exceptions and security 
- in a stacktrace.cc or something similar. natVMThrowable will use that and StackTrace.java etc will 
go away.
Comment 1 Andrew Haley 2003-11-03 11:50:13 UTC
- libgcc's unwinder machinery should be used instead of backtrace()

This is probably true, but it may be slower.

- for security/classloader/accessibility checks, we should only walk the stack
as far as needed to complete the check, not the entire stack

I don't understand this.  We don't walk the entire stack at the moment.

Comment 2 Tom Tromey 2006-03-08 16:30:13 UTC
Isn't this fixed in 4.1?
Comment 3 Bryce McKinlay 2006-03-08 18:36:45 UTC
Yes. This is fixed in GCC 4.1.