void handleExceptionSignal(int pSignal)
{
    switch(pSignal)
    {
        case SIGILL:
        case SIGFPE:
        case SIGSEGV:
        case SIGTERM:
        case SIGABRT:
            {
                /**
                 * inform the user about the program abort
                 */
                printf("########################################################################################\n");
                if(Plib::systemstate.config.report_program_aborts)
                    printf("POL will exit now. The following will be sent to the POL developers:\n");
                else
                    printf("POL will exit now. Please, post the following to the forum: http://forums.polserver.com/.\n");
                string tStackTrace = ExceptionParser::getTrace();
                printf("Admin contact: %s\n", Pol::Plib::systemstate.config.report_admin_email.c_str());
                printf("Executable: %s\n", Pol::Plib::systemstate.executable.c_str());
                printf("Start time: %s\n", Pol::Plib::systemstate.getStartTime().c_str());
                printf("Current time: %s\n", Pol::Clib::Logging::LogSink::getTimeStamp().c_str());
                printf("\n");
                printf("Stack trace:\n%s", tStackTrace.c_str());
                printf("\n");
                printf("Compiler: %s", getCompilerVersion().c_str());
                printf("Compile time: %s\n", Pol::compiletime);
                printf("Build target: %s\n", Pol::polbuildtag);
                printf("Build revision: %s\n", Pol::polverstr);
                #ifndef _WIN32
                    printf("GNU C library (compile time): %d.%d\n", __GLIBC__, __GLIBC_MINOR__);
                #endif
                printf("\n");
                printf("########################################################################################\n");

                /**
                 * use the program abort reporting system
                 */
                if(Plib::systemstate.config.report_program_aborts)
                {
                    string signalName;
                    string signalDescription;

                    getSignalDescription(pSignal, signalName, signalDescription);
                    ExceptionParser::reportProgramAbort(tStackTrace, "CRASH caused by signal " + signalName + " (" + signalDescription + ")");
                }

                // finally, go to hell
                exit(1);
            }
            break;
        default:
            break;
    }
}
//
// setTypeAndPol: set the type and polarization of the supercluster
//
// Notes:
//		Any supercluster which contains a CW signal becomes a
//		CW supercluster; i.e.,  a supercluster will be a Pulse only
//		if it contains no CW signals.
//		A CW supercluster is POL_BOTH if it contains any signals
//		(either CW or pulse) of both types of polarization.
//		A pulse supercluster is POL_BOTH only if it consists
//		entirely of pulses which are POL_BOTH.  If it contains
//		any pulses of different polarization, it will be
//		defined as POL_MIXED.
//
void
SuperClusterer::setTypeAndPol(ClusterTag& tag, SuperClusterDescription *super)
{
	SignalType type;
	SignalDescription sig;

	type = getSignalDescription(tag, &sig);
	switch (type) {
	case CW_POWER:
		// force type to CW
		super->type = CW_POWER;
		switch (super->pol) {
		case POL_RIGHTCIRCULAR:
		case POL_LEFTCIRCULAR:
			if (sig.pol != super->pol)
				super->pol = POL_BOTH;
			break;
		case POL_MIXED:
			super->pol = POL_BOTH;
			break;
		default:
			break;
		}
		break;
	case PULSE:
		switch (super->type) {
		case CW_POWER:
			if (sig.pol != super->pol)
				super->pol = POL_BOTH;
			break;
		case PULSE:
			if (sig.pol != super->pol)
				super->pol = POL_MIXED;
			break;
		default:
			Fatal(666);
		}
		break;
	default:
		Fatal(666);
		break;
	}
}