You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by John Ward <wa...@cctcorp.com> on 2000/04/05 00:17:15 UTC

xerces linking side effect ...

I'm having some real trouble with mixing signals and xerces.

I've attached a sample program (small) that sets up a signal handler to
printout a message when a signal is caught.  I get different results
depending on whether or not I link with the xerces library or not
(!NOTE! this sample code does  nothign with xerces other than link to
it!)

When I run the test program which simply sets up a handler for all
signals between 0 and SIGRTMAX (0 to 64 or so) I then send corresponding
kill signals to the program and watch them get caught by the handler and
thus printed out.

When I send kill -32 <pid> for some reason the handler doesn't get
called.

Same with single 33, and 34 ... but ALL of the rest of them get printed
out.

Why am I asking this to a xerces person? well this behavior ONLY happens
when I link with the xerces library.  MOST ODD!

My compile line is as follows:

gcc test.c -L/xerces/lib -lxerces-c1_1

I'm using xerces 1_1_0 for linux.

Please note this is a sample of the problem, my larger program uses
xerces (obviously) but I was just trying to narrow the problem down, and
that's how I ended up isolating the xerces lib ... unless I'm missing
something here.  I'd love to see if someone can duplicate it.

Thanks for any help in advance,
John Ward
wardj@cctcorp.com

--------------------
#include <stdio.h>
#include <signal.h>

void SignalHandler(int sig)
	fprintf(stdout, "Handler, sig = %d\n", sig);
}

main(int argc, char **argv) {
	struct sigaction act;

	int i;

	
	sigfillset(&act.sa_mask);
	act.sa_handler = MyStupidSignalHandler;
	act.sa_flags = 0;

	for (i = 0; i < SIGRTMAX; i++) {
		if (sigaction(i, &act, NULL) == -1) {
			fprintf(stdout, "can't sigact %d\n", i);
		}
	}

	while (1) {

	}
}