Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 941738 - dev-build/cmake: crashes when building media-libs/libjpeg-turbo on ppc
Summary: dev-build/cmake: crashes when building media-libs/libjpeg-turbo on ppc
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard: Workaround: UV_USE_IO_URING=0
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-18 04:44 UTC by Jen
Modified: 2025-03-21 14:19 UTC (History)
10 users (show)

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


Attachments
build.log, output of emerge --info, emerge -pqv (logs.tar.gz,4.74 KB, application/gzip)
2024-10-18 04:44 UTC, Jen
Details
cmake output (cmake,91 bytes, text/plain)
2024-10-18 05:12 UTC, Jen
Details
Correct cmake output (cmake_log,3.32 KB, text/plain)
2024-10-18 05:13 UTC, Jen
Details
Sandboxed cmake output (cmake_sandboxed_log,2.58 KB, text/plain)
2024-10-18 05:24 UTC, Jen
Details
Build.log building netkit-telnetd (build.log,4.86 KB, text/x-log)
2024-11-16 02:20 UTC, loganius
Details
Lack of coredump for cmake (file_941738.txt,1.27 KB, text/plain)
2024-11-16 02:37 UTC, loganius
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jen 2024-10-18 04:44:42 UTC
Created attachment 906218 [details]
build.log, output of emerge --info, emerge -pqv

Hello,

libjpeg-turbo is required to build the profile default/linux/ppc/23.0/desktop, but the package is impossible to emerge on the platform presumably due to there being no java package available.

Steps to Reproduce:
1. Install Gentoo from minimal ppc cd and stage file
2. Change to profile default/linux/ppc/23.0/desktop
3. emerge --ask media-libs/libjpeg-turbo

Logs attached to post.

Thank you
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-18 04:50:06 UTC
Your output has "(-java)" which means the java USE flag is both masked and off.

Your actual issue is:
```
-- Looking for stddef.h - found
-- Check size of size_t
/var/tmp/portage/media-libs/libjpeg-turbo-3.0.3-r1/temp/environment: line 864:    94 Aborted                 "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
 [31;01m*[0m ERROR: media-libs/libjpeg-turbo-3.0.3-r1::gentoo failed (configure phase):
 [31;01m*[0m   cmake failed
 [31;01m*[0m 
```

i.e. cmake (!) is hitting an abort and crashing.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-18 04:52:42 UTC
Does running cmake --version work?
Comment 3 Jen 2024-10-18 04:56:07 UTC
Yes, output is as follows:

cmake version 3.30.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-18 04:57:57 UTC
Can you show me the output in full if you run:

cmake -C /var/tmp/portage/media-libs/libjpeg-turbo-3.0.3-r1/work/libjpeg-turbo-3.0.3_build-.ppc/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_DEFAULT_DOCDIR=/usr/share/doc/libjpeg-turbo-3.0.3-r1 -DENABLE_STATIC=no -DWITH_JAVA=no -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/media-libs/libjpeg-turbo-3.0.3-r1/work/libjpeg-turbo-3.0.3_build-.ppc/gentoo_toolchain.cmake /var/tmp/portage/media-libs/libjpeg-turbo-3.0.3-r1/work/libjpeg-turbo-3.0.3

as the user 'portage', or 'root' if you must?
Comment 5 Jen 2024-10-18 05:11:48 UTC
Adding output of cmake to attachments now
Comment 6 Jen 2024-10-18 05:12:05 UTC
Created attachment 906220 [details]
cmake output
Comment 7 Jen 2024-10-18 05:13:06 UTC
Created attachment 906221 [details]
Correct cmake output

Apologies, that's the wrong file! Here is the requested log file.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-18 05:20:24 UTC
Could you try run it again but run 'sandbox' first in the shell?
Comment 9 Jen 2024-10-18 05:24:38 UTC
Created attachment 906222 [details]
Sandboxed cmake output

Commands run in sandbox as requested, output logs attached
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-18 11:00:38 UTC
Bah, okay. So we'll need to either enable coredumps or modify the eclass (locally) to run cmake under gdbserver.
Comment 11 Jen 2024-10-19 05:17:57 UTC
Okay. I am unsure if that would be something I'd need to do on my end, as I am unfamiliar with the process for doing that in general. I am only somewhat familiar with the build system overall. However, if there is anything I can do to assist in debugging this, I would be happy to do what I can!
Comment 12 loganius 2024-11-16 02:20:23 UTC
Created attachment 908759 [details]
Build.log building netkit-telnetd

