GNU bug report logs - #38632
27.0.50; Emacs process name is changed permanently upon creating a named thread

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> gmail.com>

Date: Mon, 16 Dec 2019 06:45:02 UTC

Severity: normal

Merged with 39003

Found in versions 27.0.50, 27.0.60

Fixed in version 27.1

Done: Mattias EngdegÄrd <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 38632 <at> debbugs.gnu.org, yantar92 <at> gmail.com
Subject: bug#38632: 27.0.50; Emacs process name is changed permanently upon creating a named thread
Date: Wed, 18 Dec 2019 17:53:49 +0200
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: Ihor Radchenko <yantar92 <at> gmail.com>,  38632 <at> debbugs.gnu.org
> Date: Wed, 18 Dec 2019 10:05:58 +0100
> 
>     Eli> I think, instead of calling prctl in systhread.c, we should call
>     Eli> pthread_set_name_np, and the configure-time test for prctl should be
>     Eli> replaced with a test for pthread_set_name_np.
> 
> Would it not be easier to call prctl in the context of the created
> thread? That way it deals with the name length issues for us:
> pthread_setname_np fails if strlen(name) >= 16, wherease prctl
> truncates.

AFAIU, prctl is Linux-specific, whereas pthread_setname_np is
supported on other Posix platforms that provide pthreads.  Also, prctl
has another disadvantage, in that it requires you to pass the name to
the thread being created, or put it in some global.  OTOH, truncating
a string is not exactly rocket science, we can do that ourselves
before calling the API.

(Btw, the limitation is 16 bytes, including the terminating null, so
truncation needs to be clever about non-ASCII characters, and I wonder
what does prctl do when 15 bytes end in the middle of a multibyte
sequence.)




This bug report was last modified 5 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.