Subject: Bug report re: gcc under b18
From: [email-masked] (Victor Schneider)

30 Sep 1997 04:01:32 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
To: [email-masked]

I was compiling a possibly improved version of chroot()
today, when I got the following messages:

From Windows 95:
================
CPP caused an invalid page fault in
module CYGWIN.DLL at 0137:10004f8f.
Registers:
EAX=00000000 CS=0137 EIP=10004f8f EFLGS=00010246
EBX=00000002 SS=013f ESP=0254f8c0 EBP=0254f8c8
ECX=c106e964 DS=013f ESI=00000002 FS=2cbf
EDX=bffbf9e0 ES=013f EDI=0254f9e0 GS=0000
Bytes at CS:EIP:
c6 80 07 01 00 00 00 83 3d 20 60 04 10 00 74 23 
Stack dump:
00000002 0254f9e0 0254f8d8 1000658c 00000002 00000007 0254f8f0 10005fb8
00000002 0254fe04 0254f9e0 0254f9c4 0254f914 bff7663c 0254f9c4 0254fe04 

From bash$:
===========
bash$ gcc -c -O libfiforoot.c
(unknown) In cygwin_except_handler exc C0000005 at 10017D7A sp 254FCAC
(unknown) Exception trapped!
(unknown) exception C0000005 at 10017D7A
(unknown) exception: ax 82B46000 bx 0 cx C106E964 dx BFFBF9E0
(unknown) exception: si 8157902C di 8157E2FC bp 254FCAC sp 254FCAC
(unknown) exception is: STATUS_ACCESS_VIOLATION
(unknown) Stack trace:
(unknown) frame 0: sp = 0x254FAC4, pc = 0x10005FAE
(unknown) frame 1: sp = 0x254FAE0, pc = 0xBFF7663C
(unknown) frame 2: sp = 0x254FB04, pc = 0xBFF859D9
(unknown) frame 3: sp = 0x254FB9C, pc = 0xFFECBAD7
(unknown) frame 4: sp = 0x254FCAC, pc = 0x1000BAC3
(unknown) frame 5: sp = 0x254FCBC, pc = 0x100047AD
(unknown) frame 6: sp = 0x254FE0C, pc = 0x10004E7B
(unknown) frame 7: sp = 0x254FE18, pc = 0x4118D5
(unknown) frame 8: sp = 0x254FE28, pc = 0x40103B
(unknown) frame 9: sp = 0x254FE38, pc = 0xBFF88F75
(unknown) frame 10: sp = 0x254FF78, pc = 0xBFF88E23
(unknown) frame 11: sp = 0x254FFF4, pc = 0xBFF8783F
(unknown) frame 12: sp = 0x8157902C, pc = 0x5
(unknown) In cygwin_except_handler exc C0000005 at 10005A26 sp 254FABC
(unknown) Error while dumping state (probably corrupted stack)

File being compiled (libfiforoot.c):
====================================
#include <unistd.h>
#include <stdlib.h>
#include <pwd.h>
#include <fcntl.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <ctype.h>

/* chroot specific to cygwin32 conventions: */
int chroot (const char *path)
{
   int i;
   char change[] = {'/','/','^','/','\0'};
   for (i = 0; i < 2; i++)
    {
	if (path[i] == '\0') break;
	if isalpha(path[i])
	 {change[2] = tolower(path[i]); break;}
    };
   if (change[2] == 'a') return chdir("/dev/fd0");
   if (change[2] == 'b') return chdir("/dev/fd1");
   if (change[2] == 'c') return chdir("/");
   if (change[2] == 'd') return chdir("/dev/hda5");
   if (change[2] == 's') return chdir("/dev/cdrom"); 
   return chdir(change);
}

int mkfifo (char *path, mode_t _mode)
{
  return open(path,
	O_CREAT | S_IREAD | S_IWRITE | S_IFIFO, 
	_mode);
}

void setpwent ()
{
  endpwent();
}

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".