RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1575709 - Math functions missing errno settings on underflow
Summary: Math functions missing errno settings on underflow
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: glibc
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: pre-dev-freeze
: 8.0
Assignee: glibc team
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 1594286
TreeView+ depends on / blocked
 
Reported: 2018-05-07 17:09 UTC by Alan Matsuoka
Modified: 2023-07-18 14:30 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-20 21:51:19 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
reproducer (10.00 KB, application/x-tar)
2018-05-07 17:10 UTC, Alan Matsuoka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1663489 0 unspecified CLOSED Math functions missing errno settings on underflow 2023-07-18 14:30:35 UTC

Internal Links: 1663489

Description Alan Matsuoka 2018-05-07 17:09:25 UTC
Description of problem:
What problem/issue/behavior are you having trouble with?  What do you expect to see?

We are finding that our application is affected by a bug in the RHEL 7 math library, where errno is not being set for bessel functions such as j0, j1, jn, and also exp2.  In the case of exp2 it IS setting the fe exception – so we can catch that one.  But the j0-n are a problem since the man page documentation on RHEL 6 specifically states they do NOT set the IEEE fe exception for fetestexcept(), but they should be setting errno.

This seems to match this bug report:
https://sourceware.org/bugzilla/show_bug.cgi?id=18611


Version-Release number of selected component (if applicable):

All RHEL 7 flavors running glibc older that 2.23
also all glibc newer than 2.12

How reproducible:

always

Steps to Reproduce:
1. run reproducer in jtest.tar
2.
3.

Actual results:


RHEL 7:

ash-4.2$ ./jtest
Testing J0:
  Before function call, errno = 0, exception query returns 0
  Calling j0( 1e+256 )
  After function call, errno = 0, exception query returns 0
  Returned function value = 2.04732e-131
Testing J1:
  Before function call, errno = 0, exception query returns 0
  Calling j1( 1e+256 )
  After function call, errno = 0, exception query returns 0
  Returned function value = 7.97882e-129
Testing JN:
  Before function call, errno = 0, exception query returns 0
  Calling jn( 1, 1e+24 )
  After function call, errno = 0, exception query returns 0
  Returned function value = -7.83133e-13
Testing EXP2:
  Before function call, errno = 0, exception query returns 0
  Calling exp2( -1222 )
  After function call, errno = 0, exception query returns 16
  Returned function value = 0
bash-4.2$ ldd -r ./jtest
	linux-vdso.so.1 =>  (0x00007ffffb53c000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f20a521a000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f20a4f18000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f20a4d01000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f20a493e000)
	/lib64/ld-linux-x86-64.so.2 (0x000055dcbf791000)
bash-4.2$ rpm -qf /lib64/libm.so.6
glibc-2.17-196.el7_4.2.x86_64
[alanm@localhost-live C02014182]$ ./jtest
Testing J0:
  Before function call, errno = 0, exception query returns 0
  Calling j0( 1e+256 )
  After function call, errno = 0, exception query returns 0
  Returned function value = 2.04732e-131
Testing J1:
  Before function call, errno = 0, exception query returns 0
  Calling j1( 1e+256 )
  After function call, errno = 0, exception query returns 0
  Returned function value = 7.97882e-129
Testing JN:
  Before function call, errno = 0, exception query returns 0
  Calling jn( 1, 1e+24 )
  After function call, errno = 0, exception query returns 0
  Returned function value = -7.83133e-13
Testing EXP2:
  Before function call, errno = 0, exception query returns 0
  Calling exp2( -1222 )
  After function call, errno = 34, exception query returns 16
  Returned function value = 0
[alanm@localhost-live C02014182]$ rpm -q glibc
glibc-2.26-24.fc27.x86_64

It has the patch in https://sourceware.org/bugzilla/show_bug.cgi?id=18611 
and it does NOT do the correct thing.

I'm suspecting that the wrapper functions to the __ieee754_jXXX functions need to
be more like the RHEL 6 versions


Expected results:

RHEL 6 glibc provides results which are expected by the user.
[alanm@vmw102 C02014182]$ ./jtest
Testing J0:
  Before function call, errno = 0, exception query returns 0
  Calling j0( 1e+256 )
  After function call, errno = 34, exception query returns 0
  Returned function value = 0
Testing J1:
  Before function call, errno = 0, exception query returns 0
  Calling j1( 1e+256 )
  After function call, errno = 34, exception query returns 0
  Returned function value = 0
Testing JN:
  Before function call, errno = 0, exception query returns 0
  Calling jn( 1, 1e+24 )
  After function call, errno = 34, exception query returns 0
  Returned function value = 0
Testing EXP2:
  Before function call, errno = 0, exception query returns 0
  Calling exp2( -1222 )
  After function call, errno = 34, exception query returns 0
  Returned function value = 0
[alanm@vmw102 C02014182]$ rpm -qf /lib64/libm.so.6
glibc-2.12-1.209.el6_9.2.x86_64

Additional info:

Comment 2 Alan Matsuoka 2018-05-07 17:10:09 UTC
Created attachment 1432750 [details]
reproducer

Comment 4 Carlos O'Donell 2018-05-22 16:08:05 UTC
Thanks for filling this Alan, we'll review this as part of normal bug review process.

Comment 5 Carlos O'Donell 2018-11-20 21:51:19 UTC
The Platform Tools glibc team has decided that this will not be fixed in the Red Hat Enterprise Linux 7 product. The sequences of changes is rather extensive and not limited to just the few functions in question. The codebase is based on upstream glibc 2.17 which for libm has drifted considerably, and so the risk and cost of making changes like this is quite high. Upstream has improved errno settings in this area though, and those improvements are available in Red Hat Enterprise Linux 8, which has a public beta for test. Please ask the customer to look into reviewing if Red Hat Enterprise Linux 8 meets their needs. I'm marking this issue CLOSED/NEXTRELEASE.


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