Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 921676 - dev-libs/apr www-servers/apache - libtool enters infinite loop if PORTAGE_TMPDIR is on different partition
Summary: dev-libs/apr www-servers/apache - libtool enters infinite loop if PORTAGE_TMP...
Status: RESOLVED DUPLICATE of bug 40992
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: Normal normal
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on: 40992
Blocks:
  Show dependency tree
 
Reported: 2024-01-09 17:03 UTC by Joe
Modified: 2024-02-08 16:47 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info_and_apache-build-failure_output,35.84 KB, text/plain)
2024-01-09 17:03 UTC, Joe
Details
/usr/share/apr/build/libtool attached as requested (usr_share_apr_build_libtool,341.39 KB, application/x-shellscript)
2024-02-06 19:58 UTC, Joe
Details
/var/tmp/portage/dev-libs/apr-1.7.4-r1/work/apr-1.7.4/config.log archived with "tar cvjpf config.log.tbz2 config.log" (config.log.tbz2,65.75 KB, application/x-bzip2-compressed-tar)
2024-02-07 14:19 UTC, Joe
Details
Output of # FEATURES="keepwork" emerge -av1 dev-libs/apr-util (apr-util_fail,20.90 KB, text/plain)
2024-02-08 14:31 UTC, Joe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe 2024-01-09 17:03:03 UTC
Created attachment 881790 [details]
emerge --info

When building (e.g.) www-servers/apache-2.4.58-r2, compile job goes into infinite loop, with line after line of output showing "libtool: compile: Waiting for unixd.o.lock to be removed"

I found lots of really old bugs for a variety of packages with similar "libtool infinite loop" symptoms, and as in some of those cases, this happens for me only if PORTAGE_TMPDIR is not on the root partition.  

This is not happening on all of my machines - only on my ASUS tinkerboard-s (armv7l).  emerge --info output is attached.

Work arounds:
(1) create /root/portage_tmpdir and modify /etc/portage/make.conf to point at it
  PORTAGE_TMPDIR="/root/portage_tmpdir"
(2) create a per-package rule, for example 
  /etc/portage/env/portage_tmpdir_on_rootfs.conf
with contents -- 
  PORTAGE_TMPDIR="/root/portage_tmpdir"
where the indicated directory (owned by portage) looks like this --
  drwxrwxrwt  4 portage portage  4096 Nov  5 09:28 portage_tmpdir
and /etc/portage/package.env/package.env contains
  ...
  www-servers/apache portage_tmpdir_on_rootfs.conf
  ...

Today's result with workaround #2:
  >>> www-servers/apache-2.4.58-r2 merged.

  >>> Completed (1 of 1) www-servers/apache-2.4.58-r2::gentoo

Otherwise, here is today's build-failure output (without the workaround):
Comment 1 Joe 2024-01-09 17:05:35 UTC
Build failure output is appended to attachment, following emerge --info output
Comment 2 Mike Gilbert gentoo-dev 2024-01-09 19:20:31 UTC
What type of filesystem does PORTAGE_TMPDIR live on? Please share your mount table.
Comment 3 Mike Gilbert gentoo-dev 2024-01-09 19:48:05 UTC
I suspect the copy of libtool installed by dev-libs/apr might be broken on your system. Specifically, need_locks is set to "yes" when it should be "no".

Please attach /usr/share/apr/build/libtool so I can confirm this.

Assuming that is the case, please rebuild dev-libs/apr and attach the resulting build log. I am looking for a line that looks like this, but with "no" in place of "yes".

> checking if x86_64-pc-linux-gnu-gcc supports -c -o file.o... rm: cannot remove 'conftest*': No such file or directory
> yes
Comment 4 Mike Gilbert gentoo-dev 2024-01-09 20:05:52 UTC
Please also attach config.log if you rebuild dev-libs/apr and get "no" for a result from that configure check.
Comment 5 Joe 2024-02-06 19:46:21 UTC
Mount table as requested --

