Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Dec 2021 14:15:11 +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-SVKFU8xHIV@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

Dimitry Andric <dim@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dim@FreeBSD.org

--- Comment #1 from Dimitry Andric <dim@FreeBSD.org> ---
See also bug 253208, and commit
https://cgit.freebsd.org/src/commit/?id=3D889b56c8cd84c9a9f2d9e3b019c154d6f=
14d9021
.

The problem appears to be the setrlimit() call in SDCCmain.c:

/*-------------------------------------------------------------*/
/* setStackSize - set the stack size of a running sdcc process */
/*-------------------------------------------------------------*/
static void=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
setStackSize (void)
{
#if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK)
  struct rlimit rl =3D {4 * 1024 * 1024, 4 * 1024 * 1024};
  setrlimit (RLIMIT_STACK, &rl);
#endif
}

It segfaults immediately upon return from the setrlimit() syscall wrapper.

Doing:

elfctl -e +noaslrstkgap ${WRKSRC}/bin/sdcc

makes the problem go away.

--=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-SVKFU8xHIV>