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

hadoop command in shell scripts give Kcov error #186

Open
bhaskarrana opened this issue Feb 14, 2017 · 4 comments
Open

hadoop command in shell scripts give Kcov error #186

bhaskarrana opened this issue Feb 14, 2017 · 4 comments

Comments

@bhaskarrana
Copy link

Hi Simon,

As hadoop command in shell script throwing error
$ kcov /tmp/out test.sh
O/P
kcov: error: ]} ${JAVA8_HOME_CANDIDATES[ is not an integer
kcov: error: ]}'
is not an integer
kcov: error: HADOOP_COMMON_DIR=./
is not an integer
kcov: error: HADOOP_COMMON_LIB_JARS_DIR=lib
is not an integer
kcov: error: HADOOP_COMMON_LIB_NATIVE_DIR=lib/native
is not an integer
kcov: error: HDFS_DIR=./
is not an integer

Following is the script
cat test.sh

#!/bin/bash
hadoop fs -ls

Regards
Bhaskar Rana

@SimonKagstrom
Copy link
Owner

I really have no clue as to what causes this. Is the hadoop command a shell script as well?

@bhaskarrana
Copy link
Author

bhaskarrana commented Feb 22, 2017 via email

@bhaskarrana
Copy link
Author

bhaskarrana commented Mar 2, 2017

Hi Simon,

Here is sample

cat test
#!/usr/bin/env bash

BIGTOP_DEFAULTS_DIR=${BIGTOP_DEFAULTS_DIR-/etc/default}
[ -n "${BIGTOP_DEFAULTS_DIR}" -a -r ${BIGTOP_DEFAULTS_DIR}/bigtop-utils ] && . ${BIGTOP_DEFAULTS_DIR}/bigtop-utils

JAVA6_HOME_CANDIDATES=(
'/usr/lib/j2sdk1.6-sun'
'/usr/lib/jvm/java-6-sun'
'/usr/lib/jvm/java-1.6.0-sun-1.6.0'
'/usr/lib/jvm/j2sdk1.6-oracle'
'/usr/lib/jvm/j2sdk1.6-oracle/jre'
'/usr/java/jdk1.6'
'/usr/java/jre1.6'
)

This file gives error

cat testError.sh

. /home/abcaxis/A//abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/test

Output
kcov: error: 3BIGTOP_DEFAULTS_DIR=/etc/default

This file donot give error
cat testNoError.sh
. /home/abcaxis/A/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/test

The difference is the directory nested level
/home/abcaxis/A//abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/test
/home/abcaxis/A/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/abcdef/test

The no error script has one less levle than error one.
Regards
Bhaskar Rana

@SimonKagstrom
Copy link
Owner

Yes, I'm afraid this is a bash PS4 limitation, which will cut the string after some character limit. Again, it might be good to test the --bash-method=DEBUG, although I don't think that will fix it either.

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

2 participants