# mount
/dev/mmcblk0p2 on / type ext4 (rw,noatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=10240k,nr_inodes=84975,mode=755)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=188596k,nr_inodes=819200,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,nosuid,nodev,noexec,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
Comment 6 Joe 2024-02-06 19:49:49 UTC
(In reply to Mike Gilbert from comment #2)
> What type of filesystem does PORTAGE_TMPDIR live on? Please share your mount
> table.

Answer: ext4

Most recent instance of this error is on arm system using the following simple /etc/fstab --

PARTUUID=129fa078-01 /boot vfat noatime,noauto,nodev,nosuid,noexec 1 2
PARTUUID=129fa078-02 / ext4 noatime 0 1
/var/cache/swap/swap1 none swap sw 0 0
Comment 7 Joe 2024-02-06 19:58:55 UTC
Created attachment 884428 [details]
/usr/share/apr/build/libtool attached as requested

/usr/share/apr/build/libtool attached as requested
Comment 8 Mike Gilbert gentoo-dev 2024-02-06 20:01:29 UTC
(In reply to Joe from comment #7)
> Created attachment 884428 [details]
> /usr/share/apr/build/libtool attached as requested

> # Must we lock files when doing compilation?
> need_locks="yes"

Yep, this is broken.
Comment 9 Mike Gilbert gentoo-dev 2024-02-06 20:42:26 UTC
Please build dev-libs/apr with FEATURES="keepwork", and then attach this file:

/var/tmp/portage/dev-libs/apr-1.7.4-r1/work/apr-1.7.4/config.log
Comment 10 Joe 2024-02-07 14:19:03 UTC
Created attachment 884469 [details]
/var/tmp/portage/dev-libs/apr-1.7.4-r1/work/apr-1.7.4/config.log archived with "tar cvjpf config.log.tbz2 config.log"

Note: running emerge -av1 dev-libs/apr completes without error, but dev-libs/apr enters infinite loop when compiled as a dependency of www-servers/apache.  

So, trying to complete your request by running FEATURES="keepwork" emerge -av1 www-servers/apache failed --The error looks like this --
...
libtool: compile: Waiting for apr_brigade.o.lock to be removed
libtool: compile: Waiting for apr_buckets.o.lock to be removed
libtool: compile: Waiting for apr_buckets_alloc.o.lock to be removed
libtool: compile: Waiting for apr_buckets_eos.o.lock to be removed
libtool: compile: Waiting for apr_buckets_file.o.lock to be removed
...
but this did not produce the file requested...
cat: /var/tmp/portage/dev-libs/apr-1.7.4-r1/work/apr-1.7.4/config.log: No such file or directory

I'm not sure it be helpful, because the problem does not occur when compiling apr directly, but I also ran FEATURES="keepwork -distcc" emerge -av1 dev-libs/apr  --> (>>> Completed (1 of 1) dev-libs/apr-1.7.4-r1::gentoo) and I've attached /var/tmp/portage/dev-libs/apr-1.7.4-r1/work/apr-1.7.4/config.log

Note also a correction to my initial report.  The entire rootfs of this armv7a system is on one partition (only the bootfs is on another partition - kernel, bootloader configuration).  So while my work-arounds did work previously, it was not because it was moving portage_tmpdir to the rootfs partition... Currently, this error occurs when compiling www-servers/apache regardless of portage_tmpdir location
Comment 11 Mike Gilbert gentoo-dev 2024-02-07 15:27:57 UTC
I didn't realize distcc was in play at all here. That is a likely source of the problem.

You said this config.log was generated with FEATURES="-distcc", but I see many distcc calls in the log. I'm not sure we are looking at the right file.

In any case, the config.log file does contain this test result:

> configure:17213: checking if armv7a-unknown-linux-gnueabihf-gcc supports -c -o file.o
> configure:17261: result: no

That "no" is supposed to be a "yes".

I suspect distcc is causing this breakage. Given how broken distcc is, I have no interest in troubleshooting this.
Comment 12 Mike Gilbert gentoo-dev 2024-02-07 16:45:30 UTC
Just reading through the relevant configure test, it will conclude that the compiler does not support "-c -o" if the command generates any unexpected output on stderr.

It looks like you have distcc set up to log verbosely, which likely causes unexpected output on stderr.

If you can configure distcc to operate silently, I suspect this problem will be resolved.
Comment 13 Joe 2024-02-08 14:31:39 UTC
Created attachment 884567 [details]
Output of # FEATURES="keepwork" emerge -av1 dev-libs/apr-util

distcc removed entirely, the problem persists.  Also now have similar problem on another armv7 system (raspberry pi 2 b) with no distcc.  So, no distcc output on stderr or elsewhere, this most recent failure of www-servers/apache occurred during compile of dependency dev-libs/apr-util.  Trying direct-compile of apr-util, I still get the same infinite loop failure.  Output attached
Comment 14 Joe 2024-02-08 14:50:14 UTC
also looked for but could not find a residual config.log file from keepwork for in  /var/tmp/portage/dev-libs/apr-util-1.6.3/ tree...
Comment 15 Joe 2024-02-08 16:09:14 UTC
OK.  I discovered that the broken libtool referred to in Comments 3 and 8 was still in place.  (/usr/share/apr/build/libtool containing 
   "> # Must we lock files when doing compilation?
    > need_locks="yes" 
)  Which was possibly (though I don't know for certain) broken by a ***previous*** install attempt while distcc was still "on."  So, I rolled back with -- 

   emerge -avC www-servers/apache dev-libs/apr dev-libs/apr-util

Then I confirmed there was no longer a /usr/share/apr/build/libtool present on the system, and then I did a fresh apache install with --

   emerge -av1 www-servers/apache

... which completed with no error, installing in order --
   dev-libs/apr-1.7.4-r1
   dev-libs/apr-util-1.6.3
   app-admin/apache-tools-2.4.58
   www-servers/apache-2.4.58-r2

Issue resolved
Comment 16 Mike Gilbert gentoo-dev 2024-02-08 16:47:00 UTC
Closing this as a duplicate.

*** This bug has been marked as a duplicate of bug 40992 ***