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]

walking the stack


Anthony Green writes:
 > 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.  These object files contain the bits
 > necessary to determine the range of code needing registration with the
 > runtime.  For interpreted code I just need to register the closure stub.
 > 
 > Running a check for a priviliged action involves walking the stack and
 > examining the details of the appropriate ProtectionDomains along the
 > way.  My current experiments involve using glibc's backtrace()
 > function.   My questions...
 > 
 > 1) Is this reliable on all glibc ports?

It doesn't work everywhere, but where it is implemented it works well.
It depends on the ABI.

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

Yes.

 > 3) Is there a better way to do all of this?

There sure is: David Mosberger's libunwind.

Andrew.


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