YottaDB runs in environments where the OS reports the terminal name as an empty string
Final Release Note
YottaDB runs in environments where the operating system reports that a terminal exists, and that its name is the empty string (""
). Previously, it would terminate with a Segmentation Violation (SIG-11) under such conditions. [#941 (closed)]
Description
The I/O init code assumes that isatty(fd) != 0
implies ttyname(fd) != NULL
and although the relevant documentation may be interpreted this way, it is not correct and will cause immediate crash on some systems.
This is almost certainly related to the way how Kubernetes handles terminal I/O.
How to reproduce
$ tty
not a tty
$
$ ./testtty
[0] isatty = 1, ttyname = (null)
*** err: No such device
[1] isatty = 1, ttyname = (null)
*** err: No such device
$ /opt/yottadb/current/mumps -dir
%YDB-F-KILLBYSIGSINFO1, YottaDB process 16471 has been killed by a signal 11 at address 0x00007FAAA6F17807 (vaddr 0x0000000000000000)
%YDB-F-SIGMAPERR, Signal was caused by an address not mapped to an object
$
$
$ ./ptwrap tty
/dev/pts/0
$ ./ptwrap ./testtty
[0] isatty = 1, ttyname = /dev/pts/0
[1] isatty = 1, ttyname = /dev/pts/0
$
$ ./ptwrap /opt/yottadb/current/mumps -dir
YDB>w $zyre,! h
w $zyre,! h
YottaDB r1.28 Linux x86_64
$
ptwrap
utility comes from this repo and testtty
is a custom piece of code prepared to debug this issue.
Edited by K.S. Bhaskar