3 #include "TEveManager.h" 5 #include "TApplication.h" 6 #include "TSysEvtHandler.h" 34 SilentMLscribe(
const SilentMLscribe&) =
delete;
36 const SilentMLscribe&
operator=(
const SilentMLscribe&) =
delete;
69 void signal_handler_wrapper(
int sid, siginfo_t* sinfo,
void* sctx)
72 std::cerr <<
"Program received signal ID = " << sid << std::endl;
73 std::cerr <<
"Printing stack trace ... " << std::endl;
75 TString gdbCommand(
"scripts/gdb-backtrace.sh");
79 gdbCommand += gSystem->GetPid();
81 gSystem->Exec(gdbCommand.Data());
83 Getlinem(kCleanUp,
nullptr);
94 std::unique_ptr<CmsShowMain> pMain(
new CmsShowMain(argc,argv) );
98 gSystem->ResetSignal(kSigBus);
99 gSystem->ResetSignal(kSigSegmentationViolation);
100 gSystem->ResetSignal(kSigIllegalInstruction);
101 gSystem->ResetSignal(kSigSystem);
102 gSystem->ResetSignal(kSigPipe);
103 gSystem->ResetSignal(kSigFloatingException);
105 struct sigaction sac;
106 sac.sa_sigaction = signal_handler_wrapper;
107 sigemptyset(&sac.sa_mask);
108 sac.sa_flags = SA_SIGINFO;
109 sigaction(SIGILL, &sac,
nullptr);
110 sigaction(SIGSEGV, &sac,
nullptr);
111 sigaction(SIGBUS, &sac,
nullptr);
112 sigaction(SIGFPE, &sac,
nullptr);
117 TEveManager::Terminate();
126 const char* dummyArgvArray[] = {
"cmsShow"};
127 char** dummyArgv =
const_cast<char**
>(dummyArgvArray);
129 gEnv->SetValue(
"Gui.BackgroundColor",
"#9f9f9f");
133 if (gSystem->Getenv(
"CMSSW_VERSION"))
135 infoText = gSystem->Getenv(
"CMSSW_VERSION");
139 TString infoFileName(
"data/version.txt");
141 std::ifstream infoFile(infoFileName);
142 infoText.ReadLine(infoFile);
145 printf(
"Starting cmsShow, version %s.\n", infoText.Data());
152 if (strncmp(argv[
i],
"-r", 2) == 0 ||
153 strncmp(argv[i],
"--root", 6) == 0)
162 std::cerr<<
"WARNING:You are running cmsShow with ROOT prompt enabled."<<std::endl;
163 std::cerr<<
"If you encounter an issue you suspect to be a bug in "<<std::endl;
164 std::cerr<<
"cmsShow, please re-run without this option and try to "<<std::endl;
165 std::cerr<<
"reproduce it before submitting a bug-report. "<<std::endl;
168 TRint app(
"cmsShow", &dummyArgc, dummyArgv);
171 TApplication app(
"cmsShow", &dummyArgc, dummyArgv);
177 std::cerr <<
"CmsShow unhandled exception "<<iException.what()<<std::endl;
static unsigned char messageLoggerScribeIsRunning
void run_app(TApplication &app, int argc, char **argv)
static MessageDrop * instance()
void runCommand(MessageLoggerQ::OpCode opcode, void *operand) override
static const unsigned char MLSCRIBE_RUNNING_INDICATOR
int main(int argc, char **argv)
static void setMLscribe_ptr(std::shared_ptr< edm::service::AbstractMLscribe > m)
void operator=(AbstractMLscribe const &)=delete
virtual void runCommand(MessageLoggerQ::OpCode opcode, void *operand)