Bug 492243 - bashdb error message and loss of control
Summary: bashdb error message and loss of control
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: bashdb
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Paulo Roma Cavalcanti
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-26 03:44 UTC by Herbert Carl Meyer
Modified: 2010-02-16 08:50 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-02-16 08:50:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Herbert Carl Meyer 2009-03-26 03:44:52 UTC
Description of problem:

bashdb error message and loss of control

Version-Release number of selected component (if applicable):
4.0.0.2

How reproducible:
100%

Steps to Reproduce:
1. load a script with bashdb script.sh
2. wait for debugger to load, display first executable line in script
3. enter any command to debugger
  
Actual results:
error message:

/usr/bin/../share/bashdb/lib/alias.sh: line 61: return: -1: invalid option
return: usage: return [n]

and script takes off, no longer under debugger control

Expected results:

debugger command executes, debugger remains in control of script

Additional info:

I checked bash to see if bashdb was in the right place with:

strings /bin/bash | grep bashdb-main.inc

response was:

/usr/share/bashdb/bashdb-main.inc

which is where the bashdb is installed.

Comment 1 Paulo Roma Cavalcanti 2009-03-26 09:33:51 UTC
Sorry, but I can not reproduce your error.

Can you point me to a location where I can download your script?

Are you running it on Fedora 9 or 10?

Comment 2 Herbert Carl Meyer 2009-03-26 13:11:19 UTC
Good morning Paulo, how is Rio ?

I am running Fedora 11, rawhide. The particular script does not matter, I get the same error with any script. 

I think it may be from a recent bash update, I just installed the bashdb rpm yesterday, and have never tried it before.

RPM tells me Bash is bash-4.0-2.fc11.i586.

I have a very simple script we wrote a while ago, fooling around with kmdl:

#!/bin/bash
# guess arch
case $MACHTYPE in
i386*)
echo "is 386"
;;
i586*)
echo "is 586"
;;
i686*)
echo "is 686"
;;
x86_64*)
echo "is 86_64"
;;
*)
echo "is mystery"
;;
esac

and results:

[hcmeyer@evilgnome bin]$ bashdb guessArch.sh
bash debugger, release 4.0-0.2

Copyright 2002, 2003, 2004, 2006, 2007, 2008 Rocky Bernstein
This is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.

(/home/hcmeyer/bin/guessArch.sh:3):
3:	case $MACHTYPE in
bashdb<0> list
/usr/bin/../share/bashdb/lib/alias.sh: line 61: return: -1: invalid option
return: usage: return [n]
is 386
Debugged program terminated normally. Use q to quit or R to restart.
bashdb<1> exit
[hcmeyer@evilgnome bin]$ 

invoking it differently:

[hcmeyer@evilgnome bin]$ bash --debugger guessArch.sh
/usr/share/bashdb/bashdb-main.inc: line 21: /usr/local/share/bashdb/dbg-pre.sh: No such file or directory
Bourne-Again Shell Debugger, release 

Copyright 2002, 2003, 2004, 2006, 2007, 2008 Rocky Bernstein
This is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.

/usr/share/bashdb/bashdb-main.inc: line 35: print: command not found
/usr/share/bashdb/bashdb-main.inc: line 36: print: command not found
/usr/share/bashdb/bashdb-main.inc: line 37: print: command not found
/usr/share/bashdb/bashdb-main.inc: line 38: print: command not found
[hcmeyer@evilgnome bin]$ 

Do I have bashdb installed improperly ?
Am I feeding it a bad command (I have not used it before) ?

Or, as I suspect, bashdb was written for an older version of bash ?

Comment 3 Paulo Roma Cavalcanti 2009-03-26 13:36:13 UTC
(In reply to comment #2)
> Good morning Paulo, how is Rio ?

Hi, Herbert

Rio is fine, and getting less hot as the Autumn has arrived.


> 
> I am running Fedora 11, rawhide. The particular script does not matter, I get
> the same error with any script. 

That is the problem, and I never built bashdb for F11.

I was waiting, since I knew there would be problems, because some building tests did not succeed.


> 
> I think it may be from a recent bash update, I just installed the bashdb rpm
> yesterday, and have never tried it before.

I am using bashdb on F10, and I was waiting F11 to settle down a bit
before trying to fix this issue. 


> 
> RPM tells me Bash is bash-4.0-2.fc11.i586.
> 
> I have a very simple script we wrote a while ago, fooling around with kmdl:
> 
> #!/bin/bash
> # guess arch
> case $MACHTYPE in
> i386*)
> echo "is 386"
> ;;
> i586*)
> echo "is 586"
> ;;
> i686*)
> echo "is 686"
> ;;
> x86_64*)
> echo "is 86_64"
> ;;
> *)
> echo "is mystery"
> ;;
> esac
> 
>

> 
> Do I have bashdb installed improperly ?
> Am I feeding it a bad command (I have not used it before) ?

Did you compile bashdb yourself using the tarball? 

> 
> Or, as I suspect, bashdb was written for an older version of bash ?  

I think so. Bashdb use is very simple (F10 - bash 3.2)

[cascavel:~/temp] bashdb mach.sh 
bash debugger, release 4.0-0.2

Copyright 2002, 2003, 2004, 2006, 2007, 2008 Rocky Bernstein
This is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.

