public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/13515] New: pthread_getname_np(th_id, ...) return weird result when called by another thread than [th_id]
@ 2011-12-18  9:48 misterwallas at yahoo dot fr
  2011-12-22  0:27 ` [Bug libc/13515] " drepper.fsp at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: misterwallas at yahoo dot fr @ 2011-12-18  9:48 UTC (permalink / raw)
  To: glibc-bugs

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

             Bug #: 13515
           Summary: pthread_getname_np(th_id, ...) return weird result
                    when called by another thread than [th_id]
           Product: glibc
           Version: 2.13
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: misterwallas@yahoo.fr
    Classification: Unclassified


Created attachment 6116
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6116
[pthread_getname_np] test program

When pthread_getname_np(th_id, ...) is called from the thread [th_id] the
result is fine. When called from another thread the result is "right padded" by
weird characters (often '\n' but others in general).

Find a simple test program in attachement.

Regards

-- 
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] 4+ messages in thread

* [Bug libc/13515] pthread_getname_np(th_id, ...) return weird result when called by another thread than [th_id]
  2011-12-18  9:48 [Bug libc/13515] New: pthread_getname_np(th_id, ...) return weird result when called by another thread than [th_id] misterwallas at yahoo dot fr
@ 2011-12-22  0:27 ` drepper.fsp at gmail dot com
  2011-12-22 10:06 ` misterwallas at yahoo dot fr
  2014-06-27 11:28 ` fweimer at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-12-22  0:27 UTC (permalink / raw)
  To: glibc-bugs

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

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-12-22 00:27:00 UTC ---
I checked in a patch.

-- 
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] 4+ messages in thread

* [Bug libc/13515] pthread_getname_np(th_id, ...) return weird result when called by another thread than [th_id]
  2011-12-18  9:48 [Bug libc/13515] New: pthread_getname_np(th_id, ...) return weird result when called by another thread than [th_id] misterwallas at yahoo dot fr
  2011-12-22  0:27 ` [Bug libc/13515] " drepper.fsp at gmail dot com
@ 2011-12-22 10:06 ` misterwallas at yahoo dot fr
  2014-06-27 11:28 ` fweimer at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: misterwallas at yahoo dot fr @ 2011-12-22 10:06 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from misterwallas at yahoo dot fr 2011-12-22 10:05:59 UTC ---
Hi Ulrich,

Thanks for the patch.

Just few questions - I may be wrong because I could not find any documentation
on the [read_not_cancel] function.

My questions:

1) In the case of [read_not_cancel] return zero (n == 0) would the statement
buf[n - 1] = '\0' cause an access violation?

2) It seems that the problem is that [read_not_cancel] return an "unwanted"
'\n' also could it be another "unwanted" char?

Anyway, thanks again.

==================================================================
   ssize_t n = TEMP_FAILURE_RETRY (read_not_cancel (fd, buf, len));
   if (n < 0)
     res = errno;
+  else
+    {
+      if (buf[n - 1] == '\n')
+       buf[n - 1] = '\0';
+      else if (n == len)
+       res = ERANGE;
+      else
+       buf[n] = '\0';
+    }

   close_not_cancel_no_status (fd);
==================================================================

-- 
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] 4+ messages in thread

* [Bug libc/13515] pthread_getname_np(th_id, ...) return weird result when called by another thread than [th_id]
  2011-12-18  9:48 [Bug libc/13515] New: pthread_getname_np(th_id, ...) return weird result when called by another thread than [th_id] misterwallas at yahoo dot fr
  2011-12-22  0:27 ` [Bug libc/13515] " drepper.fsp at gmail dot com
  2011-12-22 10:06 ` misterwallas at yahoo dot fr
@ 2014-06-27 11:28 ` fweimer at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2014-06-27 11:28 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=13515

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2014-06-27 11:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-18  9:48 [Bug libc/13515] New: pthread_getname_np(th_id, ...) return weird result when called by another thread than [th_id] misterwallas at yahoo dot fr
2011-12-22  0:27 ` [Bug libc/13515] " drepper.fsp at gmail dot com
2011-12-22 10:06 ` misterwallas at yahoo dot fr
2014-06-27 11:28 ` 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).