Bug 63307

Summary: apxs gives "use of uninitialized value in concatenation" error
Product: Apache httpd-2 Reporter: Reshma V Kumar <reskumar>
Component: AllAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED FIXED    
Severity: normal Keywords: FixedInTrunk, PatchAvailable
Priority: P2    
Version: 2.4.38   
Target Milestone: ---   
Hardware: PC   
OS: AIX   
Attachments: do not remove parentheses, otherwise variables are not evaluated
avoid printing uninitialized variables

Description Reshma V Kumar 2019-04-01 08:57:27 UTC
I am building httpd 2.4.38 on AIX 6.1. 
Executing apxs(Apache extension tool) command on AIX 6.1 gives the following warning

/opt/freeware/bin/apxs -q libexecdir
Use of uninitialized value in concatenation (.) or string at /opt/freeware/bin/apxs line 222.
/opt/freeware/lib/httpd/module

The following line from apxs is causing the warning. 

my $CFG_LDFLAGS    = join ' ', map { get_vars($_) }
  qw(LDFLAGS NOTEST_LDFLAGS SH_LDFLAGS);

The values these FLAGS hold are as follows
LDFLAGS = -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
NOTEST_LDFLAGS =
SH_LDFLAGS = $(EXTRA_LDFLAGS)
EXTRA_LDFLAGS = -Wl,-brtl
Comment 1 Reshma V Kumar 2019-04-01 09:14:20 UTC
I am getting this error due to SH_LDFLAGS. If SH_LDFLAGS is empty, then I dont get this error.
Comment 2 Petros Marios Prokopiou 2019-09-23 10:43:44 UTC
(In reply to Reshma V Kumar from comment #1)
> I am getting this error due to SH_LDFLAGS. If SH_LDFLAGS is empty, then I
> dont get this error.

Hi,
I was unable to replicate your problem by building 2.4.38
I tried using
EXTRA_LDFLAGS=-Wl,-brtl

or 

SH_LDFLAG=-Wl,-brtl

Could you provide a more detailed replication procedure to help pinpoint the problem ?
Comment 3 Reshma V Kumar 2019-10-14 09:28:42 UTC
Once the build is successful and the package is installed, executing the following command gives the warning
# /opt/freeware/bin/apxs -q libexecdir
Use of uninitialized value in concatenation (.) or string at /opt/freeware/bin/apxs line 222.
/opt/freeware/lib/httpd/modules

Following are the values from /var/www/build/config_vars.mk file 
LDFLAGS = -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
SH_LDFLAGS = $(EXTRA_LDFLAGS) $(EXTRA_LIBS)
EXTRA_LDFLAGS = -Wl,-brtl
EXTRA_LIBS =

The warning is removed if SH_LDFLAGS in /var/www/build/config_vars.mk is empty
SH_LDFLAGS =

# /opt/freeware/bin/apxs -q libexecdir
/opt/freeware/lib/httpd/modules
Comment 4 Giovanni Bechis 2020-01-22 08:58:20 UTC
Created attachment 36976 [details]
do not remove parentheses, otherwise variables are not evaluated

I cannot find any reason why parentheses are removed from the variable.
Comment 5 Reshma V Kumar 2020-03-05 11:00:51 UTC
This patch worked for me. Will this patch be commited to httpd source code?
Comment 6 Giovanni Bechis 2020-03-07 09:27:58 UTC
I would commit it smoothly if someone could explain to me why parenthesis are removed on current implementation.
Comment 7 Reshma V Kumar 2020-03-09 13:21:22 UTC
https://github.com/apache/httpd/commit/8e67a36d9ba392a693c463afe8de8a9181d1f7e4#diff-1874f6a844636ac4ceb88701b5e8f023

This change has been introduced in the source code through the above commit.
@dougm has committed this change.
Comment 8 Giovanni Bechis 2020-03-10 22:45:54 UTC
Created attachment 37091 [details]
avoid printing uninitialized variables

Diff that doesn't remove parenthesis but still works.
Comment 9 Reshma V Kumar 2020-03-23 05:16:05 UTC
This patch resolved the error
Comment 10 Giovanni Bechis 2020-03-23 07:08:53 UTC
Fixed in r1875534.