https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86022

            Bug ID: 86022
           Summary: TCB size calculated in ThreadDescriptorSize() is wrong
                    for glibc-2.14
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: b7.10110111 at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

In ThreadDescriptorSize(), I currently see:

      else if (minor <= 13)
        val = FIRST_32_SECOND_64(1168, 2304);
      else
        val = FIRST_32_SECOND_64(1216, 2304);

This leads to assertion failure on glibc-2.14, with the same message as in bug
60038. Actual values for glibc 2.14 are the same as for 2.13: 1168 for i386 and
2304 for x86_64.

I checked this by appending the following to glibc-2.14.1/nptl/descr.h:

typedef int TCB_SIZE_2304[sizeof(struct pthread)==2304 ? -1 : 1];
typedef int TCB_SIZE_1168[sizeof(struct pthread)==1168 ? -1 : 1];

and getting corresponding error when compiling glibc on a 32-bit and on a
64-bit x86 Kubuntu machines.


I suppose the fix should be to change "minor <= 13" to "minor <= 14".

Reply via email to