Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 939142 - dev-games/tiled-1.11.0: hangs during emerge
Summary: dev-games/tiled-1.11.0: hangs during emerge
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Andrei Sabalenka
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-09-05 19:24 UTC by Toralf Förster
Modified: 2024-09-14 18:29 UTC (History)
5 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,18.70 KB, text/plain)
2024-09-05 19:24 UTC, Toralf Förster
Details
dev-games:tiled-1.11.0:20240904-142829.log (dev-games:tiled-1.11.0:20240904-142829.log,1.71 KB, text/plain)
2024-09-05 19:24 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,115.36 KB, text/plain)
2024-09-05 19:24 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.19 KB, application/x-xz)
2024-09-05 19:24 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,16.46 KB, application/x-xz)
2024-09-05 19:24 UTC, Toralf Förster
Details
qlist-info.txt (qlist-info.txt,230.75 KB, text/plain)
2024-09-05 19:24 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,27.04 KB, application/x-xz)
2024-09-05 19:24 UTC, Toralf Förster
Details
test.c output (test.log.txt.gz,19.79 KB, application/gzip)
2024-09-12 22:17 UTC, Luke A. Guest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2024-09-05 19:24:29 UTC
this task timed out after 24h and was therefore killed at a tinderbox image.

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 23.0_desktop_plasma_systemd-20240902-061503

  UNMASKED:
    Please re-assign to toolchain@ if you get a test failure in C, C++, or Fortran code which makes no sense.
  /etc/portage/package.unmask/60gcc:<sys-devel/gcc-15.0.9999:15

  The attached etc.portage.tar.xz has all details.
  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-15 *
clang/llvm (if any):
clang version 18.1.8
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/18/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
/usr/lib/llvm/18
18.1.8
Python 3.12.5
Available Ruby profiles:
  [1]   ruby31 (with Rubygems)
  [2]   ruby32 (with Rubygems)
  [3]   ruby33 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.80.1 *
The following VMs are available for generation-2:
*)	Eclipse Temurin JDK 21.0.4_p7 [openjdk-bin-21]
2)	Eclipse Temurin JDK 8.422_p05 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8 
  [2]   openjdk-bin-21  system-vm

The Glorious Glasgow Haskell Compilation System, version 9.2.8
php cli (if any):
go version go1.23.0 linux/amd64

  HEAD of ::gentoo
commit b8d0d5df421d34424c25e4608a7969962147aa6e
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Wed Sep 4 13:49:00 2024 +0000

    2024-09-04 13:49:00 UTC

emerge -qpvO =dev-games/tiled-1.11.0
[ebuild  N    ] dev-games/tiled-1.11.0  USE="python -minimal" PYTHON_SINGLE_TARGET="python3_12 -python3_11 -python3_13"
Comment 1 Toralf Förster gentoo-dev 2024-09-05 19:24:31 UTC
Created attachment 902196 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2024-09-05 19:24:32 UTC
Created attachment 902197 [details]
dev-games:tiled-1.11.0:20240904-142829.log
Comment 3 Toralf Förster gentoo-dev 2024-09-05 19:24:33 UTC
Created attachment 902198 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2024-09-05 19:24:34 UTC
Created attachment 902199 [details]
etc.clang.tar.xz
Comment 5 Toralf Förster gentoo-dev 2024-09-05 19:24:35 UTC
Created attachment 902200 [details]
etc.portage.tar.xz
Comment 6 Toralf Förster gentoo-dev 2024-09-05 19:24:36 UTC
Created attachment 902201 [details]
qlist-info.txt
Comment 7 Toralf Förster gentoo-dev 2024-09-05 19:24:38 UTC
Created attachment 902202 [details]
temp.tar.xz
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-08 08:42:50 UTC
This came up at https://github.com/gentoo/gentoo/pull/37606#issuecomment-2254570056 where it seemed to be a hang when calling ldconfig.
Comment 9 Luke A. Guest 2024-09-08 08:49:30 UTC
build.log:

 * Package:    dev-games/tiled-1.11.0:0
 * Repository: gentoo
 * Maintainer: mechakotik@gmail.com proxy-maint@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux python_single_target_python3_12
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking tiled-1.11.0.tar.gz to /var/tmp/portage/dev-games/tiled-1.11.0/work
>>> Source unpacked in /var/tmp/portage/dev-games/tiled-1.11.0/work
>>> Preparing source in /var/tmp/portage/dev-games/tiled-1.11.0/work/tiled-1.11.0 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-games/tiled-1.11.0/work/tiled-1.11.0 ...
 * qbs setup-qt /usr/bin/qmake6 qt6
Creating profile 'qt6'.
You may want to set up toolchain information for the generated Qt profile. 
 * qbs config defaultProfile qt6
 * qbs setup-toolchains gcc gcc
