walking the stack

Bryce McKinlay bryce@waitaki.otago.ac.nz
Mon Apr 15 18:45:00 GMT 2002


Anthony Green wrote:
>On Mon, 2002年04月15日 at 01:37, Bryce McKinlay wrote:
>>>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.
>>>>I don't think what I'm doing will give you enough resolution. I just
>put jrtbegin and jrtend around crtbegin and crtend to determine the
>extent of the text section for the main executable and every shared
>library it loads.
>
Right. For stack tracing the idea was to use the (sorted, perhaps, if 
they arn't already) method pointer values in the reflection data to 
determine what method a given PC value belongs to.
It seems to me that this technique would be more flexible and portable 
than using jrtbegin/jrtend. Once you have the class that a PC value 
belongs to you can just call getProtectionDomain() on it.
Of course, for native code, there is really no way to enforce java 
security since any .so you load might have hacks in it which bypass the 
security checks and do anything they want to the runtime. Thus 
implementing security is really only useful for applications which 
depends on having it to run. And, of course, for bytecode.
regards
Bryce.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /