Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Feb 2018 21:00:31 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        joris dedieu <joris.dedieu@gmail.com>
Cc:        freebsd-ports <freebsd-ports@freebsd.org>, delphij@freebsd.org
Subject:   Re: openldap-server exit on signal 6 on 11.1 (and not in 10.3)
Message-ID:  <44A57144-7582-4420-92CD-E13DCA715A8D@FreeBSD.org>
In-Reply-To: <CAPd55qB06oqxjbHtF--CFs5%2B0BtGD6TGX70sxCWexsT34GMDJw@mail.gmail.com>
References:  <CAPd55qB06oqxjbHtF--CFs5%2B0BtGD6TGX70sxCWexsT34GMDJw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_95579E3D-4592-4216-BE99-B22AEF608825
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 9 Feb 2018, at 09:33, joris dedieu <joris.dedieu@gmail.com> wrote:
>=20
> Dear porters,
>=20
> While moving from 10.3 to 11.1, I get an issue on openldap execution.
> slapd dies (pid 29087 (slapd), uid 389: exited on signal 6) on some
> complex but reproducible operations.
>=20
> We worked around this bug by returning less elements from the request.
> While my dear colleges are trying to write a script to reproduce the
> issue, I investigate system side.
>=20
>=20
> In /var/log/messages, I got slapd[4909]: stack overflow detected; =
terminated
>=20
> The only trace I get
>=20
> #0  0x0000000801f7a71a in kill () from /lib/libc.so.7
> #1  0x0000000801f7a6d0 in __stack_chk_fail () from /lib/libc.so.7
> #2  0x0000000801f7a640 in __stack_chk_fail () from /lib/libc.so.7
> #3  0x00000000004466e6 in do_modify ()
> #4  0x00000000004308d5 in connection_assign_nextid ()
> #5  0x00000000004300dd in connection_read_activate ()
> #6  0x0000000800956ffa in ldap_pvt_thread_pool_submit () from
> /usr/local/lib/libldap_r-2.4.so.2
> #7  0x0000000801c71bc5 in pthread_create () from /lib/libthr.so.3
> #8  0x0000000000000000 in ?? ()
>=20
> I suspect it's relative to -fstack-protector-strong  which is the
> default since FreeBSD 11.0. Do you think I should rebuild all the
> world this opion ?
>=20
> I also thought on fdatasync
>=20
> .if ${OSVERSION} < 1101000
> CFLAGS+=3D                -DMDB_DSYNC=3DO_SYNC -Dfdatasync=3Dfsync
> .endif
>=20
> I'm currently investigating on this changes.
>=20
> The issue disappear when slapd is compiled with debugging symbols
> (WITH_DEBUG=3DYES). As far as I understand, this only cause -g flag to
> be added to CFLAGS. Does WITH_DEBUG also disable some compiler
> optimization  ?

Yes, WITH_DEBUG unfortunately removes all -O options from the compiler
flags, making it sometimes hard to debug, if any crashes disappear. :)

Try applying the following patch to your ports tree, and rebuilding the =
port:

Index: Mk/bsd.port.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- Mk/bsd.port.mk	(revision 461038)
+++ Mk/bsd.port.mk	(working copy)
@@ -1743,7 +1743,7 @@ MAKE_ENV+=3D	DONTSTRIP=3Dyes
 STRIP_CMD=3D	${TRUE}
 .endif
 DEBUG_FLAGS?=3D	-g
-CFLAGS:=3D		${CFLAGS:N-O*:N-fno-strict*} ${DEBUG_FLAGS}
+CFLAGS:=3D		${CFLAGS} ${DEBUG_FLAGS}
 .if defined(INSTALL_TARGET)
 INSTALL_TARGET:=3D	${INSTALL_TARGET:S/^install-strip$/install/g}
 .endif

-Dimitry


--Apple-Mail=_95579E3D-4592-4216-BE99-B22AEF608825
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.2

iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWn393wAKCRCwXqMKLiCW
o/azAKCw1Ksmib006xo3D7ywzX1qT/uCdQCeLyrzSjzRQuEG109mrKxSVcnCVHg=
=HnBM
-----END PGP SIGNATURE-----

--Apple-Mail=_95579E3D-4592-4216-BE99-B22AEF608825--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44A57144-7582-4420-92CD-E13DCA715A8D>