Debian buster
bashdb release-4.4-1.0.1
bash 4.4.18-3.1
Buiding bashdb sources from https://git.code.sf.net/p/bashdb/code at release-4.4-1.0.1 checkout with:
export NOCONFIGURE=yes
/autogen.sh
/configure --with-bash-src=/home/actionmystique/src/Bash/bash-build/bash-4.4.18-3.1\ --build=x86_64-pc-linux-gnu \ --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --infodir=/usr/share/info --mandir=/usr/share/man
remake --trace
make check
leads to:
... make[4]: Entering directory '/media/actionmystique/SAMSUNG5-Shared/home/actionmystique/src/Bash/git-bashdb/test/integration' PASS: test-bug-step-subshell PASS: test-bug-set-e PASS: test-complete PASS: test-debug PASS: test-delete PASS: test-export PASS: test-file-with-spaces PASS: test-info-args FAIL: test-interrupt PASS: test-misc PASS: test-setshow SKIP: test-sig PASS: test-action PASS: test-brkpt PASS: test-bug-args PASS: test-bugI PASS: test-bugIFS PASS: test-bug-loc PASS: test-bug-source PASS: test-command PASS: test-display PASS: test-enable PASS: test-finish PASS: test-frame PASS: test-list FAIL: test-lopts PASS: test-multi PASS: test-parm PASS: test-restart PASS: test-search FAIL: test-settrace PASS: test-skip FAIL: test-sopts PASS: test-bug-break PASS: test-bug-clear PASS: test-bug-step PASS: test-subshell PASS: test-tbreak FAIL: test-trace PASS: test-watch1 PASS: test-watch2 ============================================================================ Testsuite summary for bashdb 4.4-1.0.2git ============================================================================ # TOTAL: 44 # PASS: 37 # SKIP: 1 # XFAIL: 0 # FAIL: 6 # XPASS: 0 # ERROR: 0 ============================================================================ See test/integration/test-suite.log Please report to https://sourceforge.net/p/bashdb/bugs/new/ ============================================================================
test/integration/test-suite.log is attached.
There is a type in previous bug report: release-4.4-1.0.1 checkout must be replaced by 2d1a608 checkout
I can't reproduce this on my setup. See if the below fixes this.
If not, suggest something if you are able.
This patch does not change anything, except that 1 test is skipped.
I have found this link online which may be helpful, although the context is different.
Last edit: Jean-christophe Manciot 2018-11-18
Ok. If you would like to work up a solution, I would appreciate it. Otherwise this bug can hang out for a while until someone else has the problem and wants to address it.
Actually, I did not check the status of the patch apply the first time: it turns out it seems corrupted:
Strange error message because there is no.... line 44.
The patch I applied is attached.
git: 1:2.19.1-1
Note that this bug report is related to the following erratic behavior.
Say you want to debug a script that receives piped data:
Currently, the first call to "read" around the function "xterm_cormpatible_fg_bg" in "init/term-background.sh":
Will unintendedly consume the piped data, so when the script being debugged tries to read the data it might not be available anymore.
Now, I've just tested that the patch in https://sourceforge.net/p/bashdb/bugs/58/#e212 fixes this behavior when input is received through a pipe but I'm not really sure if these calls to "read" are totally safe when receiving input from a terminal and if they could unintentionally consume input intended to be read by the script being debugged.
Last edit: Jaime Hablutzel 2020-03-28
First let me summarize what's going on before suggesting what might be done.
bashdb
is trying to be "smart" about what kind of background you got so that its terminal highlightiing will look nice. From the value ofTERM
environment variable, it thinks you are running something xterm-compatible. xterm has this thing that when you issue a funny command it will echo data, and the data piped in competes with this.One possible solution is unset
TERM
beforehand or set it to something that doesn't start "xterm" | "gnome" | "rxvt". If you care about getting the background right, that can be done by setting COLORFGBG, passing the--highlight
option tobashdb
, setting this in a .bashdbrc profile or running some commands inside bashdb.The above feel to me a little more direct than trying to make bashdb "smarter", which I think is a lost cause since I am sure people will find even more clever ways to invoke the debugger.
But what do you think?
I've tested this and it works, but asking a regular user to do this would be confusing to say the least.
To me (as a noob in terminals, bash, etc), the patch in https://sourceforge.net/p/bashdb/bugs/58/#e212 doesn't seem to be adding more "smart" logic as it seems to be just asking where the input is coming from and executing the "smart" terminal highlighting related logic only when input comes from a terminal and not from a pipe which is the expected behavior if I'm not wrong.
Ok. In commit a409bf6 I have applied the logic in the patch. The attached patch above was rejected by patch so I did it by hand, and I make mistakes. So please double check.
Last edit: Rocky Bernstein 2020-03-28