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

Ben Pfaff blp@cs.stanford.edu
Thu Jun 7 18:25:00 GMT 2007


Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:

> 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 function do I call to check a "long double" for validity
before using it?  fpclassify doesn't have an appropriate return
value, and I don't know of another choice.  I think I'm stuck
writing CPU- and floating point representation-specific code to
do this.  Not fun.
-- 
Ben Pfaff 
http://benpfaff.org



More information about the Libc-alpha mailing list