50f89d
commit a6e8926f8d49a213a9abb1a61f6af964f612ab7f
50f89d
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
50f89d
Date:   Fri Aug 31 18:04:32 2018 -0700
50f89d
50f89d
    [BZ #20271] Add newlines in __libc_fatal calls.
50f89d
50f89d
diff --git a/grp/initgroups.c b/grp/initgroups.c
50f89d
index f056fbf5aa6aa14c..93e7f5814da6286d 100644
50f89d
--- a/grp/initgroups.c
50f89d
+++ b/grp/initgroups.c
50f89d
@@ -128,7 +128,7 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
50f89d
 
50f89d
       /* This is really only for debugging.  */
50f89d
       if (NSS_STATUS_TRYAGAIN > status || status > NSS_STATUS_RETURN)
50f89d
-	__libc_fatal ("illegal status in internal_getgrouplist");
50f89d
+	__libc_fatal ("Illegal status in internal_getgrouplist.\n");
50f89d
 
50f89d
       /* For compatibility reason we will continue to look for more
50f89d
 	 entries using the next service even though data has already
50f89d
diff --git a/include/stdio.h b/include/stdio.h
50f89d
index 9162d4e24717e31a..7a5c09089fc4d348 100644
50f89d
--- a/include/stdio.h
50f89d
+++ b/include/stdio.h
50f89d
@@ -98,7 +98,8 @@ enum __libc_message_action
50f89d
   do_backtrace	= 1 << 1	/* Backtrace.  */
50f89d
 };
50f89d
 
50f89d
-/* Print out MESSAGE on the error output and abort.  */
50f89d
+/* Print out MESSAGE (which should end with a newline) on the error output
50f89d
+   and abort.  */
50f89d
 extern void __libc_fatal (const char *__message)
50f89d
      __attribute__ ((__noreturn__));
50f89d
 extern void __libc_message (enum __libc_message_action action,
50f89d
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
50f89d
index 3e1105418210288e..ebf07ca82d87de7d 100644
50f89d
--- a/nptl/pthread_cond_wait.c
50f89d
+++ b/nptl/pthread_cond_wait.c
50f89d
@@ -516,7 +516,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
50f89d
 		  struct timespec rt;
50f89d
 		  if (__clock_gettime (CLOCK_MONOTONIC, &rt) != 0)
50f89d
 		    __libc_fatal ("clock_gettime does not support "
50f89d
-				  "CLOCK_MONOTONIC");
50f89d
+				  "CLOCK_MONOTONIC\n");
50f89d
 		  /* Convert the absolute timeout value to a relative
50f89d
 		     timeout.  */
50f89d
 		  rt.tv_sec = abstime->tv_sec - rt.tv_sec;
50f89d
diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c
50f89d
index 2c74951f579f4afd..4764f14a45f68e0a 100644
50f89d
--- a/nscd/initgrcache.c
50f89d
+++ b/nscd/initgrcache.c
50f89d
@@ -159,7 +159,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
50f89d
 
50f89d
       /* This is really only for debugging.  */
50f89d
       if (NSS_STATUS_TRYAGAIN > status || status > NSS_STATUS_RETURN)
50f89d
-	__libc_fatal ("illegal status in internal_getgrouplist");
50f89d
+	__libc_fatal ("Illegal status in internal_getgrouplist.\n");
50f89d
 
50f89d
       any_success |= status == NSS_STATUS_SUCCESS;
50f89d
 
50f89d
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
50f89d
index ee46f24424bc1ca2..3c48b4b85e881cdb 100644
50f89d
--- a/nss/nsswitch.c
50f89d
+++ b/nss/nsswitch.c
50f89d
@@ -235,7 +235,7 @@ __nss_next2 (service_user **ni, const char *fct_name, const char *fct2_name,
50f89d
       /* This is really only for debugging.  */
50f89d
       if (__builtin_expect (NSS_STATUS_TRYAGAIN > status
50f89d
 			    || status > NSS_STATUS_RETURN, 0))
50f89d
-	 __libc_fatal ("illegal status in __nss_next");
50f89d
+	 __libc_fatal ("Illegal status in __nss_next.\n");
50f89d
 
50f89d
        if (nss_next_action (*ni, status) == NSS_ACTION_RETURN)
50f89d
 	 return 1;
50f89d
diff --git a/sysdeps/aarch64/dl-irel.h b/sysdeps/aarch64/dl-irel.h
50f89d
index 5889ee187b7a1eaf..bef71ed0f31a6387 100644
50f89d
--- a/sysdeps/aarch64/dl-irel.h
50f89d
+++ b/sysdeps/aarch64/dl-irel.h
50f89d
@@ -47,7 +47,7 @@ elf_irela (const ElfW(Rela) *reloc)
50f89d
       *reloc_addr = value;
50f89d
     }
50f89d
   else
