Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 2020 14:04:13 +0300
From:      Lev Serebryakov <lev@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: 12-STABLE try to init thead-using libraries before threads and program crashes
Message-ID:  <e3d50e13-4cfb-5acc-c00d-434ee1873660@FreeBSD.org>
In-Reply-To: <X8ExaEliVSyArp0H@kib.kiev.ua>
References:  <f6099be9-14d3-71b5-3a54-bd875f834926@FreeBSD.org> <X8ExaEliVSyArp0H@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On 27.11.2020 20:03, Konstantin Belousov wrote:

> libthr is cleanly linked too early, it should come after all consumers.
> Anyway, try this.
> 
> diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
> index 57984ef6d0e..303386db7fe 100644
> --- a/lib/libthr/thread/thr_mutex.c
> +++ b/lib/libthr/thread/thr_mutex.c
> @@ -384,6 +384,8 @@ __Tthr_mutex_init(pthread_mutex_t * __restrict mutex,
>   	struct pthread_mutex *pmtx;
>   	int ret;
>   
> +	_thr_check_init();
> +
>   	if (mutex_attr != NULL) {
>   		ret = mutex_check_attr(*mutex_attr);
>   		if (ret != 0)
> 

  It helps!

-- 
// Lev Serebryakov



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e3d50e13-4cfb-5acc-c00d-434ee1873660>