* fclose() - still broken?
@ 1998-08-18 10:19 Uncle George
0 siblings, 0 replies; 8+ messages in thread
From: Uncle George @ 1998-08-18 10:19 UTC (permalink / raw)
To: axp-list@redhat.com; +Cc: redhat-devel-list@redhat.com
the latest ( 0728 ) from mozilla gets a core dump trying to fclose a
channel!
i took the latest glibc rpm ( -19) & src from redhat ( for which i dont
recommend a make install, unless u know where the missing
__lstat/__fstat is )
HAS fclose(), and its problems been resolved ? or was that a thread that
died out unresolved?
gat
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fclose() - still broken?
[not found] <m0z8jmQ-000aNFC@the-village.bc.nu>
@ 1998-08-18 10:48 ` Uncle George
1998-08-19 2:00 ` Chris Wedgwood
0 siblings, 1 reply; 8+ messages in thread
From: Uncle George @ 1998-08-18 10:48 UTC (permalink / raw)
To: redhat-devel-list; +Cc: axp-list
gee, that sounds like someone else... hum...
anyway, that does not appear to be the case. it appears that a function
dispatch table is missing, or nuked.
gat
btw, core dumps, IMHO, are never valid behavior.
Alan Cox wrote:
> > HAS fclose(), and its problems been resolved ? or was that a thread that
> > died out unresolved?
>
> If Mozilla passes fclose an invalid or already closed FILE * then it will
> core dump. Thats valid behaviour
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fclose() - still broken?
1998-08-18 10:48 ` fclose() - still broken? Uncle George
@ 1998-08-19 2:00 ` Chris Wedgwood
1998-08-19 2:50 ` Quant-X Alpha Linux Support
0 siblings, 1 reply; 8+ messages in thread
From: Chris Wedgwood @ 1998-08-19 2:00 UTC (permalink / raw)
To: axp-list, redhat-devel-list
On Tue, Aug 18, 1998 at 06:48:53AM -0400, Uncle George wrote:
> btw, core dumps, IMHO, are never valid behavior.
true... but if your given a FILE* its not always easy to tell whether
or not it points to something sane or if indeed the address is sane
itself.
(yes, in theory you can check this, but it would be pretty expensive
to do so).
-cw
P.S. Win32 actually has an API for checking whether or not a pointer
is valid (IsBadPtrXXX ?), a libc equivalent to this might be a
nice thing to have. (If expensive, then apps would only use this
when compile with, say -DPOINTERCHECK).
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fclose() - still broken?
1998-08-19 2:00 ` Chris Wedgwood
@ 1998-08-19 2:50 ` Quant-X Alpha Linux Support
1998-08-19 12:04 ` Uncle George
1998-08-20 0:12 ` Chris Wedgwood
0 siblings, 2 replies; 8+ messages in thread
From: Quant-X Alpha Linux Support @ 1998-08-19 2:50 UTC (permalink / raw)
To: axp-list; +Cc: redhat-devel-list
Hi !
> On Tue, Aug 18, 1998 at 06:48:53AM -0400, Uncle George wrote:
>
> > btw, core dumps, IMHO, are never valid behavior.
rc = read(0, NULL, 10);
returns 6 here (Linux 2.1.113 i586) (no errno, no core)
when entering "hello<CR>"
Is this valid, or not ? ;-0
ciao -
Stefan
--
Quant-X Service & Ph: (+43) 4212 6004-0
Consulting Ges.m.b.H. Fax: (+43) 4212 600420
http://www.quant-x.com Email: support@quant-x.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fclose() - still broken?
1998-08-19 12:04 ` Uncle George
@ 1998-08-19 12:00 ` David Alan Gilbert
0 siblings, 0 replies; 8+ messages in thread
From: David Alan Gilbert @ 1998-08-19 12:00 UTC (permalink / raw)
To: axp-list
Uncle George wrote:
>
> thanks for all this info, but i still get/got probs with the
> fopen/fclose et al routines, in particular the _IO_FILE_plus->value
> structure. The redhat sources compiled for alpha ( out of box ), just
> dont match up with the structure definition that comes with the alpha
> binary rpm's. I do not have 5.1 ( which is where the binaries was ment
> to be. )
Hmm - if you have 5.0 (if not what do you have?) then the easiest
soloution to the fopen/fclose abortion is to get a release of EGCS
which comes with its own version of libstdc++. Use it and
all the fclose issues go away.
Dave
--
----------------------------------------------------------------------
- Dr. David Alan Gilbert - WARNING! This is a beta release .signature-
- Work: dg @ cogency.co.uk - +44-(0)161-428-9444 -
- Home: gro.gilbert @ treblig.org - -
----------------------------------------------------------------------
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fclose() - still broken?
1998-08-19 2:50 ` Quant-X Alpha Linux Support
@ 1998-08-19 12:04 ` Uncle George
1998-08-19 12:00 ` David Alan Gilbert
1998-08-20 0:12 ` Chris Wedgwood
1 sibling, 1 reply; 8+ messages in thread
From: Uncle George @ 1998-08-19 12:04 UTC (permalink / raw)
To: Quant-X Alpha Linux Support; +Cc: axp-list@redhat.com
thanks for all this info, but i still get/got probs with the
fopen/fclose et al routines, in particular the _IO_FILE_plus->value
structure. The redhat sources compiled for alpha ( out of box ), just
dont match up with the structure definition that comes with the alpha
binary rpm's. I do not have 5.1 ( which is where the binaries was ment
to be. )
gat
Quant-X Alpha Linux Support wrote:
> Hi !
>
> > On Tue, Aug 18, 1998 at 06:48:53AM -0400, Uncle George wrote:
> >
> > > btw, core dumps, IMHO, are never valid behavior.
>
> rc = read(0, NULL, 10);
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fclose() - still broken?
1998-08-19 2:50 ` Quant-X Alpha Linux Support
1998-08-19 12:04 ` Uncle George
@ 1998-08-20 0:12 ` Chris Wedgwood
1998-08-20 7:33 ` Richard Henderson
1 sibling, 1 reply; 8+ messages in thread
From: Chris Wedgwood @ 1998-08-20 0:12 UTC (permalink / raw)
To: Quant-X Alpha Linux Support, axp-list; +Cc: redhat-devel-list
On Wed, Aug 19, 1998 at 04:50:08AM +0200, Quant-X Alpha Linux Support wrote:
> rc = read(0, NULL, 10);
>
> returns 6 here (Linux 2.1.113 i586) (no errno, no core)
> when entering "hello<CR>"
>
> Is this valid, or not ? ;-0
If you have a writable page at 0x0, then yes.
A stickier question is what happens you you try to read a 10 byte
file using read(fd,&buffer,8192) when the buffer is only 4k is size.
2.0.x will return EFAULT because it knows the entire range is not
valid (the high 4k is bad), but 2.1.x will succeed because it can
read 10 bytes without failing.
Which is correct? (Btw, different OSs take one or other approach).
-cw
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: fclose() - still broken?
1998-08-20 0:12 ` Chris Wedgwood
@ 1998-08-20 7:33 ` Richard Henderson
0 siblings, 0 replies; 8+ messages in thread
From: Richard Henderson @ 1998-08-20 7:33 UTC (permalink / raw)
To: axp-list, Quant-X Alpha Linux Support; +Cc: redhat-devel-list
On Thu, Aug 20, 1998 at 12:12:06PM +1200, Chris Wedgwood wrote:
> > rc = read(0, NULL, 10);
> >
> > returns 6 here (Linux 2.1.113 i586) (no errno, no core)
> > when entering "hello<CR>"
> >
> > Is this valid, or not ? ;-0
Yes, but...
> A stickier question is what happens you you try to read a 10 byte
> file using read(fd,&buffer,8192) when the buffer is only 4k is size.
>
> 2.0.x will return EFAULT because it knows the entire range is not
> valid (the high 4k is bad), but 2.1.x will succeed because it can
> read 10 bytes without failing.
>
> Which is correct? (Btw, different OSs take one or other approach).
Both are correct, as you are walking in areas that are
officially undefined.
As surprising as it might be, it is not required that a
system detect and return EFAULT. I personally feel that
it is a quality of implementation detail that we do so.
It would also be interesting to send SIGSEGV instead and
find out how many programs are buggy.
Unfortunately, not all of the code rearrangements that
are necessary to propogate back EFAULT were done, and so
will now have to be delayed until 2.3.
r~
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~1998-08-20 7:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <m0z8jmQ-000aNFC@the-village.bc.nu>
1998-08-18 10:48 ` fclose() - still broken? Uncle George
1998-08-19 2:00 ` Chris Wedgwood
1998-08-19 2:50 ` Quant-X Alpha Linux Support
1998-08-19 12:04 ` Uncle George
1998-08-19 12:00 ` David Alan Gilbert
1998-08-20 0:12 ` Chris Wedgwood
1998-08-20 7:33 ` Richard Henderson
1998-08-18 10:19 Uncle George
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox