[net.unix-wizards] Xenix panic

robin@medstar.UUCP (Robin Cutshaw) (07/10/85)

Here is a quick way to panic the IBM Xenix kernel (both original and updated).
This works for both the small and medium models. (use cc shr.c -o shr -lx).

---------------CUT HERE-----------------------
#include <stdio.h>
#include <sd.h>
#include <errno.h>

main()
{
char *share, pnbuf[128];
extern int errno;
extern char *getcwd();

if ( (share = sdget("/tmp/shx", SD_CREAT|SD_WRITE,12L,0777)) == (char *)-1) {
	fprintf(stderr,"Share = %d %d\n",errno,share);
	exit(share);
}

sdenter(share, SD_WRITE);
(void )getcwd(pnbuf,100);	/* THIS IS THE KILLER LINE */
sdleave(share);

sdfree(share);

}


-- 
----
Robin Cutshaw
uucp:   ...!{akgua,gatech}!medstar!robin

forceten@dalcs.UUCP (ForceTen Enterprises) (07/16/85)

][b

In article 181@medstar, Robin Cutshaw writes:

> Here is a quick way to panic the IBM Xenix kernel (both original and updated).
> This works for both the small and medium models. (use cc shr.c -o shr -lx).
> 

... Code leading up to

> sdenter(share, SD_WRITE);
> (void )getcwd(pnbuf,100);	/* THIS IS THE KILLER LINE */
> sdleave(share);
> 
> sdfree(share);

	Although the crash is tragic, I would guess that removing the
cast to (void) would cause the code to work correctly. Microsoft
documents this behaviour in some obscure place (does the same on both
XT and AT versions of the compiler) in the Xenix manuals. A similar
piece of code crashes my XT, and causes the AT to segment fault.

	On the AT, a simpler means of instantly halting my machine
without so much as a panic (power cycle to reboot)

	$ cat > /dev/monochrome

	I use an AT w 1 Meg memory, Paradise Systems Multidisplay Card.
Has anyone encountered this on a system with a standard IBM colour adaptor?

||!][b

---------------------
Neil S Erskine			decvax!dartvax!dalcs!force10!erskine
ForceTen Enterprises Inc.
3845 Dutch Village Rd.
Halifax, N.S.
(902) 453-0040
-- 

Neil S Erskine			decvax!dartvax!dalcs!force10!erskine
ForceTen Enterprises Inc.
3845 Dutch Village Rd.
Halifax, N.S.
(902) 453-0040

caf@omen.UUCP (Chuck Forsberg WA7KGX) (07/19/85)

In article <1535@dalcs.UUCP> forceten@dalcs.UUCP (ForceTen Enterprises) writes:
>
>	On the AT, a simpler means of instantly halting my machine
>without so much as a panic (power cycle to reboot)
>
>	$ cat > /dev/monochrome
>
>	I use an AT w 1 Meg memory, Paradise Systems Multidisplay Card.
>Has anyone encountered this on a system with a standard IBM colour adaptor?

My machine has an IBM monochrome board and a Paradise Systems Multidisplay
Card configured as color only (take too much current to run in my PC!).
Memory is 1152k and two serial + two parallel ports.  Default monitor
is monochrome.

	cat > /dev/monochrome
elicits a "can't create" message, even if superuser.

	cat > /dev/color

works as expected, accepting keyboard input until ^D, at which time
it all scrolls out on the color monitor.  In fact, I often redirect 
output to the color monitor, sort of a hardware version of windows
but with only one virtual terminal.

There are some strangenesses with the Paradise board if I try to run
Xenix with the displays in any other configuration that the one described.
-- 
  Chuck Forsberg WA7KGX   ...!tektronix!reed!omen!caf   CIS:70715,131
Omen Technology Inc     17505-V NW Sauvie Island Road Portland OR 97231
Voice: 503-621-3406     Modem: 503-621-3746 (Hit CR's for speed detect)
Home of Professional-YAM, the most powerful COMM program for the IBM PC

robin@medstar.UUCP (Robin Cutshaw) (07/19/85)

> 	Although the crash is tragic, I would guess that removing the
> cast to (void) would cause the code to work correctly. Microsoft
> documents this behaviour in some obscure place (does the same on both
> XT and AT versions of the compiler) in the Xenix manuals. A similar
> piece of code crashes my XT, and causes the AT to segment fault.

(void) makes no difference...

-robin

-- 
----
Robin Cutshaw
uucp:   ...!{akgua,gatech}!medstar!robin