RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1165793 - 'bash --debugger' should complain if bashdb is not installed, or else be turned off entirely
Summary: 'bash --debugger' should complain if bashdb is not installed, or else be turn...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: bash
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ondrej Oprala
QA Contact: Martin Kyral
URL:
Whiteboard:
Depends On:
Blocks: 1260568
TreeView+ depends on / blocked
 
Reported: 2014-11-19 17:46 UTC by Eric Blake
Modified: 2019-10-10 09:29 UTC (History)
3 users (show)

Fixed In Version: bash-4.2.46-19.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1260568 (view as bug list)
Environment:
Last Closed: 2015-11-19 04:39:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2144 0 normal SHIPPED_LIVE bash bug fix update 2015-11-19 08:06:34 UTC

Description Eric Blake 2014-11-19 17:46:21 UTC
Description of problem:
bash can be configured to support a --debugger option that effectively sources a hard-coded debugger script (often /usr/bin/bashdb).  RHEL does not ship bashdb (but Fedora does, and so it is feasible that EPEL might someday do likewise), but DOES configure bash to turn on the --debugger option.

If we have no intention of supporting a debugger, it might be nice to configure bash so that it rejects --debugger instead of silently ignoring it.  On the other hand, if we plan on allowing users to install their own debugger script, it would be nice if 'bash --debugger' could print an error message instead of silently behaving as if --debugger had not been specified, when the debugger script is not located.

Upstream bash currently uses the same mechanism for loading the debugger script as it does for other startup files, such as ~/.profile (look for maybe_execute_file):
http://git.savannah.gnu.org/gitweb/?p=bash.git;a=blob;f=shell.c;h=bbc8a66cc2ebb27162da8b36e87ff3d2e90e5bef;hb=ca6a2ba40c709c2b45a56e49d21d0dfc66e21974#l1385

But I have a potential downstream solution that would work in spite of the upstream code: what if we use the alternatives system.  Thus, the 'bash' package is in charge of installing a low-priority alternative that gets symlinked to /usr/bin/bashdb, and which blindly issues an error message along the lines of 'bash: debug script /usr/bin/bashdb not installed'.  Any other package, such as 'bashdb', that intends to provide a debugger would also use the alternatives system to install a higher-priority variant of the symlink.  The default install therefore behaves sanely without requiring bashdb, and the alternatives framework means that installing bashdb (whether from RHEL or third-party) then makes 'bash --debugger' magically start working.

Version-Release number of selected component (if applicable):
bash-4.1.2-29.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. echo 'echo hello' > foo
2. bash --debugger foo
3.

Actual results:
hello

Expected results:
either start an instance of a bash debugger, or error out stating that the debugger is not installed

Additional info:

Comment 2 Yaakov Selkowitz 2014-11-19 17:52:16 UTC
Does bashdb set some bash property or environment variable that could be checked in start_debugger(), the absence of which could then trigger an error message?

Comment 3 Ondrej Oprala 2014-11-20 10:06:17 UTC
I like the idea, and I agree we shouldn't just silently go along with executing the script when there's no debugger. However, I don't think we'll really benefit from it unless we try to get bashdb into EPEL as a parallel effort. This way, we'll have a neat system ready for some unspecified point in the future when someone might decide to bundle it, probably unaware of our effort with the alternatives system.

Comment 4 Eric Blake 2014-11-20 15:35:56 UTC
Does that mean we need to clone this to Fedora first, to get the alternatives system working there in both bash and bashdb?

Comment 5 Eric Blake 2014-11-22 02:35:43 UTC
See also this upstream message where I asked if bash should quit silently ignoring --debugger when the configured file does not exist.

https://lists.gnu.org/archive/html/bug-bash/2014-11/msg00137.html

Comment 6 Ondrej Oprala 2014-11-24 10:43:36 UTC
I'm glad that Chet agrees with this. I'm not sure about "fedora first", but it might be for the better. We'd test and get it working in fedora and hopefully wouldn't have to do more for future RHELs.

Comment 18 errata-xmlrpc 2015-11-19 04:39:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2144.html


Note You need to log in before you can comment on or make changes to this bug.