Profile 'gcc' created for '/usr/bin/gcc'.
 * qbs config profiles.qt6.baseProfile gcc
 * qbs resolve --force-probe-execution qbs.installPrefix:/usr projects.Tiled.useRPaths:false projects.Tiled.installHeaders:true project.libDir:lib64 modules.cpp.cFlags:["-march=bdver2","-mtune=bdver2","-O2","-pipe"] modules.cpp.cxxFlags:["-march=bdver2","-mtune=bdver2","-O2","-pipe"] modules.cpp.linkerFlags:["-O1","--as-needed","-z","pack-relative-relocs"]
Build graph does not yet exist for configuration 'default'. Starting from scratch.
Resolving project for configuration default
Getting info about Qt at '/usr/bin/qmake6'...
Setting up Qt module 'core' for Qt located at '/usr/bin/qmake6'.
Setting up Qt module 'widgets' for Qt located at '/usr/bin/qmake6'.
Setting up Qt module 'gui' for Qt located at '/usr/bin/qmake6'.
Setting up Qt module 'plugin_support' for Qt located at '/usr/bin/qmake6'.

--

Just sits there doing nothing.

Just ran it again and it changed a bit:

Getting info about Qt at '/usr/bin/qmake6'...
Setting up Qt module 'core' for Qt located at '/usr/bin/qmake6'.
Setting up Qt module 'widgets' for Qt located at '/usr/bin/qmake6'.
Setting up Qt module 'plugin_support' for Qt located at '/usr/bin/qmake6'.
Setting up Qt module 'gui' for Qt located at '/usr/bin/qmake6'.
Setting up Qt module 'network' for Qt located at '/usr/bin/qmake6'.
Comment 10 Luke A. Guest 2024-09-08 08:52:18 UTC
qmake6 doesn't exist in the process list.

# ps -A|grep qbs
21649 pts/3    00:00:01 qbs
# xargs -0 < /proc/21649/cmdline
qbs resolve --force-probe-execution qbs.installPrefix:/usr projects.Tiled.useRPaths:false projects.Tiled.installHeaders:true project.libDir:lib64 modules.cpp.cFlags:["-march=bdver2","-mtune=bdver2","-O2","-pipe"] modules.cpp.cxxFlags:["-march=bdver2","-mtune=bdver2","-O2","-pipe"] modules.cpp.linkerFlags:["-O1","--as-needed","-z","pack-relative-relocs"]
Comment 11 Luke A. Guest 2024-09-08 08:57:20 UTC
# pstree 21649 -p
qbs(21649)─┬─QThread(21701)───ldconfig(21702)
           ├─{qbs}(21650)
           ├─{qbs}(21652)
           ├─{qbs}(21653)
           ├─{qbs}(21656)
           ├─{qbs}(21658)
           ├─{qbs}(21660)
           ├─{qbs}(21663)
           ├─{qbs}(21700)
           └─{qbs}(21703)

# xargs -0 < /proc/21703/cmdline
qbs resolve --force-probe-execution qbs.installPrefix:/usr projects.Tiled.useRPaths:false projects.Tiled.installHeaders:true project.libDir:lib64 modules.cpp.cFlags:["-march=bdver2","-mtune=bdver2","-O2","-pipe"] modules.cpp.cxxFlags:["-march=bdver2","-mtune=bdver2","-O2","-pipe"] modules.cpp.linkerFlags:["-O1","--as-needed","-z","pack-relative-relocs"]
Comment 12 Luke A. Guest 2024-09-08 09:01:12 UTC
# eix qbs
[I] dev-util/qbs
     Available versions:  (~)2.3.1^t (~)2.4.1^t {doc test}
     Installed versions:  2.4.1^t(01:25:20 08/09/24)(-doc -test)
     Homepage:            https://doc.qt.io/qbs/
     Description:         Modern build tool for software projects
Comment 13 Luke A. Guest 2024-09-08 09:12:36 UTC
I had to re-run to get the ldconfig, so the pid is different:

# xargs -0 < /proc/25662/cmdline
/usr/bin/ldconfig -vNX
Comment 14 Luke A. Guest 2024-09-08 09:35:58 UTC
Same issue with dev-util/qbs-2.3.1
Comment 15 konsolebox 2024-09-08 10:49:55 UTC
Calling ldconfig indirectly through `env` or `sh -c` in /usr/share/qbs/modules/cpp/LinuxGCC.qbs somehow fixes this.


```
--- LinuxGCC.qbs.orig	2024-09-08 18:26:29.359685612 +0800
+++ LinuxGCC.qbs	2024-09-08 18:45:17.433710426 +0800
@@ -48,7 +48,7 @@
             var paths = [];
             var ldconfig = new Process();
             try {
-                var success = ldconfig.exec("ldconfig", ["-vNX"]);
+                var success = ldconfig.exec("env", ["ldconfig", "-vNX"]);
                 if (success === -1)
                     return;
                 var line;
```
Comment 16 Andrei Sabalenka 2024-09-12 17:29:26 UTC
I am unable to reproduce this behaviour in a container. For those who experience this issue, does the following C code work well for you?

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char *argv[], char *envp[]) {
	char *args[] = {"/usr/bin/ldconfig", "-vNX", NULL};
	int exit_code = execve(args[0], args, envp);
	printf("Error %i", exit_code);
}

