Subject: None
To: None <alex@mlbg79.btlabsmh.bt.co.uk>
From: Charles M. Hannum <mycroft@gnu.ai.mit.edu>
List: port-i386
Date: 01/11/1995 05:14:33
   [...]

   Question is.. What happens. Do you only restart the write instruction if you 
   don't
   raise the signal, or do you raise the signal, then continue?

You can write a trivial program to demonstrate that, on a 386, the
answer is `neither', on a 386.  On a 68k, this is a different story.

In fact, here's such a program:


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

char *c;
int *i;

void
blah()
{

	printf("%02x %02x\n", c[0], c[1]);
	printf("%02x %02x\n", c[2], c[3]);
	exit(0);
}

int
main()
{

	printf("testing...\n");

	signal(SIGSEGV, blah);

	c = (char *)malloc(4*1024) + 4*1024 - 2;

	for (;;) {
		i = (int *)c;
		*c = 0x00;
		*i = 0x12345678;
		c += 4;
	}
}


On a 386, it says:

testing...
00 00

On a 68030 or 68040, it says:

testing...
12 34