Bug 2412227
| Summary: | ruby: FTBFS in Fedora Rawhide | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Vít Ondruch <vondruch> |
| Component: | ruby | Assignee: | Vít Ondruch <vondruch> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | arjun, codonell, dj, fberat, fweimer, jlaw, josmyers, jprokop, mcermak, mcoufal, mfabian, mtasaka, pfrankli, pvalena, ruby-packagers-sig, sipoyare, skolosov, suraj.ghimire7, vondruch |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| URL: | https://koschei.fedoraproject.org/package/ruby | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2025-11-04 15:21:19 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Vít Ondruch
2025-11-04 10:15:53 UTC
The gamma function has a pole at -1, so the sign is mathematically undefined. I don't see POSIX requirement for any specific result here, either. https://en.wikipedia.org/wiki/Gamma_function The following is failing:
======================================================================
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#define MY_ASSERT(expr) \
do { \
if (!(expr)) { \
fprintf(stderr, "At line [%d] expr \"" #expr "\" failed\n", __LINE__); \
abort(); \
} \
} while(0)
int main(void) {
int sign = 0;
double ret = lgamma_r(-1, &sign);
MY_ASSERT(ret == HUGE_VAL);
MY_ASSERT(sign == 1);
}
======================================================================
With glibc glibc-2.42.9000-8.fc44.x86_64:
======================================================================
At line [17] expr "sign == 1" failed
Aborted
======================================================================
POSIX.1-2024 explicitly says
(e.g. https://pubs.opengroup.org/onlinepubs/9799919799/functions/lgamma.html)
If \(x\) is a non-positive integer, a pole error shall occur and
lgamma(), lgammaf(), and lgammal() shall return +HUGE_VAL, +HUGE_VALF, and +HUGE_VALL, respectively.
So lgamma(-1) shall return +HUGE_VAL , so the sign of the return value shall be positive.
The return value is HUGE_VAL according to the test, so it is positive. POSIX does not say anything about the sign. Ah... actually If \(x\) is NaN, -Inf, or a negative integer, the value of signgam is unspecified. So looks like this should be fixed in ruby side. Thanks! |