NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/52751: pthread_mutex_lock(3) does not return EINVAL on destroyed lock
The following reply was made to PR lib/52751; it has been noted by GNATS.
From: Kamil Rytarowski <n54%gmx.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: lib/52751: pthread_mutex_lock(3) does not return EINVAL on
destroyed lock
Date: Wed, 22 Nov 2017 14:58:50 +0100
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--6C3iN6fCuTLN67idkNc7FkOFTt2D8JNGw
Content-Type: multipart/mixed; boundary="1XqGDFsm8GqOiWTG8oNcUosulWFejCEnN";
protected-headers="v1"
From: Kamil Rytarowski <n54%gmx.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Message-ID: <c1efc603-e2cd-5d15-a341-9aa82325ab92%gmx.com@localhost>
Subject: Re: lib/52751: pthread_mutex_lock(3) does not return EINVAL on
destroyed lock
References: <pr-lib-52751%gnats.netbsd.org@localhost>
<20171122125559.16E127A1F8%mollari.NetBSD.org@localhost>
<20171122132001.1F64A7A1F0%mollari.NetBSD.org@localhost>
In-Reply-To: <20171122132001.1F64A7A1F0%mollari.NetBSD.org@localhost>
--1XqGDFsm8GqOiWTG8oNcUosulWFejCEnN
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
On 22.11.2017 14:20, Martin Husemann wrote:
> The following reply was made to PR lib/52751; it has been noted by GNAT=
S.
>=20
> From: Martin Husemann <martin%duskware.de@localhost>
> To: gnats-bugs%NetBSD.org@localhost
> Cc:=20
> Subject: Re: lib/52751: pthread_mutex_lock(3) does not return EINVAL on=
> destroyed lock
> Date: Wed, 22 Nov 2017 14:17:03 +0100
>=20
> This seems to be undefined behaviour.
> From Posix's
> =20
> pthread_mutex_destroy, pthread_mutex_init - destroy and initialize=
a mutex
> =20
> page:
> =20
> A destroyed mutex object can be reinitialized using
> pthread_mutex_init(); the results of otherwise referencing the obj=
ect
> after it has been destroyed are undefined.
> =20
> =20
> and from pthread_mutex_lock:
> =20
> If mutex does not refer to an initialized mutex object, the
> behavior of pthread_mutex_lock(), pthread_mutex_trylock(), and
> pthread_mutex_unlock() is undefined.
> =20
> =20
> Martin
> =20
>=20
Unless someone thinks it's worth to support in libpthread(3), I will
implement proper check on the TSan side. As of now, it's based on the
returned value from the function call.
Therefore, no problem on the NetBSD side.
--1XqGDFsm8GqOiWTG8oNcUosulWFejCEnN--
--6C3iN6fCuTLN67idkNc7FkOFTt2D8JNGw
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJaFYKgAAoJEEuzCOmwLnZsMSsP/iAg6i7Yj/MNPQ7Pk+2AQGxE
EGRas1b2RJz2d7wxGHP4Nx2Nh7H//DnVyxIX3YT90HHD6uGE+XRKsftRVZ1PNLrP
fRrxub3fjaAL7tw+6wbu/s16c200lhgz+uYG5/77OP4QNc/dnD4ibfnVRsY7P3wa
V7pR2nU+r8xpQhrYSsDj6iTR+WbCMIFWQ9PGB52mHLZfNJqGh6qb1sa80jEvZRSQ
ZyX0rb6ZfwMIWlENmYxfmHbTzaUcbnA0W0VMGr6TxbyvXgaET3oGcf1/n9W+04pW
sKJULvyoEcyHFIXBo9HAk9Sm3cTrszOgZdfRV5woB+Dqq1hn9iRLshVz5LyxeDJA
wCyLa/szU00xYwqD/gK5yVPPnfSq64SXTfQ7Ju+Qjh3x44kk4JPqso1q2+Jz+aiX
Y6lLAzqVfVWpTWvvBVzMJHBoh0A+lt0IRHjlVJ+wge9Hqjk0gVae4E82I4T0RBaH
CAj2OuUWjTYDNB4ELFZh6qeL0b3WIrOy7nOQ4NamrobLo3fdyRQcDDwIaq8nXx5M
2x3p5TI5Lx/a+9v5cOhzt/PxkUdfggD0Bnva75rPMCg/ZIGl+19kIhBPUlKgp+iZ
tqwVg/bpzhHQH4oIAca9WoaKY/Y+m8NjzOM2z5ZS8LVQZh88mNIMkMvWsVn707Gd
/+hWN0eNFp2Zo8eU3D62
=qmSr
-----END PGP SIGNATURE-----
--6C3iN6fCuTLN67idkNc7FkOFTt2D8JNGw--
Home |
Main Index |
Thread Index |
Old Index