Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 408715 - app-arch/gzip-1.4 displays *** %n in writable segment detected *** with gcc 4.6.2
Summary: app-arch/gzip-1.4 displays *** %n in writable segment detected *** with gcc 4...
Status: RESOLVED DUPLICATE of bug 257279
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-18 15:38 UTC by Hanspeter Spalinger
Modified: 2012-03-21 16:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge--info.txt,12.24 KB, text/plain)
2012-03-18 15:38 UTC, Hanspeter Spalinger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hanspeter Spalinger 2012-03-18 15:38:05 UTC
Created attachment 305795 [details]
emerge --info

I switched to gcc 4.6.2 from 4.5.3-r2 
Suddenly emerge throw "*** %n in writeable segment detected ***" at me. As I was using parallel build, I did not expect to see any message from the configure script of a package. As this mentions format string and %n I got a little scared at first. I was thinking this is some sort of security warning.
I think this should be suppressed as it confuses users (like me).

This sounds similar to Bug 257279
gzip itself builds and works fine.

This happens in the configure script while while checking if printf supports %n (while running the test app, compiling works), so the alert is correct (but it does not get into the logs at all because of the tty thing described in that bug).

-- emerge output with parallel build:
>>> Starting parallel fetch
>>> Emerging (1 of 2) app-arch/gzip-1.4
>>> Jobs: 0 of 2 complete, 1 running                Load avg: 0.36, 0.09, 0.07*** %n in writable segment detected ***
>>> Jobs: 0 of 2 complete, 1 running                Load avg: 0.41, 0.11, 0.08

-- emerge output from console with single build:
checking whether printf supports the 'F' directive... yes
checking whether printf supports the 'n' directive... *** %n in writable segment detected ***
no
checking whether printf supports the 'ls' directive... yes

-- nothing in config.log:
configure:8888: checking whether printf supports the 'n' directive
configure:8922: x86_64-pc-linux-gnu-gcc -std=gnu99 -o conftest -O2 -march=native -mtune=native -pipe  -Wl,-O1 -Wl,--as-needed conftest.c  >&5
configure:8922: $? = 0
configure:8922: ./conftest
./configure: line 2180:  3094 Aborted                 ./conftest$ac_exeext
configure:8922: $? = 134
configure: program exited with status 134
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "gzip"
| #define PACKAGE_TARNAME "gzip"
| #define PACKAGE_VERSION "1.4"
| #define PACKAGE_STRING "gzip 1.4"
| #define PACKAGE_BUGREPORT "bug-gzip@gnu.org"
| #define PACKAGE_URL ""
| #define PACKAGE "gzip"
| #define VERSION "1.4"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_FSEEKO 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define HAVE_UNISTD_H 1
| #define HAVE_CHOWN 1
| #define HAVE_CHOWN 1
| #define HAVE_FCHOWN 1
| #define HAVE_DUP2 1
| #define HAVE_FCHDIR 1
| #define HAVE_FCNTL 1
| #define HAVE_FDOPENDIR 1
| #define HAVE___FPENDING 1
| #define HAVE___FPURGE 1
| #define HAVE___FREADING 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_LSTAT 1
| #define HAVE_MBSINIT 1
| #define HAVE_MBRTOWC 1
| #define HAVE_MPROTECT 1
| #define HAVE_PIPE 1
| #define HAVE_FUTIMES 1
| #define HAVE_FUTIMESAT 1
| #define HAVE_FUTIMENS 1
| #define HAVE_UTIMENSAT 1
| #define HAVE_LUTIMES 1
| #define HAVE_ISWCNTRL 1
| #define HAVE_FCHMOD 1
| #define HAVE_SIGINTERRUPT 1
| #define HAVE_DIRENT_H 1
| #define HAVE_ERRNO_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_STDIO_EXT_H 1
| #define HAVE_GETOPT_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_MATH_H 1
| #define HAVE_SYS_MMAN_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_STRING_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_TIME_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_WCTYPE_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_MEMORY_H 1
| #define FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX 0
| #define FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR 0
| #define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
| #define HAVE_DECL_STRERROR_R 1
| #define HAVE_STRERROR_R 1
| #define STRERROR_R_CHAR_P 1
| #define PROMOTED_MODE_T mode_t
| #define HAVE_WORKING_O_NOATIME 1
| #define HAVE_WORKING_O_NOFOLLOW 1
| #define HAVE_STDINT_H_WITH_UINTMAX 1
| #define HAVE_INTTYPES_H_WITH_UINTMAX 1
| #define CHECK_PRINTF_SAFE 1
| /* end confdefs.h.  */
| 
| #include <stdio.h>
| #include <string.h>
| static char fmtstring[10];
| static char buf[100];
| int main ()
| {
|   int count = -1;
|   /* Copy the format string.  Some systems (glibc with _FORTIFY_SOURCE=2)
|      support %n in format strings in read-only memory but not in writable
|      memory.  */
|   strcpy (fmtstring, "%d %n");
|   if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
|       || strcmp (buf, "123 ") != 0
|       || count != 4)
|     return 1;
|   return 0;
| }
Comment 1 SpanKY gentoo-dev 2012-03-21 16:30:09 UTC

*** This bug has been marked as a duplicate of bug 257279 ***