Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Dec 2021 14:45:04 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 260303] lang/sdcc: seg fault during build (ASLR fallout)
Message-ID:  <bug-260303-7788-0N0lDgHZY2@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-260303-7788@https.bugs.freebsd.org/bugzilla/>
References:  <bug-260303-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260303

Dawid Gorecki <dgr@semihalf.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dgr@semihalf.com

--- Comment #2 from Dawid Gorecki <dgr@semihalf.com> ---
Yeah, this problem is caused by stack gap. The program crashes immediately
after calling setrlimit because it limits the stack to a very low value(4M).
The stack gap in FreeBSD is often larger than that, for amd64 it can be by
default as large as 15M. If the stack gap is larger than stack resource lim=
it
then you can see what happens.

The commit Dimitry linked is related to this issue. However, while we take =
into
account the size of the stack gap when calculating stack limit, we only do =
so
for rlim_cur, rlim_max acts as a hard limit, which is not adjusted. The only
way to fix this issue currently is by either disabling the stack gap or by
setting rlim_max to a larger value. 20M should be enough. In that situation
rlim_cur would automatically adjust itself to 4M + stack_gap.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-260303-7788-0N0lDgHZY2>