I've also been experiencing this bug on the Wii U, which is G3 based. However, I've only been experiencing it on kernel 6.6. On kernel 4.19 (the current stable kernel for the Wii U), it works fine. I've also heard reports on discord from the maintainer of ArchPOWER (a fork of Arch for PPC) who's been experiencing the same thing on a G4, also running kernel 6.6. (I'll see if I can get them to chime in themselves.) I've attached a build log showing cmake crashing on kernel 6.6, but I've experienced cmake crashing on everything I try to build with it while using kernel 6.6.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-16 02:22:43 UTC
Could you grab a backtrace from the coredump?

It is also possible it's io-uring related. CMake uses libuv which automagically uses io-uring if possible. Does UV_USE_IO_URING=0 emerge ... work?
Comment 14 loganius 2024-11-16 02:27:35 UTC
(In reply to Sam James from comment #13)
> Could you grab a backtrace from the coredump?
> 
> It is also possible it's io-uring related. CMake uses libuv which
> automagically uses io-uring if possible. Does UV_USE_IO_URING=0 emerge ...
> work?

I don't know how to grab a backtrace from a coredump. I also don't know where the coredump is. However, as soon as my current compile job is done, I'll try building with UV_USE_IO_URING=0. (I'm currently attempting to build cmake with debugging symbols using kernel 4.19, which will probably take at least 30 mins on the Wii U cause I never figured out binpkg ._. )
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-16 02:29:45 UTC
(In reply to loganius from comment #14)
> (In reply to Sam James from comment #13)
> > Could you grab a backtrace from the coredump?
> > 
> > It is also possible it's io-uring related. CMake uses libuv which
> > automagically uses io-uring if possible. Does UV_USE_IO_URING=0 emerge ...
> > work?
> 
> I don't know how to grab a backtrace from a coredump.

If you're using systemd, it'll be accessible via 'coredumpctl' (run 'coredumpctl', look for the relevant line involving cmake, then 'coredumpctl debug PID', then 'bt' in the gdb it launches).

> I also don't know where the coredump is. 

If not using systemd, I have no idea unless you're using minicoredumper. It might be in the work directory, it might be elsewhere (check if you have some sysctl set for core_pattern?)

> However, as soon as my current compile job is done,
> I'll try building with UV_USE_IO_URING=0. (I'm currently attempting to build
> cmake with debugging symbols using kernel 4.19, which will probably take at
> least 30 mins on the Wii U cause I never figured out binpkg ._. )

Thanks!
Comment 16 loganius 2024-11-16 02:37:53 UTC
Created attachment 908760 [details]
Lack of coredump for cmake

Great news, I'm using systemd. Unfortunately, apparently it didn't actually save a coredump? I'm not sure what to make of this. Maybe it's because I rebooted since cmake last crashed? If cmake crashes with UV_USE_IO_URING=0, I'll try again. Or maybe I'm doing something wrong. I mean, I've never looked at a coredump before.
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-16 02:50:36 UTC
In /etc/security/limits.conf, try:
```
loganius             -       core            unlimited
portage         -       core            unlimited
root            -       core            unlimited
```

And in /etc/sudo.conf:
```
# Core dumps:
#   Set disable_coredump true|false
#
# By default, sudo disables core dumps while it is executing (they
# are re-enabled for the command that is run).
# To aid in debugging sudo problems, you may wish to enable core
# dumps by setting "disable_coredump" to false.
#
Set disable_coredump false
Defaults rlimit_core=default
```

There might be an extra bit you have to do as well for Portage but I don't remember (this stuff is always so flaky with PAM, it seems to work until it doesn't).
Comment 18 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-16 02:51:19 UTC
Perhaps try `ulimit -c unlimited` too.
Comment 19 loganius 2024-11-16 03:06:08 UTC
(In reply to Sam James from comment #13)
> Could you grab a backtrace from the coredump?
> 
> It is also possible it's io-uring related. CMake uses libuv which
> automagically uses io-uring if possible. Does UV_USE_IO_URING=0 emerge ...
> work?

I cancelled the cmake compile so I could reboot into kernel 6.6 cause it was taking so long and I wanted to try UV_USE_IO_URING=0. It ended up fixing it! So long as I include that var, cmake works perfectly.
Comment 20 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-16 03:24:40 UTC
Wonderful! Okay, so it's almost certainly a kernel bug.

The libuv people are quite amenable to disabling it for a specific platform, ideally for a specific range of kernels with a link to an upstream (kernel) bug report, so we can do that once you've reported it to the kernel.
Comment 21 Cursed Silicon 2024-11-16 06:45:14 UTC
Do we know if this bug impacts PPC64 (BE not LE) as well as PPC32? 

I have some old PowerPC Macs I could throw Gentoo on and provide SSH for to do kernel debugging. Though with the caveat that they're *extremely* slow (Crossdev recommended!)
Comment 22 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-16 06:52:39 UTC
I suspect it doesn't but that's an educated guess. We haven't seen it on our ppc64be AT machine in gentoo at least.
Comment 23 Jen 2024-11-17 00:56:42 UTC
I can confirm that using UV_USE_IO_URING=0 allowed me to successfully emerge the package on my hardware as well! Extremely thankful it was possible to resolve.
Comment 24 Matt Turner gentoo-dev 2024-11-29 19:14:54 UTC
Kernels v6.9.4 and v6.11.10 both exhibit this failure. I was similarly unable to get a coredump, but I'll try a bit more.
Comment 25 Nick Bowler 2024-12-09 05:47:11 UTC
I first saw this problem with cmake 3.30.2 and libuv 1.48.0.  It still occurs
with cmake 3.30.6 and libuv 1.49.2.  The abort is coming from libuv but it's
not entirely clear that there is actually a bug in libuv.

In src/unix/process.c, several system calls cause the library to simply call
abort() when they fail.  The library unfortunately doesn't do anything helpful
like print an error message before aborting.  That's not exactly nice for a
library to do but the particular failures that are happening are "impossible".
In the backtrace below, pthread_sigmask returnend an error of ENOSYS (the
error seems to be always ENOSYS, but the exact failing syscall varies), and
then libuv aborted.

There was no similar problem with cmake-3.28.0 using the same version of
libuv, although now sadly the last working cmake version is deleted from the
gentoo repo.

Every package which builds using cmake (including cmake itself) will randomly
fail (very rarely: randomly work fine) with this exact same problem.

#0  0xa77b39ac in __pthread_kill_implementation (threadid=<optimized out>, 
    signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:43
#1  0xa77b3af0 in __pthread_kill_internal (threadid=<optimized out>, 
    signo=signo@entry=6) at pthread_kill.c:78
#2  0xa77b3b08 in __GI___pthread_kill (threadid=<optimized out>, 
    signo=signo@entry=6) at pthread_kill.c:89