50f89d
-    __libc_fatal ("unexpected reloc type in static binary");
50f89d
+    __libc_fatal ("Unexpected reloc type in static binary.\n");
50f89d
 }
50f89d
 
50f89d
 #endif
50f89d
diff --git a/sysdeps/arm/dl-irel.h b/sysdeps/arm/dl-irel.h
50f89d
index a7b6456075659baf..be6eb7743eb5f08d 100644
50f89d
--- a/sysdeps/arm/dl-irel.h
50f89d
+++ b/sysdeps/arm/dl-irel.h
50f89d
@@ -46,7 +46,7 @@ elf_irel (const Elf32_Rel *reloc)
50f89d
       *reloc_addr = value;
50f89d
     }
50f89d
   else
50f89d
-    __libc_fatal ("unexpected reloc type in static binary");
50f89d
+    __libc_fatal ("Unexpected reloc type in static binary.\n");
50f89d
 }
50f89d
 
50f89d
 #endif /* dl-irel.h */
50f89d
diff --git a/sysdeps/generic/unwind-dw2.c b/sysdeps/generic/unwind-dw2.c
50f89d
index 082609b34a3f773b..724c16a7f0bf465b 100644
50f89d
--- a/sysdeps/generic/unwind-dw2.c
50f89d
+++ b/sysdeps/generic/unwind-dw2.c
50f89d
@@ -843,7 +843,7 @@ execute_cfa_program (const unsigned char *insn_ptr,
50f89d
 	    struct frame_state_reg_info *old_rs = fs->regs.prev;
50f89d
 #ifdef _LIBC
50f89d
 	    if (old_rs == NULL)
50f89d
-	      __libc_fatal ("invalid DWARF unwind data");
50f89d
+	      __libc_fatal ("Invalid DWARF unwind data.\n");
50f89d
 	    else
50f89d
 #endif
50f89d
 	      {
50f89d
diff --git a/sysdeps/i386/dl-irel.h b/sysdeps/i386/dl-irel.h
50f89d
index 55303180c7aca495..bcaf0668acf8e2f2 100644
50f89d
--- a/sysdeps/i386/dl-irel.h
50f89d
+++ b/sysdeps/i386/dl-irel.h
50f89d
@@ -45,7 +45,7 @@ elf_irel (const Elf32_Rel *reloc)
50f89d
       *reloc_addr = value;
50f89d
     }
50f89d
   else
50f89d
-    __libc_fatal ("unexpected reloc type in static binary");
50f89d
+    __libc_fatal ("Unexpected reloc type in static binary.\n");
50f89d
 }
50f89d
 
50f89d
 #endif /* dl-irel.h */
50f89d
diff --git a/sysdeps/nptl/futex-internal.h b/sysdeps/nptl/futex-internal.h
50f89d
index 1a5624789d4ab117..6fd27f0df6c27b69 100644
50f89d
--- a/sysdeps/nptl/futex-internal.h
50f89d
+++ b/sysdeps/nptl/futex-internal.h
50f89d
@@ -197,7 +197,7 @@ futex_wake (unsigned int* futex_word, int processes_to_wake, int private);
50f89d
 static __always_inline __attribute__ ((__noreturn__)) void
50f89d
 futex_fatal_error (void)
50f89d
 {
50f89d
-  __libc_fatal ("The futex facility returned an unexpected error code.");
50f89d
+  __libc_fatal ("The futex facility returned an unexpected error code.\n");
50f89d
 }
50f89d
 
50f89d
 #endif  /* futex-internal.h */
50f89d
diff --git a/sysdeps/powerpc/powerpc32/dl-irel.h b/sysdeps/powerpc/powerpc32/dl-irel.h
50f89d
index a7368b25829618cb..61d0e4cf61ec45d3 100644
50f89d
--- a/sysdeps/powerpc/powerpc32/dl-irel.h
50f89d
+++ b/sysdeps/powerpc/powerpc32/dl-irel.h
50f89d
@@ -46,7 +46,7 @@ elf_irela (const Elf32_Rela *reloc)
50f89d
       *reloc_addr = value;
50f89d
     }
50f89d
   else
50f89d
-    __libc_fatal ("unexpected reloc type in static binary");
50f89d
+    __libc_fatal ("Unexpected reloc type in static binary.\n");
50f89d
 }
50f89d
 
50f89d
 #endif /* dl-irel.h */
50f89d
diff --git a/sysdeps/powerpc/powerpc64/dl-irel.h b/sysdeps/powerpc/powerpc64/dl-irel.h
50f89d
index ab13c04358868270..2fd0ee8a86e85ba0 100644
50f89d
--- a/sysdeps/powerpc/powerpc64/dl-irel.h
50f89d
+++ b/sysdeps/powerpc/powerpc64/dl-irel.h
50f89d
@@ -57,7 +57,7 @@ elf_irela (const Elf64_Rela *reloc)
50f89d
 #endif
