Timers
Hey,
I'm investigating alternatives to MethodEnter/Exit which allow me to probe thread states over the course of a program run. The latest avenue of testing is to use a timer to periodically query all threads (followed by recording them in an uninteresting way). It seems more difficult than I first imagine, however, and the implementation I'm using at the moment causes a random SIGSEGV or SIGBUS in the main thread in libjvm.so.
Presumably I'm not supposed to install a handler for SIGALRM. I use pthread_sigset(SIG_UNBLOCK, ...) and timer_settime(...) after having blocked SIGALRM in Agent_OnLoad. The handler is called and everything is fine, sometimes the program even runs to completion!
Can anyone point me in the direction of the documentation which describes the correct way to do this?
Any ideas?
Bruce
PS If it helps anyone to see where I'm corrupting memory, I occasionally get strange exceptions such as:
Exception in thread "main" java.lang.NoSuchMethodError: java.lang.StringCoding$CharsetSD.<init>(Ljava/nio/charset/Charset;Ljava/lang/String;Ljava/lang/StringCoding$1;)V

