Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
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:
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?
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.
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.
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