I looked into this again today: The binary reports it is "crashed", however
*Program terminated with signal SIGPROF, Profiling timer expired.*
My search gave that this happens when the signal is sent before a handler
is registered. So I changed the sequence to:
1. disallow profiling in ProfileHandler
2. Binary & Plugin startup
3. Call new ProfilerInit() to call InitAllowed() on the ProfileHandler:
Will create a new instance with allowed = true
4. Call ProfilerStart() which calls EnableHandler() to register a signal
5. Call ProfilerRegisterThread() in my plugin's only (main) thread.
The binary will still exit with the above error message about an expired
timer. I made sure there is no *setitimer() *or *alarm()*-call before *
EnableHandler()*. The signal is coming from *StartTimer()*, which is called
One more thing: I had to bypass the check in for an existing
SIG_PROF-handler in ProfileHandler's ctor, as the binary already has one
installed (which it uses to exit then).
Any idea or suggestion on how to get this working?