#3  0xa776ea90 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0xa775ad70 in __GI_abort () at abort.c:79
#5  0x001f6560 in uv__spawn_and_init_child_fork (options=<optimized out>, 
    stdio_count=<optimized out>, pipes=<optimized out>, 
    error_fd=<optimized out>, pid=<optimized out>) at src/unix/process.c:826
#6  uv__spawn_and_init_child (loop=<optimized out>, options=<optimized out>, 
    stdio_count=<optimized out>, pipes=<optimized out>, pid=<optimized out>)
    at src/unix/process.c:916
#7  uv_spawn (loop=<optimized out>, process=<optimized out>, 
    options=0xaf7fc248) at src/unix/process.c:1010
#8  0x0059ed14 in cm::uv_process_ptr::spawn (this=this@entry=0x187b364, 
    loop=..., options=..., data=data@entry=0x187b360)
    at /usr/lib/gcc/powerpc-unknown-linux-gnu/14/include/g++-v14/bits/shared_ptr_base.h:1666
#9  0x005a1b4c in cmUVProcessChain::InternalData::SpawnProcess (
    this=0x184c0f0, index=index@entry=0, config=..., first=first@entry=true, 
    last=true)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmUVProcessChain.cxx:376
#10 0x005a1cd0 in cmUVProcessChainBuilder::Start (this=this@entry=0xaf7fc318)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmUVProcessChain.cxx:173
#11 0x005888b8 in cmSystemTools::RunSingleCommand (
    command=std::vector of length 3, capacity 3 = {...}, 
    captureStdOut=<optimized out>, captureStdOut@entry=0xaf7fc4bc, 
    captureStdErr=<optimized out>, captureStdErr@entry=0xaf7fc4bc, 
    retVal=retVal@entry=0xaf7fc4f8, dir=dir@entry=0x0, 
    outputflag=<optimized out>, outputflag@entry=cmSystemTools::OUTPUT_NONE, 
    timeout=std::chrono::duration = { 0s }, 
    encoding=encoding@entry=cmProcessOutput::Auto)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmSystemTools.cxx:599
