From commits-return-37191-archive-asf-public=cust-asf.ponee.io@nuttx.apache.org Tue Jun 8 16:31:53 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id CD2B818060E for ; Tue, 8 Jun 2021 18:31:53 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id 17D3C3EBC9 for ; Tue, 8 Jun 2021 16:31:53 +0000 (UTC) Received: (qmail 42455 invoked by uid 500); 8 Jun 2021 16:31:53 -0000 Mailing-List: contact commits-help@nuttx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nuttx.apache.org Delivered-To: mailing list commits@nuttx.apache.org Received: (qmail 42446 invoked by uid 99); 8 Jun 2021 16:31:52 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2021 16:31:52 +0000 From: =?utf-8?q?GitBox?= To: commits@nuttx.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bincubator-nuttx=5D_patacongo_edited_a_comment_on_i?= =?utf-8?q?ssue_=233868=3A_Assertion_failed_at_file=3Atls/tls=5Fgetset=2Ec_l?= =?utf-8?q?ine=3A_59?= Message-ID: <162316991285.15571.15299870846339607440.asfpy@gitbox.apache.org> Date: Tue, 08 Jun 2021 16:31:52 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: patacongo edited a comment on issue #3868: URL: https://github.com/apache/incubator-nuttx/issues/3868#issuecomment-856917238 it does look like the main thread has exited or that the tg_pid is not valid for some reason. The tg_pid is set when the task group is create and is never changed until the task group is de-allocated. So until there is a wild write, I would expect the tg_pid to be valid. The more likely thing is that the main thread has exited. That is really very likely under circumstances. pthreads are not really canceled on exit() in deferred cancellation mode: They may only be marked as deleted and will continue to run until the thread calls a cancellation point. That could be some time later. Meanwhile, the main thread could exit couldn't it. Or if a pthread is waiting on a semaphore and cancelled, but the OS logic ignores the ECANCELED error, then the pthread will never exit will never exit. In either case, in these states tg_pid will be valid, but nxsched_get_tcb() will fail. Perhaps there is some kind of protection that I do not see, but I think this could happen in normal operation, couldn't it? If so, then one solution would be to remove the assertion. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org