Bug 1951905

Summary: pkttyagent dumps core when user hits Ctrl-D
Product: Red Hat Enterprise Linux 7 Reporter: Renaud Métrich <rmetrich>
Component: polkitAssignee: Jan Rybar <jrybar>
Status: CLOSED MIGRATED QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 7.9CC: tpopela
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-21 10:05:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Renaud Métrich 2021-04-21 07:22:20 UTC
Description of problem:

When the user hits Ctrl-D, pkttyagent gets a SIGTRAP and dumps core.
See also BZ #1898038 on RHEL8.

We can see pkttyagent send a "Got unexpected " message as "g_error()" level:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
286       else if (c == EOF)
287         {
288           tcsetattr (fileno (listener->tty), TCSAFLUSH, &ots);
289           g_error ("Got unexpected EOF while reading from controlling terminal.");
290           abort ();
291           break;
292         }
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

This ends up being a fatal error for glib2:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
 557 static void
 558 _g_log_abort (gboolean breakpoint)
 559 {
 560   gboolean debugger_present;
 :
 575   /* Assume GDB is attached. */
 576   debugger_present = TRUE;
 577 #endif /* !G_OS_WIN32 */
 578 
 579   if (debugger_present && breakpoint)
 580     G_BREAKPOINT ();
 581   else
 582     g_abort ();
 583 }
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Since "debugger_present" in glib2 is always set to TRUE, this causes a SIGTRAP to be generated, which dumps core.


pkttyagent backtrace:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
#0  _g_log_abort (breakpoint=1) at gmessages.c:583
#1  0x00007f69294ecb71 in g_log_default_handler (log_domain=log_domain@entry=0x0, log_level=log_level@entry=6, 
    message=message@entry=0x7f6914002930 "Got unexpected EOF while reading from controlling terminal.", 
    unused_data=unused_data@entry=0x0) at gmessages.c:3158
#2  0x00007f69294ecd61 in g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=<optimized out>, 
    args=args@entry=0x7f691fffe580) at gmessages.c:1370
#3  0x00007f69294ecfef in g_log (log_domain=log_domain@entry=0x0, log_level=log_level@entry=G_LOG_LEVEL_ERROR, 
    format=format@entry=0x7f6929a08da8 "Got unexpected EOF while reading from controlling terminal.")
    at gmessages.c:1432
#4  0x00007f6929a07acf in on_request (session=0x7f6918005300, request=<optimized out>, echo_on=<optimized out>, 
    user_data=<optimized out>) at polkitagenttextlistener.c:289
 :
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------



Version-Release number of selected component (if applicable):

glib2-2.56.1-8.el7.x86_64

How reproducible:

Always

Steps to Reproduce:
1. As a normal non-wheel user, perform a "systemctl restart rsyslog"
2. Prompt to choose a wheel user comes in, hit Ctrl-D

Actual results:

Coredump

Expected results:

No coredump

Comment 3 RHEL Program Management 2023-09-21 09:55:30 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-09-21 10:05:59 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.