Cannot enable the TUI: error opening terminal [TERM=<unset>]

Bug #2012374 reported by Heinrich Schuchardt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Apport
Fix Released
Medium
Unassigned
apport (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

I try to analyze a crash report on riscv64. I am connected to the system via ssh.

sudo DEBUGINFOD_VERBOSE=1 apport-retrace --gdb --sandbox system --cache ~/.cache/apport-retrace /var/crash/_usr_bin_qemu-x86_64-static.0.crash

In the opened gdb I try to show the source:

(gdb) lay src
Cannot enable the TUI: error opening terminal [TERM=<unset>]

My expectation is that gdb shows the source layout.

gdb works fine outside apport-retrace.

# echo $TERM
xterm-256color

Revision history for this message
Benjamin Drung (bdrung) wrote :

Which apport version do you use?

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

I am on Lunar riscv64.

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

# dpkg -s apport-retrace
Source: apport
Version: 2.26.0-0ubuntu2

Revision history for this message
Heinrich Schuchardt (xypron) wrote (last edit ):

Adding variable TERM to environ is enough to solve the problem.

         apport.memdbg("before calling gdb")
+ environ['TERM'] = os.environ.get('TERM', '')
         subprocess.call(gdb_cmd, env=environ)

Now 'lay asm ' and lay 'regs' provide valuable information.

Benjamin Drung (bdrung)
Changed in apport:
milestone: none → 2.27.0
Revision history for this message
Benjamin Drung (bdrung) wrote :
Benjamin Drung (bdrung)
Changed in apport:
status: New → In Progress
Changed in apport (Ubuntu):
status: New → In Progress
Revision history for this message
Benjamin Drung (bdrung) wrote :
Changed in apport (Ubuntu):
status: In Progress → Fix Committed
Changed in apport:
status: In Progress → Fix Committed
Benjamin Drung (bdrung)
Changed in apport (Ubuntu):
importance: Undecided → Medium
Changed in apport:
importance: Undecided → Medium
Benjamin Drung (bdrung)
Changed in apport:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.26.1-0ubuntu2

---------------
apport (2.26.1-0ubuntu2) lunar; urgency=medium

  * fix(tests): Clear environment for test_run_as_real_user_no_sudo

apport (2.26.1-0ubuntu1) lunar; urgency=medium

  [ Benjamin Drung ]
  * New upstream bug-fix release.
    - SECURITY UPDATE: viewing an apport-cli crash with default pager could
      escalate privilege (LP: #2016023). Do not run sensible-pager as root
      if using sudo/pkexec.
    - Catch HTTPError in UserInterface.file_report (LP: #2008638)
    - Print proper error message if /proc/<pid> is gone (LP: #2008638)
    - Do not drop environment variables when calling GDB (LP: #2012374)
    - Fix parsing options with spaces in sources.list (LP: #1822712)
  * Disable Launchpad crash reports for 23.04 release

  [ Sebastien Bacher ]
  * Let subiquity collect the desktop installer details if available

 -- Benjamin Drung <email address hidden> Fri, 14 Apr 2023 00:17:27 +0200

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.