This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH]: (alpha) heuristic_proc_start


> This one looks very suspect to me: 
> someone with Alpha knowledge, can you evaluate it?

	[Eirik, this is your patch to GDB on Alpha to handle crashes/core
	dumps caused by dereferencing a null function pointer - it
	showed up on crashes from our appliances, but I ahve a program
	that can make it happen on Digital UNIX and probably other Alpha
	UNIXes as well.

	The test program catches SIGSEGV and thus causes the signal
	frame to be followed by regular frames; GDB can't handle that.

	I've attached the test program in question.]

I don't know if this is The Right Way to handle this, but I'm not sure
what The Right Way is.
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <signal.h>

void (*bloop)(void) = NULL;

static void catchme(int);

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

	hello.sa_handler = catchme;
	hello.sa_mask = 0;
	hello.sa_flags = 0;
	if (sigaction(SIGSEGV, &hello, NULL) < 0) {
		fprintf(stderr, "sigaction failed: %s\n", strerror(errno));
		return 2;
	}
	(*bloop)();
	return 1;
}

static void
catchme(int signo)
{
	abort();
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]