This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: walking the stack


Anthony Green wrote:

>I've been experimenting with an implementation of the Java's sandbox
>design.
>
>The idea is to map ProtectionDomains to PC ranges.  I determine PC
>ranges by modifying libgcj.spec to link jrtbegin.o and jrtend.o before
>and after all other files.
>

Interesting. I was thinking of something similar for stack trace 
printing, as an alternative to the dlsym/addr2line/demangling stuff we 
do now. That would allow us to get a trace even from a stripped binary 
by utilizing the reflection data.

>2) Is there some better way to get stack trace info?  Like using the
>DWARF2 data if it exists.
>

I don't know how portable backtrace() is, but obviously using the DWARF2 
unwind data would be better, since it is used on more targets than glibc is.

RTH has said that it wouldn't be difficult to add an interface to the 
unwinder which walks the stack without actually unwinding. We want this 
functionality for getting EH stack traces as well.

If we made that interface something like:

_Unwind_TraceStack(void **pc_array, int count)

then we could pass in a pc_array of length 2 and it would only unwind 2 
frames, which would be more efficient for security checks.

regards

Bryce.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]