[4476] in Athena Bugs

home help back first fref pref prev next nref lref last post

Saber msg: v2.1.2 (DECstation Beta 3) (2/7/90 quicksilver decstation Ultrix 3.x 0 0)

daemon@ATHENA.MIT.EDU (jtkohl@ATHENA.MIT.EDU)
Thu Mar 8 16:20:09 1990

From: jtkohl@ATHENA.MIT.EDU
Date: Thu, 8 Mar 90 16:19:20 EST
To: bugs@ATHENA.MIT.EDU
Cc: jtkohl@ATHENA.MIT.EDU
Saber C on the PMAX doesn't like longjmps from signal handlers.

here is a file which reliably produces saber errors:
#include <stdio.h>
#include <setjmp.h>
#include <signal.h>

jmp_buf jbuf;

void sigproc()
{
    longjmp(jbuf, 1);
}

int
fooproc()
{
    char buf[BUFSIZ];	
    void (*ointrfunc)();

    ointrfunc = signal(SIGINT, sigproc);

    if (setjmp(jbuf)) {
	printf("longjmp out\n");
	(void) signal(SIGINT, ointrfunc);
	return 0;
    }
    fgets(buf, sizeof(buf), stdin);
    (void) signal(SIGINT, ointrfunc);
    return 1;
}

and a transcript of a saber session.
Note that after typing 'testing' I hit ^C on the keyboard, to generate
the SIGINT.
[{1}quicksilver:/tmp]
% saber

             Saber-C - Version 2.1.2 (DECstation Beta 3)
           Copyright (C) 1986, 1990 by Saber Software, Inc.

Saber-C licensed for: MIT
For customer service, use the 'email' command.

Attaching: /lib/libc.a
1 -> load foo.c
Loading: foo.c
2 -> ignore INT
3 -> fooproc();
Linking from '/lib/libc.a' .......... Linking completed.
testing^CSaber internal error: Sequences corrupted.
Saber internal error: Sequences corrupted.
Saber internal error: Sequences corrupted.
longjmp out
(int) 0
4 -> quit
[{1}quicksilver:/tmp]
%

home help back first fref pref prev next nref lref last post