glibc segfault on "special" long double values is _ok_!?
Jan-Benedict Glaw
jbglaw@lug-owl.de
Thu Jun 7 23:03:00 GMT 2007
On Thu, 2007-06-07 13:55:41 -0400, Mike Frysinger <vapier@gentoo.org> wrote:
> On Thursday 07 June 2007, Jan-Benedict Glaw wrote:
> > On Thu, 2007-06-07 13:27:49 -0400, Mike Frysinger <vapier@gentoo.org> wrote:
> > > read what i said again ... the clients are doing write()/read() on the
> > > double directly, but one side has debugging enabled so it additionally
> > > does printf() on the values coming across -> bam, server crashes
> >
> > So it didn't check its input prior using it.
>
> which is the entire point of this thread ... do you force every application
> out there to implement sanity checking on incoming float formats (which
> requires every application to basically read the standard and do bit parsing
> to make sure the values are valid), or do you do it once in glibc
As long as you cannot *force* the other party to send valid data, you
cannot sanely expect getting valid data. This isn't ment specifically
for floating point values, but for all code.
Would you put this into your inetd.conf?
#!/usr/bin/env sh
while read CMD STUFF; do
case "$CMD" in
help | "?" | "")
echo "help - print this help"
echo "ls <dir> - print contents of directory"
echo "cat <file> - retrieve file contents"
;;
*)
$CMD $STUFF
;;
esac
done
The sole point is that people are somewhat surprised that floats can
be bad. Most guys just use it as "ints with larger values", but
they're totally different and don't expect getting surprising results.
For pointers, there's at least some basic understanding for that
issue. (But ask somebody why you've got to push "void *" onto the stack
for %p format strings and why a "struct something *" theoretically won't
work in all cases!)
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481
Signature of: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
the second :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20070607/f731650d/attachment.sig>
More information about the Libc-alpha
mailing list