#12 0x0079f500 in cmGlobalGenerator::Build (this=this@entry=0x16aa470, 
    jobs=jobs@entry=-1, 
    bindir="/var/tmp/portage/media-libs/libjpeg-turbo-3.0.3-r1/work/libjpeg-turbo-3.0.3_build/CMakeFiles/CMakeScratch/TryCompile-TtI4yb", 
    projectName="CMAKE_TRY_COMPILE", 
    targets=std::vector of length 1, capacity 1 = {...}, ostr=..., 
    makeCommandCSTR="", config="", buildOptions=..., 
    verbose=verbose@entry=true, timeout=std::chrono::duration = { 0s }, 
    outputflag=outputflag@entry=cmSystemTools::OUTPUT_NONE, 
    nativeOptions=std::vector of length 0, capacity 0)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmGlobalGenerator.cxx:2264
#13 0x007a603c in cmGlobalGenerator::TryCompile (this=0x16aa470, 
    jobs=jobs@entry=-1, 
    srcdir="/var/tmp/portage/media-libs/libjpeg-turbo-3.0.3-r1/work/libjpeg-turbo-3.0.3_build/CMakeFiles/CMakeScratch/TryCompile-TtI4yb", 
    bindir="/var/tmp/portage/media-libs/libjpeg-turbo-3.0.3-r1/work/libjpeg-turbo-3.0.3_build/CMakeFiles/CMakeScratch/TryCompile-TtI4yb", 
    projectName="CMAKE_TRY_COMPILE", target="cmTC_8b86d", 
    fast=fast@entry=true, output="", mf=mf@entry=0x16b16c0)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmGlobalGenerator.cxx:2149
#14 0x00538fbc in cmMakefile::TryCompile (this=0x16b16c0, 
    srcdir="/var/tmp/portage/media-libs/libjpeg-turbo-3.0.3-r1/work/libjpeg-turbo-3.0.3_build/CMakeFiles/CMakeScratch/TryCompile-TtI4yb", 
    bindir="/var/tmp/portage/media-libs/libjpeg-turbo-3.0.3-r1/work/libjpeg-turbo-3.0.3_build/CMakeFiles/CMakeScratch/TryCompile-TtI4yb", 
    projectName="CMAKE_TRY_COMPILE", targetName="cmTC_8b86d", 
    fast=<optimized out>, jobs=jobs@entry=-1, 
    cmakeArgs=cmakeArgs@entry=0xaf7fdb40, output="")
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmMakefile.cxx:3873
#15 0x0081e49c in cmCoreTryCompile::TryCompileCode (
    this=this@entry=0xaf7fdd8c, arguments=..., targetType=<optimized out>, 
    targetType@entry=cmStateEnums::EXECUTABLE)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmCoreTryCompile.cxx:1276
#16 0x0065aa50 in cmTryCompileCommand (
    args=std::vector of length 11, capacity 14 = {...}, status=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmTryCompileCommand.cxx:83
#17 0x00575740 in InvokeBuiltinCommand (
    command=0x65a7d8 <cmTryCompileCommand(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, cmExecutionStatus&)>, args=..., status=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmState.cxx:424
#18 0x005431c4 in std::function<bool (std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&)>::operator()(std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&) const (this=0xaf7fdf58, __args#0=..., __args#1=...)
    at /usr/lib/gcc/powerpc-unknown-linux-gnu/14/include/g++-v14/bits/std_function.h:591
#19 cmMakefile::ExecuteCommand (this=this@entry=0x16b16c0, lff=..., 
    status=..., deferId=std::optional [no contained value])
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmMakefile.cxx:518
#20 0x0061831c in cmIfFunctionBlocker::Replay (this=0x18b2660, functions=..., 
    inStatus=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmIfCommand.cxx:151
#21 0x00613414 in cmFunctionBlocker::IsFunctionBlocked (this=0x18b2660, 
    lff=..., status=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmFunctionBlocker.cxx:52
#22 0x00533500 in cmMakefile::IsFunctionBlocked (this=this@entry=0x16b16c0, 
    lff=..., status=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmMakefile.cxx:3398
#23 0x00543018 in cmMakefile::ExecuteCommand (this=this@entry=0x16b16c0, 
    lff=..., status=..., deferId=std::optional [no contained value])
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmMakefile.cxx:485
#24 0x00614044 in (anonymous namespace)::cmFunctionHelperCommand::operator() (
    this=<optimized out>, args=..., inStatus=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmFunctionCommand.cxx:116
#25 0x005431c4 in std::function<bool (std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&)>::operator()(std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&) const (this=0xaf7fe5b8, __args#0=..., __args#1=...)
    at /usr/lib/gcc/powerpc-unknown-linux-gnu/14/include/g++-v14/bits/std_function.h:591
#26 cmMakefile::ExecuteCommand (this=this@entry=0x16b16c0, lff=..., 
    status=..., deferId=std::optional [no contained value])
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmMakefile.cxx:518
#27 0x00637e0c in (anonymous namespace)::cmMacroHelperCommand::operator() (
    this=<optimized out>, args=..., inStatus=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmMacroCommand.cxx:123
#28 0x005431c4 in std::function<bool (std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&)>::operator()(std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&) const (this=0xaf7fe8c8, __args#0=..., __args#1=...)
    at /usr/lib/gcc/powerpc-unknown-linux-gnu/14/include/g++-v14/bits/std_function.h:591
#29 cmMakefile::ExecuteCommand (this=this@entry=0x16b16c0, lff=..., 
    status=..., deferId=std::optional [no contained value])
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmMakefile.cxx:518
#30 0x006100a4 in (anonymous namespace)::cmForEachFunctionBlocker::invoke (
    functions=std::vector of length 5, capacity 8 = {...}, inStatus=..., 
    mf=..., this=0x189d600)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmForEachCommand.cxx:262
#31 0x00611968 in (anonymous namespace)::cmForEachFunctionBlocker::ReplayItems
    (this=0x189d600, functions=std::vector of length 5, capacity 8 = {...}, 
    inStatus=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmForEachCommand.cxx:131
#32 (anonymous namespace)::cmForEachFunctionBlocker::Replay (this=0x189d600, 
    functions=std::vector of length 5, capacity 8 = {...}, inStatus=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmForEachCommand.cxx:105
#33 0x00613414 in cmFunctionBlocker::IsFunctionBlocked (this=0x189d600, 
    lff=..., status=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmFunctionBlocker.cxx:52
#34 0x00533500 in cmMakefile::IsFunctionBlocked (this=this@entry=0x16b16c0, 
    lff=..., status=...)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmMakefile.cxx:3398
#35 0x00543018 in cmMakefile::ExecuteCommand (this=this@entry=0x16b16c0, 
    lff=..., status=..., deferId=std::optional [no contained value])
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmMakefile.cxx:485
#36 0x00543574 in cmMakefile::RunListFile (this=this@entry=0x16b16c0, 
    listFile=..., 
    filenametoread="/var/tmp/portage/media-libs/libjpeg-turbo-3.0.3-r1/work/libjpeg-turbo-3.0.3/CMakeLists.txt", defer=0x16aa3f0)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmMakefile.cxx:903
#37 0x00544910 in cmMakefile::Configure (this=this@entry=0x16b16c0)
    at /usr/lib/gcc/powerpc-unknown-linux-gnu/14/include/g++-v14/bits/unique_ptr.h:193
#38 0x007a67a0 in cmGlobalGenerator::Configure (this=0x16aa470)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmGlobalGenerator.cxx:1384
#39 0x005b3d80 in cmake::ActualConfigure (this=this@entry=0xaf7ff7c8)
    at /usr/lib/gcc/powerpc-unknown-linux-gnu/14/include/g++-v14/bits/unique_ptr.h:193
#40 0x005b4e00 in cmake::Configure (this=this@entry=0xaf7ff7c8)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmake.cxx:2362
#41 0x005be404 in cmake::Run (this=this@entry=0xaf7ff7c8, 
    args=std::vector of length 12, capacity 16 = {...}, 
    noconfigure=<optimized out>)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmake.cxx:2868
#42 0x004f2340 in (anonymous namespace)::do_cmake (ac=ac@entry=12, 
    av=av@entry=0x169f6e0)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmakemain.cxx:366
#43 0x004d6928 in main (ac=12, av=0x169f6e0)
    at /usr/src/debug/dev-build/cmake-3.30.6/cmake-3.30.6/Source/cmakemain.cxx:1075
