On Mon, 9 Mar 2026, Richard Biener wrote:

> I wonder if, at least for release builds, removing the limit (aka 
> RLIM_INFINITY)
> would be reasonable?  libiberty currently does
> 
>   struct rlimit rlim;
>   if (getrlimit (RLIMIT_STACK, &rlim) == 0
>       && rlim.rlim_cur != RLIM_INFINITY
>       && rlim.rlim_cur < pref
>       && (rlim.rlim_max == RLIM_INFINITY || rlim.rlim_cur < rlim.rlim_max))
>     {
>       rlim.rlim_cur = pref;
>       if (rlim.rlim_max != RLIM_INFINITY && rlim.rlim_cur > rlim.rlim_max)
>         rlim.rlim_cur = rlim.rlim_max;
> 
> so passing -1UL might work?  GCC is single-threaded and does not have
> a bound recursion depth - of course we do want to know of excesses,
> because not all platforms can raise the limit arbitrarily.

GCC also had bugs where reasonable code caused endless recursion, and this
would convert a segfault in a reasonable time to something far worse (and
we know OOM handling in Linux leaves much to be desired).

Please reconsider.

Alexander

Reply via email to