Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-5772

pkttyagent dumps core when user hits Ctrl-D

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • rhel-9.5
    • rhel-7.9.z
    • polkit
    • polkit-0.117-12.el9
    • None
    • Moderate
    • Upstream
    • rhel-sst-cs-plumbers
    • ssg_core_services
    • 24
    • 25
    • 2
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • Release Note Not Required
    • None

      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

              jrybar@redhat.com Jan Rybar
              rhn-support-rmetrich Renaud Métrich
              Jan Rybar Jan Rybar
              Frantisek Sumsal Frantisek Sumsal
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: