Bug 2167291 - mawk: configure script does not include <stdlib.h> while probing random functions
Summary: mawk: configure script does not include <stdlib.h> while probing random funct...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mawk
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mark McKinstry
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PortingToModernCHelpNeeded
TreeView+ depends on / blocked
 
Reported: 2023-02-06 06:48 UTC by Florian Weimer
Modified: 2024-06-24 20:23 UTC (History)
3 users (show)

Fixed In Version: mawk-1.3.4-1.20230203.fc39 mawk-1.3.4-1.20240123.fc40 mawk-1.3.4-1.20240622.fc41
Clone Of:
Environment:
Last Closed: 2023-08-02 23:34:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2023-02-06 06:48:59 UTC
For some reason, <stdlib.h> is not included in the probes for arc4random, rand, etc., and implicit function declarations are the result. This will lead to build failures with future compilers.

The autoconf version used by this package is quite old, so we probably need upstream's help to fix thsi and regenerate the scripts.

Comment 1 Thomas E. Dickey 2023-02-06 08:40:02 UTC
The test-function in the current version of mawk includes stdlib.h

See for example

https://github.com/ThomasDickey/mawk-snapshots/blob/ff35a089073c25a93772a22aec49edd2e077dec3/configure#L5157

Perhaps it's time for Fedora to upgrade their package.

Comment 2 Ben Cotton 2023-02-07 15:08:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 3 Sam James 2023-02-08 17:29:08 UTC
(In reply to Thomas E. Dickey from comment #1)
> The test-function in the current version of mawk includes stdlib.h
> 
> See for example
> 
> https://github.com/ThomasDickey/mawk-snapshots/blob/
> ff35a089073c25a93772a22aec49edd2e077dec3/configure#L5157
> 
> Perhaps it's time for Fedora to upgrade their package.

I've deliberately not exposed this version to users in Gentoo
because of the warning at the top of CHANGES.

What do you recommend I do?

>NOTE:
>	The regular expression changes begun in 2020 are incomplete, e.g., do
>	not handle a mixture of grouping and brace expressions.  Fixing that
>	issue is needed before a new stable release.

Comment 4 Thomas E. Dickey 2023-02-08 19:46:03 UTC
I debated (with myself), on the compiler-warning issue versus this, and decided that
since the regex issue is not a regression but rather an incomplete feature to
update it in Rawhide (for F39, etc), and presumably finish the feature (to stave
off the inevitable bug reports).

Comment 5 Sam James 2023-02-08 20:31:28 UTC
Thanks for explaining, that makes sense. I hadn't realised it was just for a new feature and not a regression. Cheers!

Comment 6 Thomas E. Dickey 2023-02-08 22:34:26 UTC
yes - "brace expressions" refers to stuff like "a{1,5}" (which is the new part),
while "groups" refers to "(a|b)" (existing code).  In reviewing this in 2020,
I noticed that "(a|b){1,5}" wasn't handled properly.

At the time, I had a distraction, and wasn't able to work on this,
but time passes - I'll see what I can do this time.

Comment 7 Fedora Update System 2023-02-13 23:50:18 UTC
FEDORA-2023-c44ba2bb96 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-c44ba2bb96

Comment 8 Fedora Update System 2023-02-13 23:53:09 UTC
FEDORA-2023-c44ba2bb96 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Florian Weimer 2023-02-14 07:03:32 UTC
Sorry, it doesn't seem to work.  I still get

checking for random-integer functions... unknown

with a compiler that does not support implicit function declarations. For Fedora, I would expect this instead:

checking for random-integer functions... arc4random_stir/arc4random
checking for range of random-integers... 0xFFFFFFFFUL

The aclocal.m4 file in mawk-1.3.4-1.20230203.fc39 contains:

AC_TRY_LINK([
$ac_includes_default
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
],[long seed = 1; $cf_srand_func(seed); seed = $cf_rand_func(); (void)seed],
[cf_cv_srand_func=$cf_func
 break])
done
])

#include <stdlib.h> is still missing.

Comment 10 Thomas E. Dickey 2023-02-14 08:45:24 UTC
I see: the call to AC_CHECK_DECL(exit) is too far down.

It worked for me, because my machine has libbsd-devel,
which has provided this function for some time.
In reviewing the logs, I was looking for the warnings.

Presumably you're not using that package, e.g.,

https://www.phoronix.com/news/GNU-Glibc-arc4random-Functions

I'll be reviewing my bug-list for mawk once I'm done on the current xterm fixes,
and amending this is simple.

Comment 11 Florian Weimer 2023-02-14 10:11:26 UTC
(In reply to Thomas E. Dickey from comment #10)
> I see: the call to AC_CHECK_DECL(exit) is too far down.
> 
> It worked for me, because my machine has libbsd-devel,
> which has provided this function for some time.
> In reviewing the logs, I was looking for the warnings.
> 
> Presumably you're not using that package, e.g.,
> 
> https://www.phoronix.com/news/GNU-Glibc-arc4random-Functions

Yes, current Fedora has arc4random as part of glibc.

> I'll be reviewing my bug-list for mawk once I'm done on the current xterm
> fixes, and amending this is simple.

Thanks!

Comment 12 Thomas E. Dickey 2023-03-24 08:26:55 UTC
I'm still working on xterm, but had a bug report and pushed out this update along with the bug-fix.

https://invisible-island.net/mawk/CHANGES.html#index-t20230322

Comment 13 Fedora Update System 2024-01-24 21:42:49 UTC
FEDORA-2024-80671571e1 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2024-80671571e1

Comment 14 Fedora Update System 2024-01-24 21:45:14 UTC
FEDORA-2024-80671571e1 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2024-06-24 20:18:43 UTC
FEDORA-2024-78d3e07e8a (mawk-1.3.4-1.20240622.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-78d3e07e8a

Comment 16 Fedora Update System 2024-06-24 20:23:27 UTC
FEDORA-2024-78d3e07e8a (mawk-1.3.4-1.20240622.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.


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