From owner-freebsd-threads@FreeBSD.ORG Sat Sep 27 06:52:44 2014 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F6C02B2 for ; Sat, 27 Sep 2014 06:52:44 +0000 (UTC) Received: from friloux.me (friloux.me [195.154.7.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55EC6762 for ; Sat, 27 Sep 2014 06:52:43 +0000 (UTC) Received: from Jetdail (143.147.84.77.rev.sfr.net [77.84.147.143]) by friloux.me (Postfix) with ESMTPSA id 00F8AFF59; Sat, 27 Sep 2014 08:52:15 +0200 (CEST) Date: Sat, 27 Sep 2014 08:55:56 +0200 From: Guillaume Friloux To: Konstantin Belousov Subject: Re: Segfault from libthr.so. Message-ID: <20140927065556.GH7885@Jetdail> References: <20140926150001.GF7885@Jetdail> <20140926164306.GE8870@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MPkR1dXiUZqK+927" Content-Disposition: inline In-Reply-To: <20140926164306.GE8870@kib.kiev.ua> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 06:52:44 -0000 --MPkR1dXiUZqK+927 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 14/09/26, Konstantin Belousov wrote: > So, what is the problem, from your PoV ? > Linking libssp after libthr causes libssp constructors run before > libthr initialization, which causes the behaviour you see. The libssp > uses something which is interposed by libthr, but still not ready at > the libssp init time. Your example of linking with different order > demostrates you the right way to treat libthr. >=20 > So again, what is the problem ? Sorry to disturb you again, but i would have more access to your knowledge. I understand what you say, but in my case, it disturbs me a little. Lets take this project as example : https://github.com/gfriloux/botman As you can see, it uses an m4 macro that will force link to ssp (configure.= ac:38). Later on, deps will be declared (configure.ac:87). One of those deps is ein= a. Eina will declare -lpthread from its .pc file. And this is how i get to the state of having -lssp -lpthread. In my app, i dont directly start any thread, lower libs do. So it doesnt se= em logical to add -lpthread before declaring the deps. So should i just remove this m4 macro that seems to be use on quite some pr= ojects, so it works on BSD ? What is the best way to do it, in your opinion ? --MPkR1dXiUZqK+927 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUJl98AAoJEG/Km+Gfxp5IQA4P/A+Baryv14J9a0+aYIR81Gum xiTo+3NzLky/tLmVFXRaF0X5D01Jvy3EwqwdToVRQqNbJFYbKQgrFKnTnAcA7IfL 3W3vpUabiJ8gPoy72ZpiTKsC2UgJo/lZ+t3TNE6mnzkbhVQU3Uh08IAA0md0zwS1 M9sCENdca4PVxSlOTAaLpFcpgasDJVZj3PF/hnwoNSldx9lRt8wPm7yd3LbLFPEm gdLsZcBJcM9mHhmGC+4GaxsDDbz5SZ9py7rqYYbba2+WdPztyiUEb8db6fsFU6+e Fny60oi6akFadcRgPhZ6dXbwEc0bIeklFGB9OMY3ReuQ8Fda/D5q5MNeNPkyin2M 5/L8d/md19yOJne6tdZi0o8cyx10UflwEJVZnkRLmxHp1f9ec9d7/s1KHeBRKOhg 0i6enl2YnEK1klVK557N6BNP2zURC4QQGrvh3vtLMk7Kj0G3S6r76nrVsIy1Mvk1 IzOwb7qT9JT6bPkPBEOhMz0iZMQovUTY2RFYpzysDCC0k3i0rBjnEHKRYOqMqQOV 5Gx8quRzifTFAlAJgDNqowpdDc6wkd3awOVdsK2RkkqNsKryTOEAX+TpyxhRGVxQ yOO+pl3EY9w4wWJijAH69Vjt1hDqPggaZa+qHwu5KP0WVy9fTPjK+QprvXQDpcLH 0KPWsyP2hLH17pao/nMc =RSSZ -----END PGP SIGNATURE----- --MPkR1dXiUZqK+927--