C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::thread::detach() can segfault

From: Phil Bouchard <boost_at_[hidden]>
Date: Wed, 11 Dec 2024 18:19:04 -0500
Impossible because the backtrace lists __pthread_detach() and the thread uses a reference to a global data structure.

-- 
Logo
Phil Bouchardfacebook icon
Founder & CEO
T: (819) 328-4743
E: phil_at_[hidden] | www.fornux.com
320-345 de la Gauchetière Ouest | Montréal (Qc), H2Z 0A2 Canada
BannerLe message ci-dessus, ainsi que les documents l'accompagnant, sont destinés uniquement aux personnes identifiées et peuvent contenir des informations privilégiées, confidentielles ou ne pouvant être divulguées. Si vous avez reçu ce message par erreur, veuillez le détruire.
This communication (and/or the attachments) is intended for named recipients only and may contain privileged or confidential information which is not to be disclosed. If you received this communication by mistake please destroy all copies.

On Dec 11, 2024, at 5:48 PM, Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]> wrote:

On Wednesday 11 December 2024 18:30:45 Brasilia Standard Time Phil Bouchard
via Std-Proposals wrote:
You see, under high concurrency I'm creating simple threads followed
immediately by detach(). And very rarely that call crashes.


I'm really surprised it crashes given I assumed libpthread was the most
tested library of all time.

Not the most tested, but one of (assuming we're talking about the glibc one,
not stuff like Android Bionic's).

The most likely scenario is that the "under high concurrency" you're talking
about contains a data race in your own code.

--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
 Principal Engineer - Intel DCAI Platform & System Engineering



--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-12-11 23:19:20