[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is this a bug in libc6?



Manoj Srivastava <srivasta@datasync.com> writes:
> 	Permissible undefined behaviour ranges from ignoring the
> 	situation completely with unpredictable results, to behaving
> 	during translation or program execution in a documented manner
> 	charecteristic of the environment (with or without the
> 	issuance of a diagnostic message), to terminating a
> 	translation or execution (with the issuance of a diagnostic
> 	message).
> 
> 	Seems like a requirement to me, or else it is not permitted
>  undefined behaviour. Tell me how fclose in Debian does not volate
>  this from 1.6 of the standard (IEEE versioning).

No it's not a requirement. Requirements are stated in the for "the
implementation shall" or "the implementation must", not "permissable behaviour
ranges from ... to ...". First of all the latter phrasing doesn't say anything
about whether other behaviour is premissable, and second who's to say what
falls between the three stated points in the "range" or what constitutes
"unpredictable results".

What has happened here is that gnu libc has chosen the first choice. Failing
to check the input and print a diagnostic message or exit, it completely
ignored the situation. The "unpredictable results" (or not so unpredictable
really) was that the program received a SEGV.

Experience shows checking arguments is not usually hard or expensive and I
would support suggesting the glibc people change this behaviour. But it's
certainly permissable under ISO to not do so. Thanks for quoting the spec so
we can all verify that it explicitly allows the implementation to not check.

>  (You must admit the comments about monkeys, first made by Chris Torek, was
>  made under frustation and extreme provocation; and was meant more to drive
>  the lesson home that to be an interpretation of the standard).

If this conversation goes on much longer i'll be in a similar state soon.


greg


--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: