Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 764506 - media-gfx/transfig spawns shells more than 1000 shell levels deep, causing emerges to fail
Summary: media-gfx/transfig spawns shells more than 1000 shell levels deep, causing em...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-08 20:10 UTC by conexe3677
Modified: 2021-04-15 06:39 UTC (History)
3 users (show)

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


Attachments
build.log of media-gfx/transfig (build.log,4.33 KB, text/x-log)
2021-01-08 23:19 UTC, conexe3677
Details
emerge --info '=media-gfx/transfig-3.2.5e-r1::gentoo' (emerge_info.txt,5.91 KB, text/plain)
2021-01-08 23:20 UTC, conexe3677
Details
Ebuild Environment File (ebuild_environment_file.txt,72.98 KB, text/plain)
2021-01-08 23:22 UTC, conexe3677
Details

Note You need to log in before you can comment on or make changes to this bug.
Description conexe3677 2021-01-08 20:10:38 UTC
The title says it all. The ebuild for media-gfx/transfig spawns multiple shells that are over 1000 shells levels deep, triggering the following error during emerge multiple times before failing:
```
/bin/sh: warning: shell level (1000) too high, resetting to 1
```
This then causes another error:
```
/var/tmp/portage/media-gfx/transfig-3.2.5e-r1/temp/gcc: fork: retry: Resource temporarily unavailable
```

This in not for lack of available memory on the computer. (I have 24GB.) I am using the default `ulimit` settings after a fresh install of gentoo:
```
-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          unlimited
-s: stack size (kbytes)             8192
-c: core file size (blocks)         0
-m: resident set size (kbytes)      unlimited
-u: processes                       31516
-n: file descriptors                1024
-l: locked-in-memory size (kbytes)  64
-v: address space (kbytes)          unlimited
-x: file locks                      unlimited
-i: pending signals                 31516
-q: bytes in POSIX msg queues       819200
-e: max nice                        0
-r: max rt priority                 0
-N 15:                              unlimited
```

Here is the full build log: https://pastebin.com/9vSfqn6U
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2021-01-08 20:20:05 UTC
Please attach build.log files to the bug. Don't use external resources to reference additional infromation because these services might become inaccessible.
Comment 2 Ionen Wolkens gentoo-dev 2021-01-08 22:14:32 UTC
Please also provide "emerge --info" output, I'd notably want this to confirm what shell /bin/sh is among other potential hints because I can't reproduce so far.
Comment 3 Ionen Wolkens gentoo-dev 2021-01-08 22:26:47 UTC
Oh, I see... emerge --info will probably show:

CC=gcc
Comment 4 conexe3677 2021-01-08 23:19:42 UTC
Created attachment 682024 [details]
build.log of media-gfx/transfig

Adding the build.log
Comment 5 conexe3677 2021-01-08 23:20:53 UTC
Created attachment 682027 [details]
emerge --info '=media-gfx/transfig-3.2.5e-r1::gentoo'

Output of emerge --info '=media-gfx/transfig-3.2.5e-r1::gentoo'
Comment 6 conexe3677 2021-01-08 23:22:13 UTC
Created attachment 682030 [details]
Ebuild Environment File

And here is the corresponding ebuild environment file.
Comment 7 Ionen Wolkens gentoo-dev 2021-01-08 23:41:27 UTC
I recommend not to set CC and CXX without a specific reason, portage will take care of setting those to the right values (e.g. should work fine if removed from make.conf).

But thanks for the report, this needs another solution or fixing so it can't call itself:
    # Create wrapper for gcc, bug #720820
    printf '#!/bin/sh\n%s ${*}\n' "$(tc-getCC)" > "${T}"/gcc
Comment 8 Ionen Wolkens gentoo-dev 2021-02-07 10:42:38 UTC
(In reply to Ionen Wolkens from comment #7)
> This needs another solution or fixing so it can't call itself
Or rather, this seems to all trace back to imake's xmkmf, I don't think packages should do their own workarounds. At best just define emake CC= and live with failing with -native-symlinks for now.

Similar bug #725200's logs notably gives an error for both ld and gcc during xmkmf. Other bug #729630 proposed to remove the ld call entirely from imake.
Comment 9 Larry the Git Cow gentoo-dev 2021-04-15 06:39:50 UTC
The bug has been closed via the following commit(s):

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

commit 4f7dcc5da0c4434b1685fa22bb6b6657ea168697
Author:     Ionen Wolkens <sudinave@gmail.com>
AuthorDate: 2021-04-14 10:08:34 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2021-04-15 06:38:53 +0000

    media-gfx/transfig: remove gcc wrapper, fix ld use
    
    Wrapper allowed it to build (while keeping ld QA notice), but would
    cause an infinite loop if users sets CC=gcc (bug #764506).
    
    Switch to the more streamlined solution that >=imake-1.0.8-r1 allows.
    
    Also swapped DEPEND with BDEPEND to put imake in the right block.
    
    Closes: https://bugs.gentoo.org/764506
    Signed-off-by: Ionen Wolkens <sudinave@gmail.com>
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 media-gfx/transfig/transfig-3.2.5e-r1.ebuild | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)