public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/13724] New: pthread_setname_np segfault
@ 2012-02-22 19:06 law at redhat dot com
  2012-02-23  1:32 ` [Bug nptl/13724] " yselkowitz at cygwin dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: law at redhat dot com @ 2012-02-22 19:06 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13724

             Bug #: 13724
           Summary: pthread_setname_np segfault
           Product: glibc
           Version: 2.15
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: unassigned@sourceware.org
        ReportedBy: law@redhat.com
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


pthread_setname_np can segfault if passed a NULL pointer.

#define _GNU_SOURCE
#include <pthread.h>
#include <stdio.h>
#include <string.h>

int
main(void)
{
  pthread_t thr = pthread_self ();
  int ret = pthread_setname_np (thr, NULL);
  printf ("pthread_setname_np: %s\n", strerror (ret));
  return 0;
}

The setname_np/getname_np have non-null attributes for the appropriate
arguments and one could make a case that this is ultimately a user error. 
However, given these are not performance critical routines, I believe we can
spare the cycles to do argument verification  to improve the quality of
implementation.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-26 15:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-22 19:06 [Bug nptl/13724] New: pthread_setname_np segfault law at redhat dot com
2012-02-23  1:32 ` [Bug nptl/13724] " yselkowitz at cygwin dot com
2012-02-23  3:05 ` yselkowitz at cygwin dot com
2012-02-23  7:11 ` jakub at redhat dot com
2012-02-23  7:26 ` yselkowitz at cygwin dot com
2012-02-23 10:02 ` schwab@linux-m68k.org
2013-10-08 14:56 ` neleai at seznam dot cz
2014-06-26 15:20 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).