Bug 10210 - fscanf fails to convert %11f correctly
fscanf fails to convert %11f correctly
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
6.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-03-16 15:04 EST by jimabbate
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-14 17:22:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jimabbate 2000-03-16 15:04:24 EST
Using the following input for the fscanf: "test.file":
-.10000E+020.20000E+000.30000E-010.40000E-010.50000E-010.60000E-01

And running the following C program:

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<strings.h>
#include <ctype.h>


int main() {

  FILE *fp;
  float fdata;
  int i;

  fp = fopen("test.file", "r");
  if (NULL == fp) {
    printf("\n Open Failed\n");
    exit (0);
  }

  for (i = 0; i < 6; i++) {
    fscanf(fp, "%11f", &fdata);
    printf("\n fdata=%g", fdata);
  }
  fclose(fp);
  exit (0);
}


YIELDS the following incorrect results:

 fdata=-10
 fdata=0.2
 fdata=3e-11
 fdata=4e-11
 fdata=5e-11
 fdata=6e-11
 fdata=0.07

Running the same program on Solaris, HP and Slackware 3.4 works correctly
Yielding:
 fdata=-10
 fdata=0.2
 fdata=0.03
 fdata=0.04
 fdata=0.05
 fdata=0.06
 fdata=0.07
Comment 1 Cristian Gafton 2000-05-22 10:52:59 EDT
assign to jakub
Comment 2 jimabbate 2000-06-29 01:41:11 EDT
We really need a fix for this problem A.S.A.P  

The workaround is adding over 25% to our total run time!!

When can I expect this bug to be fixed?

PLEASE RESPOND!!

Thanks,
  Jim
Comment 3 jimabbate 2000-08-14 17:22:45 EDT
Another 6 weeks have passed and still nothing!!!

I installed Version 6.2 and it works for the simple test case given originally:
-.10000E+020.20000E+000.30000E-010.40000E-010.50000E-010.60000E-01

However, it still doesn't work correctly in the general case because when I took
the workaround out, our test cases all failed miserably.  Maybe you should call
me when you get ready to work on it and I'll give you a new test case that
breaks it. (503) 672-8717

Jim Abbate

BTW:  If Fluence took this long to respond to bugs, we would have been laughed
out of the businees a long time ago.
Comment 4 Jakub Jelinek 2000-08-15 00:55:09 EDT
I have fixed this in glibc 2.1.92 (thanks for the report), I'm just not sure this is worth issuing glibc 2.1.3 updates because of it.
If you want, I can mail you the patch and you can rebuild glibc yoursef, or you can use glibc from rawhide. Let me know.
Comment 5 jimabbate 2000-10-09 13:45:03 EDT
Thanks for fixing this bug.  I need the fix for this problem now since we are
ready to release a new version of our software.  What do you mean by "I can use
the glibc from rawhide?"  How do I get this?  Is it better to try to rebuild
glibc with the patch, myself?  How do I do that.

Thanks,
  Jim

Note You need to log in before you can comment on or make changes to this bug.