[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #46502] make SEGV due to isatty() ttyname() bug in docker container
From: |
anonymous |
Subject: |
[bug #46502] make SEGV due to isatty() ttyname() bug in docker container |
Date: |
Mon, 23 Nov 2015 16:53:30 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?46502>
Summary: make SEGV due to isatty() ttyname() bug in docker
container
Project: make
Submitted by: None
Submitted on: Mon 23 Nov 2015 04:53:29 PM UTC
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: 4.1
Operating System: POSIX-Based
Fixed Release: None
Triage Status: None
_______________________________________________________
Details:
A bug in docker has uncovered what I consider to be a bug in make. If you run
make inside an exec'd shell (docker exec -ti "testmake" /bin/bash) it will
SEGV because isatty(fileno(stdout)) returns 1 but ttyname(fileno(stdout))
returns NULL.
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
#1 0x00007ffff789982e in __GI___strdup (s=0x0) at strdup.c:41
#2 0x0000000000417b19 in xstrdup (address@hidden) at
/root/workspace/dev_tools/stage1/source/make-4.1/misc.c:259
#3 0x000000000042274c in define_variable_in_set (address@hidden
"MAKE_TERMOUT", address@hidden, value=0x0,
address@hidden, address@hidden,
address@hidden <global_variable_set>, address@hidden)
at /root/workspace/dev_tools/stage1/source/make-4.1/variable.c:243
#4 0x0000000000406ac0 in main (argc=<optimized out>, argv=<optimized out>,
envp=0x7fffffffe718)
at /root/workspace/dev_tools/stage1/source/make-4.1/main.c:1404
The following code in main.c should check the return value of TTYNAME (which
according to man pages can return NULL as an exception condition) instead of
blindly passing the pointer:
main.c:1401
#ifdef HAVE_ISATTY
if (isatty (fileno (stdout)))
if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMOUT")))
define_variable_cname ("MAKE_TERMOUT", TTYNAME (fileno (stdout)),
o_default, 0)->export = v_export;
if (isatty (fileno (stderr)))
if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMERR")))
define_variable_cname ("MAKE_TERMERR", TTYNAME (fileno (stderr)),
o_default, 0)->export = v_export;
#endif
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?46502>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug #46502] make SEGV due to isatty() ttyname() bug in docker container,
anonymous <=