Hi All,
For some reason, on CentOS 7 the k4dirstat application is getting SIGPIPE and the application crashes with error -
ICE default IO error handler doing an exit(), pid = XXX , error_code=32 i have figured out that this error shows up after application gets SIGPIPE.
I am trying to customize this application so that as soon as application gets SIGPIPE, i am able to see traceback . I noticed that as soon as KApplication object is created, the application stops invoking handler function in response to SIGPIPE .
void sigpipeHandler(int signum) {
std::cout << "Caught signal (" << signum << ")" << std::endl;
cpptrace::generate_trace().print();
// Handle SIGPIPE as needed
// }
}
int main(int argc, char **argv)
{
signal(SIGPIPE, sigpipeHandler);
signal(SIGKILL, sigpipeHandler);
signal(SIGTERM, sigpipeHandler);
signal(SIGINT, sigpipeHandler);
signal(SIGALRM, sigpipeHandler);
signal(SIGHUP, sigpipeHandler);
signal(SIGTRAP, sigpipeHandler);
signal(SIGBUS, sigpipeHandler);
KAboutData about("k4dirstat", 0, ki18n("k4dirstat"), version, ki18n(description),
KAboutData::License_GPL,
ki18n("(c) 1999-2008 Stefan Hundhammer, (c) 2010 Joshua Hodosh"),
KLocalizedString(), "https://bitbucket.org/jeromerobert/k4dirstat",
"https://bitbucket.org/jeromerobert/k4dirstat/issues");
about.addAuthor( ki18n("Jerome Robert"),
ki18n("Current maintainer." ), 0,
"https://bitbucket.org/jeromerobert/k4dirstat" );
about.addAuthor( ki18n("Stefan Hundhammer"),
ki18n("Original kdirstat author." ), "kdirstat@gmx.de",
"http://kdirstat.sourceforge.net/" );
about.addAuthor( ki18n("Joshua Hodosh"), ki18n("Ported to KDE4"),
"kdirstat@grumpypenguin.org" );
about.addCredit( ki18n("SequoiaView Team"),
ki18n( "for showing just how useful treemaps really can be." ),
0, // e-mail
"http://www.win.tue.nl/sequoiaview" );
about.addCredit( ki18n("Jarke J. van Wijk, Huub van de Wetering, Mark Bruls"),
ki18n( "for their papers about treemaps." ),
"vanwijk@win.tue.nl",
"http://www.win.tue.nl/~vanwijk/" );
about.addCredit( ki18n("Ben Shneiderman"),
ki18n( "for his ingenious idea of treemaps -\n"
"a truly intuitive way of visualizing tree contents." ),
"", // E-Mail
"http://www.cs.umd.edu/hcil/treemaps/" );
KCmdLineArgs::init(argc, argv, &about);
KCmdLineOptions options;
options.add("+[Dir/URL]", ki18n( "Directory or URL to open" ));
KCmdLineArgs::addCmdLineOptions(options);
sleep(60);
KApplication app;
So in aforementioned code, when application is in sleep state, i am able to send SIGPIPE (kill -PIPE < process id>) and handler shows me the traceback.
But if i modify the code to
KApplication app;
sleep(60);
then the handler function is never invoked, application stays in sleep state.
Could you please let me know if KApplication class masks certain signals after the object is created?