bug-gnulib
[Top][All Lists]
Advanced

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

Re: glibc segfault on "special" long double values is _ok_!?


From: Jan-Benedict Glaw
Subject: Re: glibc segfault on "special" long double values is _ok_!?
Date: Fri, 8 Jun 2007 01:03:47 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Thu, 2007-06-07 13:55:41 -0400, Mike Frysinger <address@hidden> wrote:
> On Thursday 07 June 2007, Jan-Benedict Glaw wrote:
> > On Thu, 2007-06-07 13:27:49 -0400, Mike Frysinger <address@hidden> 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      address@hidden              +49-172-7608481
Signature of:            http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
the second  :

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]