Comment 26 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-09 05:50:06 UTC
(In reply to Nick Bowler from comment #25)
> There was no similar problem with cmake-3.28.0 using the same version of
> libuv, although now sadly the last working cmake version is deleted from the
> gentoo repo.

If cmake-3.28.0 was the last OK version, I'll bring it back. If a later point release worked, if you could identify that, I'd prefer to bring that version back instead. Let me know -- thanks.
Comment 27 Nick Bowler 2024-12-09 05:56:53 UTC
(In reply to Sam James from comment #26)
> (In reply to Nick Bowler from comment #25)
> > There was no similar problem with cmake-3.28.0 using the same version of
> > libuv, although now sadly the last working cmake version is deleted from the
> > gentoo repo.
> 
> If cmake-3.28.0 was the last OK version, I'll bring it back. If a later
> point release worked, if you could identify that, I'd prefer to bring that
> version back instead. Let me know -- thanks.

Sorry this was a typo, I meant 3.28.5.

The problem was first noticed on stable upgrade from 3.28.5 -> 3.30.2.  3.29.7 was never stable on ppc so I have not tried it.

Fun fact: this bug prevents downgrading cmake.  Have to do a complete uninstall and reinstall.
Comment 28 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-09 05:59:27 UTC
(In reply to Nick Bowler from comment #27)
> (In reply to Sam James from comment #26)
> > (In reply to Nick Bowler from comment #25)
> > > There was no similar problem with cmake-3.28.0 using the same version of
> > > libuv, although now sadly the last working cmake version is deleted from the
> > > gentoo repo.
> > 
> > If cmake-3.28.0 was the last OK version, I'll bring it back. If a later
> > point release worked, if you could identify that, I'd prefer to bring that
> > version back instead. Let me know -- thanks.
> 
> Sorry this was a typo, I meant 3.28.5.
> 

OK, thanks. I'll just bring that back and mask newer for ppc32 for now (which should also avoid anyone accidentally cleaning it up).

> 
> Fun fact: this bug prevents downgrading cmake.  Have to do a complete
> uninstall and reinstall.

This is because of this pesky snippet:
        if ! has_version -b \>=${CATEGORY}/${PN}-3.13 || ! cmake --version &>/dev/null ; then
                CMAKE_BINARY="${S}/Bootstrap.cmk/cmake"
                cmake_src_bootstrap
        fi

The check it does (--version) really isn't sufficient to figure out if the existing CMake is good enough or not. We should at the very least add a I_KNOW_WHAT_I_AM_DOING-style variable to override it.
Comment 29 Larry the Git Cow gentoo-dev 2024-12-10 05:55:10 UTC
The bug has been referenced in the following commit(s):

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

commit 5246b8278d7432e6cf2e313e598b9ea63ed814d6
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-12-10 05:54:42 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-10 05:54:42 +0000

    profiles/arch/powerpc/ppc32: mask >=dev-build/cmake-3.29
    
    Bug: https://bugs.gentoo.org/941738
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/arch/powerpc/ppc32/package.mask | 4 ++++
 1 file changed, 4 insertions(+)

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

commit f4641d2b21f0372bd185e16c88fed287983dd4e7
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-12-10 05:53:32 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-10 05:53:32 +0000

    dev-build/cmake: restore 3.28.5
    
    This is the last version that seems to work okay on ppc32 with liburing
    at least on some kernels.
    
    Bug: https://bugs.gentoo.org/941738
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-build/cmake/Manifest            |   4 +
 dev-build/cmake/cmake-3.28.5.ebuild | 280 ++++++++++++++++++++++++++++++++++++
 2 files changed, 284 insertions(+)
Comment 30 Larry the Git Cow gentoo-dev 2025-03-21 14:19:37 UTC
The bug has been referenced in the following commit(s):

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

commit 2483da44c7d2c658bcae987445c41a8620f4de5d
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2025-03-21 14:18:42 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2025-03-21 14:18:42 +0000

    dev-build/cmake: Re-add 3.28.5 for ppc only
    
    Bug: https://bugs.gentoo.org/941738
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 dev-build/cmake/Manifest            |   4 +
 dev-build/cmake/cmake-3.28.5.ebuild | 275 ++++++++++++++++++++++++++++++++++++
 2 files changed, 279 insertions(+)