Topic
  • 5 replies
  • Latest Post - ‏2013-02-03T07:22:44Z by SystemAdmin
SystemAdmin
SystemAdmin
549 Posts

Pinned topic sprintf format precision bug on AIX 6.1 64-bit

‏2012-11-04T16:16:43Z |
Hello, colleagues.
I'm trying to find out what is the correction APAR for the following problem, if any, before I ask system administrator to apply patches. I have not found any relevant.

I call sprintf(buf,"%.f", 0.00249000000269461452) and the result is wrong ("00" instead of "0").
This only happens on 64-bit binary; 32-bit one is OK. When I build on AIX 5.3, the same binary has problems on AIX 6.1 I have, so this is not a compiler problem.

oslevel -r: 6100-07
oslevel -s: 6100-07-03-1207
lsattr -EO -l proc0 -a type: PowerPC_POWER7
/usr/bin/lslpp -l | grep -w bos.rte.libc | sort | uniq: 6.1.7.2

I attach a source file (dbl1.c), "make run" reports:
xlc -q64 dbl1.c -o dbl1
./dbl1
<00>
wrong, must be "<0>"
make: 1254-004 The error code from the last command is 255.
Stop.

Attachments

Updated on 2013-02-03T07:22:44Z at 2013-02-03T07:22:44Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    549 Posts

    Re: sprintf format precision bug on AIX 6.1 64-bit

    ‏2012-11-08T14:15:14Z  
    Just so you know you are not alone we are seeing a similar issue on 6100-07-05.
  • SystemAdmin
    SystemAdmin
    549 Posts

    Re: sprintf format precision bug on AIX 6.1 64-bit

    ‏2012-11-13T16:22:52Z  
    APAR IV23030 ( SPRINTF PRINTS ONE MORE FRACTIONAL DIGIT THAN SPECIFIED ).
  • SystemAdmin
    SystemAdmin
    549 Posts

    Re: sprintf format precision bug on AIX 6.1 64-bit

    ‏2012-11-21T11:17:01Z  
    APAR IV23030 ( SPRINTF PRINTS ONE MORE FRACTIONAL DIGIT THAN SPECIFIED ).
    Well, now I need to wait for our IT guys to help me to obtain the article:
    http://www.ibm.com/support/docview.wss?uid=isg1IV23030
    mentioned at:
    http://www-01.ibm.com/support/docview.wss?crawler=1&uid=isg1IV23030
    This takes forever.
  • SystemAdmin
    SystemAdmin
    549 Posts

    Re: sprintf format precision bug on AIX 6.1 64-bit

    ‏2012-11-28T07:15:56Z  
    Well, now I need to wait for our IT guys to help me to obtain the article:
    http://www.ibm.com/support/docview.wss?uid=isg1IV23030
    mentioned at:
    http://www-01.ibm.com/support/docview.wss?crawler=1&uid=isg1IV23030
    This takes forever.
    I've got the machine:

    oslevel -s: 6100-08-01-1245
    (published on 9-Nov-2012, release date is December 2012)
    lslpp -l bos.rte.libc: 6.1.8.0

    And the bug is still there.
  • SystemAdmin
    SystemAdmin
    549 Posts

    Re: sprintf format precision bug on AIX 6.1 64-bit

    ‏2013-02-03T07:22:44Z  
    APAR IV23030 ( SPRINTF PRINTS ONE MORE FRACTIONAL DIGIT THAN SPECIFIED ).
    After involving both ends (our IT and IBM support) I've got the APAR IV23030, tested it, and it fixes the problem.

    Thank you, afluin, for the hint.