Compile and run it with:
gcc test.c -o test
./test
Comment 17 Luke A. Guest 2024-09-12 22:17:01 UTC
Created attachment 902807 [details]
test.c output

I get this output.
Comment 18 Luke A. Guest 2024-09-12 22:18:01 UTC
test didn't hang.
Comment 19 konsolebox 2024-09-13 13:12:23 UTC
(In reply to Andrei Sabalenka from comment #16)
> I am unable to reproduce this behaviour in a container. For those who
> experience this issue, does the following C code work well for you?
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> 
> int main(int argc, char *argv[], char *envp[]) {
> 	char *args[] = {"/usr/bin/ldconfig", "-vNX", NULL};
> 	int exit_code = execve(args[0], args, envp);
> 	printf("Error %i", exit_code);
> }
> 
> Compile and run it with:
> gcc test.c -o test
> ./test

ldconfig -vNX works well when called from src_configure directly.  But not from qbs.

Your wrapper works when it's called from LinuxGCC.qbs instead of ldconfig directly, but so does env and `sh -c`.
Comment 20 Larry the Git Cow gentoo-dev 2024-09-13 23:25:20 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b69e8549e105545ea361c27f4e8e12a73a09b78c

commit b69e8549e105545ea361c27f4e8e12a73a09b78c
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2024-09-13 23:01:01 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-09-13 23:24:32 +0000

    dev-util/qbs: scrub and describe the ldconfig patch + revbump
    
    Note that "a few people" does not include me, couldn't reproduce.
    Not the first time I couldn't reproduce a sandbox issue like
    bug #915695 which had turned out to be due to the low stack size
    used in qtbase. This may be something similar that "env" ends up
    working around somehow but, being unable to reproduce, don't plan
    to dig into this myself and will consider this fixed (better patch
    welcome if someone figures out a better fix).
    
    Closes: https://bugs.gentoo.org/939142
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-util/qbs/files/qbs-2.4.1-ldconfig.patch            | 8 ++++++--
 dev-util/qbs/{qbs-2.4.1.ebuild => qbs-2.4.1-r1.ebuild} | 0
 2 files changed, 6 insertions(+), 2 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02c65c7ba87060ba791736135ed220dee4a731d3

commit 02c65c7ba87060ba791736135ed220dee4a731d3
Author:     Andrei Sabalenka <mechakotik@gmail.com>
AuthorDate: 2024-09-13 20:45:58 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-09-13 23:20:49 +0000

    dev-util/qbs: workaround hangs when running inside sandbox
    
    Bug: https://bugs.gentoo.org/939142
    Signed-off-by: Andrei Sabalenka <mechakotik@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/38598
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-util/qbs/files/qbs-2.4.1-ldconfig.patch | 13 +++++++++++++
 dev-util/qbs/qbs-2.4.1.ebuild               |  1 +
 2 files changed, 14 insertions(+)
Comment 21 konsolebox 2024-09-14 03:02:26 UTC
Patch is wrong.

It should be `ldconfig.exec("env", ["ldconfig", "-vNX"])`. Not `ldconfig.exec("env", ["ldconfig", ["-vNX"]])`.
Comment 22 Ionen Wolkens gentoo-dev 2024-09-14 08:10:22 UTC
(In reply to konsolebox from comment #21)
> Patch is wrong.
> 
> It should be `ldconfig.exec("env", ["ldconfig", "-vNX"])`. Not
> `ldconfig.exec("env", ["ldconfig", ["-vNX"]])`.
Is it breaking something, or just wrong per se (no idea about qbs syntax and how permissive it is), if change it need to know if need to revbump again over this.

I can't tell given tiled builds fine for me regardless. I added a ldconfig wrapper script and (patch or not) it seems it never calls ldconfig -vNX at all for me. Haven't looked at logic, maybe just something different on my system that makes it think it's unneeded and that's likely why I can't reproduce any of this.
Comment 23 konsolebox 2024-09-14 12:35:58 UTC
Sorry I should have tested first.  `ldconfig.exec("env", ["ldconfig", ["-vNX"]]);` fortunately also works.  Lines are produced.

You can debug it by adding a line like `console.info("line: " + line);`.

console.debug doesn't produce anything and I don't know how to increase or decrease the log level so it also prints messages.

The syntax use however is clearly wrong as the command requires an array of strings; not an array of strings and arrays:

https://doc.qt.io/qbs/jsextension-process.html#exec

It probably just works because internally the array is flattened.
Comment 24 Larry the Git Cow gentoo-dev 2024-09-14 18:29:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69d241cac54857294a8f80419bcb4223c4e06215

commit 69d241cac54857294a8f80419bcb4223c4e06215
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2024-09-14 18:13:32 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-09-14 18:29:35 +0000

    dev-util/qbs: adjust syntax for the ldconfig patch
    
    Just to be correct, it works either way so another revbump
    is not necessary.
    
    Closes: https://bugs.gentoo.org/939142
    Thanks-to: konsolebox
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-util/qbs/files/qbs-2.4.1-ldconfig.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)