(/home/roma/temp/mach.sh:3):
3:      case $MACHTYPE in
bashdb<0> n
(/home/roma/temp/mach.sh:14):
14:     echo "is 86_64"
bashdb<1> n
is 86_64
(/usr/bin/bashdb:160):
160:
bashdb<2> n
Debugged program terminated normally. Use q to quit or R to restart.
bashdb<3> quit

Comment 4 Herbert Carl Meyer 2009-03-26 18:45:25 UTC
Paulo: It is spring in KY, it is raining, everything is turning green.

No, I did not compile from a tarball, I grabbed an .rpm with yumex from rawhide.

Should I try to build from a .src rpm, a tarball from sourceForge, or wait a few ?

I grabbed bashdb because I am trying to 'improve' a script I wrote for indexing photos. Not urgent.

Comment 5 Herbert Carl Meyer 2009-03-28 04:20:34 UTC
This eve I pulled a bashdb .src.rpm down and tried a build.

Make ran ok, except for a missing texi2html, I think this should be in the "requires".

Make check returns:

[hcmeyer@evilgnome bashdb-4.0-0.2]$ make check
Making check in command
make[1]: Entering directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/command'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/command'
Making check in lib
make[1]: Entering directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/lib'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/lib'
Making check in doc
make[1]: Entering directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/doc'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/doc'
Making check in test
make[1]: Entering directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/test'
Making check in unit
make[2]: Entering directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/test/unit'
make  check-TESTS
make[3]: Entering directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/test/unit'
test_alias
/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2//lib/alias.sh: line 61: return: -1: invalid option
return: usage: return [n]
ASSERT:expected:<q> but was:<quit>

Ran 1 test.

FAILED (failures=1)
FAIL: test-alias.sh
test_breakpoint

Ran 1 test.

OK
PASS: test-break.sh
test_preserve_set_opts
bash debugger, release 4.0-0.2

Copyright 2002, 2003, 2004, 2006, 2007, 2008 Rocky Bernstein
This is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.


Ran 1 test.

OK
PASS: test-bashdb-trace.sh
test_columnized

Ran 1 test.

OK
PASS: test-columns.sh
test_glob_filename
test_adjust_filename
test_resolve_expand_filename

Ran 3 tests.

OK
PASS: test-file.sh
test_copies
test_defined
test_esc_dq
test_is_function
test_traced
test_onoff
test_parse_linespec
test_set_debugger_internal
test_set_q
test_split

Ran 10 tests.

OK
PASS: test-fns.sh
test_print_frame
test_frame_adjust
../../lib/frame.sh: line 34: return: -1: invalid option
return: usage: return [n]
../../lib/frame.sh: line 34: return: -1: invalid option
return: usage: return [n]
ASSERT:expected:<0> but was:<2>
ASSERT:expected:<0> but was:<2>
ASSERT:expected:<0> but was:<2>

Ran 2 tests.

FAILED (failures=3)
FAIL: test-frame.sh
test_msg
test_undefined
test_progress_show

Ran 3 tests.

OK
PASS: test-io.sh
test_expand_filename
test_do_show_version

Ran 2 tests.

OK
PASS: test-pre.sh
test_not_running

Ran 1 test.

OK
PASS: test-run.sh
test_sort

Ran 1 test.

OK
PASS: test-sort.sh
test_save_restore_IFS_PS4

Ran 1 test.

OK
PASS: test-save-restore.sh
===================================================
2 of 12 tests failed
Please report to bashdb-devel.net
===================================================
make[3]: *** [check-TESTS] Error 1
make[3]: Leaving directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/test/unit'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/test/unit'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/hcmeyer/Software/rpm/src/SOURCES/bashdb-4.0-0.2/test'
make: *** [check-recursive] Error 1
[hcmeyer@evilgnome bashdb-4.0-0.2]$ 

so I think the unit tests are failing. 

More tomorrow.

Comment 6 Paulo Roma Cavalcanti 2009-03-28 11:05:54 UTC
A took the problem upstream and
Rocky Bernstein said that the fix is in CVS.
He also scheduled a new version, supporting
bash 4.0, for April 10th.

http://sourceforge.net/forum/forum.php?thread_id=3144949&forum_id=206895

Comment 7 Herbert Carl Meyer 2009-03-28 16:27:07 UTC
Good, I will wait for Rocky's release, debug the script on another system. Thanks.

Comment 8 Paulo Roma Cavalcanti 2009-04-10 13:10:57 UTC
Could you try this new version:

http://koji.fedoraproject.org/koji/taskinfo?taskID=1289323

I still get two test failures during building, but maybe it works for you.

I would like to have some feedback before contacting the developer.

Thanks.

Comment 9 Herbert Carl Meyer 2009-04-10 19:33:17 UTC
Thanks, Paulo. I have downloaded it, I will install and test it later today.

Comment 10 Herbert Carl Meyer 2009-04-12 12:53:29 UTC
New version was installed in Sat. updates from rawhide, starts and seems to work.
I had to remove a "shopt -s -o nounset" line form the script to prevent an error message about $@ being unbound. I will actually try to use it to debug a script later.
Should I write an article about using bashdb ?

Comment 11 Paulo Roma Cavalcanti 2009-04-12 16:15:39 UTC
Hi, Herbert

I know this new bashdb still has some issues, but I do not
have bash 4 installed to test it.

Therefore, the more subsidies you can give me, the better.

You can email me directly.

Thanks.

Comment 12 Bug Zapper 2009-06-09 12:38:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


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