Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expected integer for LINENO, got "\\${LINENO-}" #91

Open
boskamp opened this issue Jan 12, 2025 · 0 comments
Open

expected integer for LINENO, got "\\${LINENO-}" #91

boskamp opened this issue Jan 12, 2025 · 0 comments

Comments

@boskamp
Copy link

boskamp commented Jan 12, 2025

Description

Running bashcov as non-root with the following command line:

bashcov -- ./main/idmdoctor export -l admin -u http://idmui.vmware:50000 -d ~/tmp/export/

This results in the following error/stacktrace:

#<Thread:0x00005a56a42613a8 /var/lib/gems/3.0.0/gems/bashcov-3.1.3/lib/bashcov/runner.rb:63 run> terminated with exception (report_on_exception is true):
/var/lib/gems/3.0.0/gems/bashcov-3.1.3/lib/bashcov/xtrace.rb:126:in `parse_hit!': expected integer for LINENO, got "\\\\${LINENO-}" (Bashcov::XtraceError)
	from /var/lib/gems/3.0.0/gems/bashcov-3.1.3/lib/bashcov/xtrace.rb:96:in `block in read'
	from /var/lib/gems/3.0.0/gems/bashcov-3.1.3/lib/bashcov/xtrace.rb:93:in `loop'
	from /var/lib/gems/3.0.0/gems/bashcov-3.1.3/lib/bashcov/xtrace.rb:93:in `read'
	from /var/lib/gems/3.0.0/gems/bashcov-3.1.3/lib/bashcov/runner.rb:63:in `block (2 levels) in run'

The program under test continues to run and coverage reports are generated, but the resulting bashcov report content is evidently incorrect. From the program under test's MAIN function, coverage is only correct until after the first subfunction call (DO_LOAD_BOOTSTRAP). Everything following this function call is reported as uncovered, which is not plausible.

Here's a screenshot of the coverage report from MAIN:
grafik

An interesting side note is that this bug seems to depend on the program under test. In exactly the same environment, when testing a different program, e.g.

bashcov -- ./main/smoke ~/tmp/export/

the exception does not occur and the coverage report looks absolutely plausible.

Environment

Ubuntu 22.04
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
bashcov 3.1.3 (via gem install bashcov)
GNU bash, Version 5.1.16(1)-release (x86_64-pc-linux-gnu)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant