https://bugzilla.redhat.com/show_bug.cgi?id=1046469
--- Comment #9 from Joe Mario jmario@redhat.com --- Here's a little more info, but likely doesn't help. (It didn't help me). But I share it anyways.
The agetty process continuously loops through calls from main (agetty.c:372) to get_logname().
(gdb) bac #0 get_logname (cp=<synthetic pointer>, tp=0x7fff062f3520, op=0x7fff062f3870) at term-utils/agetty.c:1553 #1 main (argc=<optimized out>, argv=<optimized out>) at term-utils/agetty.c:372
The line read at line 1533 is: Breakpoint 1, get_logname (cp=<synthetic pointer>, tp=0x7fff062f3520, op=0x7fff062f3870) at term-utils/agetty.c:1533 1533 if (read(STDIN_FILENO, &c, 1) < 1) {
After it completes, errno is not set, and the value stored into the variable "c" is: (gdb) p c $15 = 3 '\003'
After a bunch of checks, it gets down to the switch stmt at line 1574: 1573 /* Do erase, kill and end-of-line processing. */ 1574 switch (key) {
Unfortunately the value of "key" is optimized away.
It falls through to the "default:" case at line 1604, and then executes line 1605: 1602 case CTL('D'): 1603 exit(EXIT_SUCCESS); 1604 default: 1605 if (!isascii(ascval) || !isprint(ascval)) 1606 break;
On the call to isprint(), we get to the read() of 1 byte from __fd=0: (gdb) bac #0 0x0000000000401fd0 in read@plt () #1 0x0000000000403752 in read (__nbytes=1, __buf=0x7fff062f3510, __fd=0) at /usr/include/bits/unistd.h:44 #2 get_logname (cp=<synthetic pointer>, tp=0x7fff062f3520, op=0x7fff062f3870) at term-utils/agetty.c:1533 #3 main (argc=<optimized out>, argv=<optimized out>) at term-utils/agetty.c:372
Unfortunately, even though I'm stepping by instruction, in the optimized binary, I can't stop between the isprint() and the upper level read() at line 1533 (where we started above).
Joe