@Override public void beforeAnalysis(BeforeAnalysisAccess access) { RuntimeSupport.getRuntimeSupport().addStartupHook(SubstrateSegfaultHandler::install); } }
@Override public void beforeAnalysis(BeforeAnalysisAccess access) { RuntimeSupport.getRuntimeSupport().addStartupHook(new Runnable() { @Override /** * Ignore SIGPIPE. Reading from a closed pipe, instead of delivering a process-wide * signal whose default action is to terminate the process, will instead return an error * code from the specific write operation. * * From pipe(7}: If all file descriptors referring to the read end of a pipe have been * closed, then a write(2) will cause a SIGPIPE signal to be generated for the calling * process. If the calling process is ignoring this signal, then write(2) fails with the * error EPIPE. */ public void run() { final Signal.SignalDispatcher signalResult = Signal.signal(Signal.SignalEnum.SIGPIPE.getCValue(), Signal.SIG_IGN()); VMError.guarantee(signalResult != Signal.SIG_ERR(), "IgnoreSIGPIPEFeature.run: Could not ignore SIGPIPE"); } }); } }
@Override public void beforeAnalysis(BeforeAnalysisAccess access) { RuntimeSupport.getRuntimeSupport().addStartupHook(() -> { DumpAllStacks.install(); DumpHeapReport.install(); if (DeoptimizationSupport.enabled()) { DumpRuntimeCompilation.install(); } }); }
@Override public void afterRegistration(AfterRegistrationAccess access) { SubstrateRuntimeMXBean runtimeMXBean = new SubstrateRuntimeMXBean(); ImageSingletons.add(RuntimeMXBean.class, runtimeMXBean); ImageSingletons.add(ThreadMXBean.class, new SubstrateThreadMXBean()); ImageSingletons.add(ClassLoadingMXBean.class, new SubstrateClassLoadingMXBean()); ImageSingletons.add(CompilationMXBean.class, new SubstrateCompilationMXBean()); RuntimeSupport.getRuntimeSupport().addStartupHook(runtimeMXBean.startupHook()); }