Re: isatty bug

2003-09-16 Thread Christopher Faylor
On Tue, Sep 16, 2003 at 03:53:07PM -0500, Brian Ford wrote: >>(gdb) p fstat(fd1, &stat1) >>Segmentation fault (core dumped) >> >>now, why does GDB crash? >> >Maybe because gdb actually calls fstat instead of fstat64 since it doesn't >get the magic link time redirection? No idea really. The curren

Re: isatty bug

2003-09-16 Thread Brian Ford
Sam Steingold wrote: > it turned out that I needed to recompile the obj file that defined my > same_tty_p() - of course. how silly of me! [now, I think I was told > that everything was binary backwards compatible; I guess I was confused] > now that I did it -- my scratch.c works just like your s

Re: isatty bug

2003-09-16 Thread Sam Steingold
> * Brian Ford <[EMAIL PROTECTED]> [2003-09-16 14:22:33 -0500]: > > Was that stock Cygwin gdb that crashed? yes, gdb 20030901-1 > $ cat stest.c > #include > #include > > int same_tty_p (int fd1, int fd2) > { > struct stat stat1, stat2; > > return (fstat(fd1, &stat1) >= 0 && fstat(fd2, &st

Re: isatty bug

2003-09-16 Thread Christopher Faylor
On Tue, Sep 16, 2003 at 02:16:05PM -0400, Sam Steingold wrote: >what about this: > >int same_tty_p (int fd1, int fd2) >{ > struct stat stat1; > struct stat stat2; > return ((fstat(fd1,&stat1) >= 0) && (fstat(fd2,&stat2) >= 0) && > (stat1.st_dev == stat2.st_dev) && (stat2.st_ino == stat2

Re: isatty bug

2003-09-16 Thread Brian Ford
Was that stock Cygwin gdb that crashed? Try this: $ cat stest.c #include #include int same_tty_p (int fd1, int fd2) { struct stat stat1, stat2; return (fstat(fd1, &stat1) >= 0 && fstat(fd2, &stat2) >= 0 && stat1.st_dev == stat2.st_dev && stat2.st_ino == stat2.st_ino); } int mai

Re: isatty bug

2003-09-16 Thread Sam Steingold
> * Brian Ford <[EMAIL PROTECTED]> [2003-09-16 13:35:58 -0500]: > > Sam Steingold wrote: > > > I get crash both in program and gdb (i.e., gdb itself segfaults) on the > > fstat() calls. > > > Sounds like you have 1.3.22 headers and a 1.5.x Cygwin DLL and import lib? sounds too good to be true (a

Re: isatty bug

2003-09-16 Thread Igor Pechtchanski
On Tue, 16 Sep 2003, Sam Steingold wrote: > [snip] > ps. I am missing "man fstat" - what package do I need for that? I don't believe system call manpages are contained in any package (a search on for "man2/" returns nothing). Feel free to submit one. Igor --

Re: isatty bug

2003-09-16 Thread Brian Ford
Sam Steingold wrote: > I get crash both in program and gdb (i.e., gdb itself segfaults) on the > fstat() calls. > Sounds like you have 1.3.22 headers and a 1.5.x Cygwin DLL and import lib? -- Brian Ford Senior Realtime Software Engineer VITAL - Visual Simulation Systems FlightSafety Internationa

Re: isatty bug

2003-09-16 Thread Sam Steingold
> * Igor Pechtchanski <[EMAIL PROTECTED]> [2003-09-16 13:36:30 -0400]: > > > > >int main (void) { > > > >#define Y_N(x) ((x) ? "(TTY)" : "(not a TTY)") > > > > printf("0: %s %s\n1: %s %s\n2: %s %s\n", > > > > ttyname(0),Y_N(isatty(0)),ttyname(1),Y_N(isatty(1)), > > > > ttyname(2),

Re: isatty bug

2003-09-16 Thread Sam Steingold
> * Christopher Faylor <[EMAIL PROTECTED]> [2003-09-16 13:19:51 -0400]: > > On Tue, Sep 16, 2003 at 10:42:49AM -0400, Sam Steingold wrote: > >>* Corinna Vinschen <[EMAIL PROTECTED]> [2003-09-16 12:01:08 +0200]: > >> > >> On Mon, Sep 15, 2003 at 05:19:16PM -0400, Sam Steingold wrote: > >> > calling

Re: isatty bug

2003-09-16 Thread Igor Pechtchanski
On Tue, 16 Sep 2003, Sam Steingold wrote: > > * Christopher Faylor <[EMAIL PROTECTED]> [2003-09-16 13:19:51 -0400]: > > > > On Tue, Sep 16, 2003 at 10:42:49AM -0400, Sam Steingold wrote: > > >>* Corinna Vinschen <[EMAIL PROTECTED]> [2003-09-16 12:01:08 +0200]: > > >> > > >> On Mon, Sep 15, 2003 at

Re: isatty bug

2003-09-16 Thread Christopher Faylor
On Tue, Sep 16, 2003 at 10:42:49AM -0400, Sam Steingold wrote: >>* Corinna Vinschen <[EMAIL PROTECTED]> [2003-09-16 12:01:08 +0200]: >> >> On Mon, Sep 15, 2003 at 05:19:16PM -0400, Sam Steingold wrote: >> > calling isatty(0) in a program results in a segfault: >> And the version number of the DLL i

Re: isatty bug

2003-09-16 Thread Sam Steingold
>* Corinna Vinschen <[EMAIL PROTECTED]> [2003-09-16 12:01:08 +0200]: > > On Mon, Sep 15, 2003 at 05:19:16PM -0400, Sam Steingold wrote: > > calling isatty(0) in a program results in a segfault: > And the version number of the DLL is ... 1.5.4(0.94/3/2) > Fd 0 is a tty, a console window, a tape dr

Re: isatty bug

2003-09-16 Thread Corinna Vinschen
On Mon, Sep 15, 2003 at 05:19:16PM -0400, Sam Steingold wrote: > calling isatty(0) in a program results in a segfault: And the version number of the DLL is ... Fd 0 is a tty, a console window, a tape drive, a ... Reproducible testcase is ... http://cygwin.com/problems.html I've tested with 1.5.[

isatty bug

2003-09-15 Thread Sam Steingold
calling isatty(0) in a program results in a segfault: Exception: STATUS_ACCESS_VIOLATION at eip= eax= ebx=0004 ecx=610CEE30 edx=610CEE18 esi=004073B8 edi=0022FECC ebp=0400 esp=0022FE00 program=d:\sds\c\scratch.exe cs=001B ds=0023 es=0023 fs=0038 gs= ss=0023 Stack trace: