From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#38632: 27.0.50; Emacs process name is changed permanently upon creating a named thread Date: Wed, 18 Dec 2019 18:04:53 +0100 Message-ID: References: <87bls8ojoh.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> <83y2va3efz.fsf@gnu.org> <83v9qd3a0i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="136798"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38632@debbugs.gnu.org, yantar92@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 18 18:07:21 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ihcnA-000ZPh-1h for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Dec 2019 18:07:20 +0100 Original-Received: from localhost ([::1]:57710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihcn8-0002HX-QU for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Dec 2019 12:07:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45416) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihclw-0000Sk-64 for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 12:06:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihclu-0000JR-UE for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 12:06:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37890) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihclu-0000Gp-GX for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 12:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ihclu-0006qr-8H for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 12:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Dec 2019 17:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38632 X-GNU-PR-Package: emacs Original-Received: via spool by 38632-submit@debbugs.gnu.org id=B38632.157668870526251 (code B ref 38632); Wed, 18 Dec 2019 17:06:02 +0000 Original-Received: (at 38632) by debbugs.gnu.org; 18 Dec 2019 17:05:05 +0000 Original-Received: from localhost ([127.0.0.1]:43863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ihckz-0006pL-4R for submit@debbugs.gnu.org; Wed, 18 Dec 2019 12:05:05 -0500 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:38895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ihckw-0006ol-T0 for 38632@debbugs.gnu.org; Wed, 18 Dec 2019 12:05:03 -0500 Original-Received: by mail-wr1-f52.google.com with SMTP id y17so3113475wrh.5 for <38632@debbugs.gnu.org>; Wed, 18 Dec 2019 09:05:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=KHr8kubl1Nk70vn5k+LxI4mzeyBFagxBVHGMdbqHYic=; b=CF9frTYfuMKiklD48vivv8Px95fRxo5TW9neI1nP6GMNrm4LYH4yRI8li7lBDKUk7P b7HMZrH7p7JkzB9hkVJBOn5r61LlXJOlYKUoZiDokyE3J3FneOusxJvYU5JpO0x86cNr ZvE+LWeUrOLgUbqL0RucRjQuhQrUzME6auMhguddqTphqfZBqkjCtdOMUyUziM3H3GU9 s+QcyX60WbJ0FJqrlNBF0GmQYm5FZ+e9Etu9ZbCenVa4SfEQRIcWBXFVL2DCofnymNIh EN1DIepo5Q8Lkw5X2wtKKv8ji1q9+T1+zXfc5e+Q9WvwnCCQOGDevhN69qPlEVrUScCK k1wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=KHr8kubl1Nk70vn5k+LxI4mzeyBFagxBVHGMdbqHYic=; b=Pn0dHhrQTfqZbWAIKs3O3WwCBPZxHd4wSn4fvGVwyOlsTw3OTXYTLWOlvZvWPV28TN XFt5fTaR9DOvqsmDW8xsIuB+ukZY8PKeIKM/wo/y1Q3JyGTVxbDoArgXlco69KzWeJVW gBuCkYP6+WofXE4/5o0/h/iFRrsO2NkWygE126CfGI916MI7oLBl0uoZ/0HzO1fEg+RV dyO+ucD4Fj1m5WL0C+4w3HvG/GDpRsZ+jV4L5XI4+oiaywBSOYoFwjhMIuF0go/CfOfL T5T7u6OZswoywvRf76kd19jedD5WH2vyZ7/sE7RFQWZYIIAKZr+g+MZwsfkYlViHpyn9 O0Yw== X-Gm-Message-State: APjAAAWhAVHFvPjHw3yk0dJffOwqgbT96fYVTLYCo+rlpii/wkH6aR2v ltZtqPD4idNrvA7PEYkYeFI+U2iqLBk= X-Google-Smtp-Source: APXvYqw9JpHkh1xxf5W9cuVMp9K9xfLEGTnjLZDY3x3WNWm7PHrRLiOm8+haR+qB6dwdgP1XlxlmzA== X-Received: by 2002:a5d:4dc9:: with SMTP id f9mr3696645wru.297.1576688695567; Wed, 18 Dec 2019 09:04:55 -0800 (PST) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id c5sm3114796wmb.9.2019.12.18.09.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 09:04:54 -0800 (PST) In-Reply-To: <83v9qd3a0i.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 18 Dec 2019 17:53:49 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173526 Archived-At: >>>>> On Wed, 18 Dec 2019 17:53:49 +0200, Eli Zaretskii said: Eli> AFAIU, prctl is Linux-specific, whereas pthread_setname_np is Eli> supported on other Posix platforms that provide pthreads. Also, p= rctl Eli> has another disadvantage, in that it requires you to pass the name= to Eli> the thread being created, or put it in some global. OTOH, truncat= ing Eli> a string is not exactly rocket science, we can do that ourselves Eli> before calling the API. We already use a wrapper function to call the user-supplied function, so prctl could be added there, but the wider availability of pthread_setname_np weighs in its favour. Eli> (Btw, the limitation is 16 bytes, including the terminating null, = so Eli> truncation needs to be clever about non-ASCII characters, and I wo= nder Eli> what does prctl do when 15 bytes end in the middle of a multibyte Eli> sequence.) It does exactly what you'd expect, it drops the extraneous bytes, so putting eg =C3=BC on the boundary results in a name ending in =C3=83 (#xc3). In any case, if emacs or prctl truncates, then the name as reported by 'list-threads' will be out of sync with pthread_getname_np, unless you'd want to adjust that too. Robert