50f89d
     }
50f89d
   else
50f89d
-    __libc_fatal ("unexpected reloc type in static binary");
50f89d
+    __libc_fatal ("Unexpected reloc type in static binary.\n");
50f89d
 }
50f89d
 
50f89d
 #endif /* dl-irel.h */
50f89d
diff --git a/sysdeps/s390/dl-irel.h b/sysdeps/s390/dl-irel.h
50f89d
index d8ba7ba42709f45c..ecb24f0a9be0daa7 100644
50f89d
--- a/sysdeps/s390/dl-irel.h
50f89d
+++ b/sysdeps/s390/dl-irel.h
50f89d
@@ -46,7 +46,7 @@ elf_irela (const ElfW(Rela) *reloc)
50f89d
       *reloc_addr = value;
50f89d
     }
50f89d
   else
50f89d
-    __libc_fatal ("unexpected reloc type in static binary");
50f89d
+    __libc_fatal ("Unexpected reloc type in static binary.\n");
50f89d
 }
50f89d
 
50f89d
 #endif /* dl-irel.h */
50f89d
diff --git a/sysdeps/sparc/sparc32/dl-irel.h b/sysdeps/sparc/sparc32/dl-irel.h
50f89d
index ffca36864f24d1fb..cf47cda8345b1a39 100644
50f89d
--- a/sysdeps/sparc/sparc32/dl-irel.h
50f89d
+++ b/sysdeps/sparc/sparc32/dl-irel.h
50f89d
@@ -56,7 +56,7 @@ elf_irela (const Elf32_Rela *reloc)
50f89d
   else if (r_type == R_SPARC_NONE)
50f89d
     ;
50f89d
   else
50f89d
-    __libc_fatal ("unexpected reloc type in static binary");
50f89d
+    __libc_fatal ("Unexpected reloc type in static binary.\n");
50f89d
 }
50f89d
 
50f89d
 #endif /* dl-irel.h */
50f89d
diff --git a/sysdeps/sparc/sparc64/dl-irel.h b/sysdeps/sparc/sparc64/dl-irel.h
50f89d
index c5cd3057aca1baf6..446fed18365cfd13 100644
50f89d
--- a/sysdeps/sparc/sparc64/dl-irel.h
50f89d
+++ b/sysdeps/sparc/sparc64/dl-irel.h
50f89d
@@ -59,7 +59,7 @@ elf_irela (const Elf64_Rela *reloc)
50f89d
   else if (r_type == R_SPARC_NONE)
50f89d
     ;
50f89d
   else
50f89d
-    __libc_fatal ("unexpected reloc type in static binary");
50f89d
+    __libc_fatal ("Unexpected reloc type in static binary.\n");
50f89d
 }
50f89d
 
50f89d
 #endif /* dl-irel.h */
50f89d
diff --git a/sysdeps/unix/sysv/linux/netlink_assert_response.c b/sysdeps/unix/sysv/linux/netlink_assert_response.c
50f89d
index f31ccb52ffa56436..6afc3a17ced18e1c 100644
50f89d
--- a/sysdeps/unix/sysv/linux/netlink_assert_response.c
50f89d
+++ b/sysdeps/unix/sysv/linux/netlink_assert_response.c
50f89d
@@ -72,12 +72,12 @@ __netlink_assert_response (int fd, ssize_t result)
50f89d
           char message[200];
50f89d
           if (family < 0)
50f89d
             __snprintf (message, sizeof (message),
50f89d
-                        "Unexpected error %d on netlink descriptor %d",
50f89d
+                        "Unexpected error %d on netlink descriptor %d.\n",
50f89d
                         error_code, fd);
50f89d
           else
50f89d
             __snprintf (message, sizeof (message),
50f89d
                         "Unexpected error %d on netlink descriptor %d"
50f89d
-                        " (address family %d)",
50f89d
+                        " (address family %d).\n",
50f89d
                         error_code, fd, family);
50f89d
           __libc_fatal (message);
50f89d
         }
50f89d
diff --git a/sysdeps/x86_64/dl-irel.h b/sysdeps/x86_64/dl-irel.h
50f89d
index 6ecc50fb42333c19..33f100d8b1781ea7 100644
50f89d
--- a/sysdeps/x86_64/dl-irel.h
50f89d
+++ b/sysdeps/x86_64/dl-irel.h
50f89d
@@ -45,7 +45,7 @@ elf_irela (const ElfW(Rela) *reloc)
50f89d
       *reloc_addr = value;
50f89d
     }
50f89d
   else
50f89d
-    __libc_fatal ("unexpected reloc type in static binary");
50f89d
+    __libc_fatal ("Unexpected reloc type in static binary.\n");
50f89d
 }
50f89d
 
50f89d
 #endif /* dl-irel.h */