VARARGS method doesn't have an array as last arg!!
Environment: ubuntu 18 python 2.7 qark installed from pip
INFO: Decompiling class class_193
INFO: ... done
Running scans...
Traceback (most recent call last):
File "/home/ubuntu/.virtualenvs/secpy2/bin/qark", line 10, in
This is a bug in a third party dependency that we can catch. I'm guessing you are using a java version that is not supported by javalang. Regardless, we can catch this exception in our code and move on.
Here's mine:
Running scans...
Traceback (most recent call last):
File "/Users/terence/Library/Python/2.7/bin/qark", line 10, in <module>
sys.exit(cli())
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/qark/qark.py", line 90, in cli
scanner.run()
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/qark/scanner/scanner.py", line 64, in run
self._run_checks(plugins)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/qark/scanner/scanner.py", line 78, in _run_checks
current_file_subject.notify(filepath)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/qark/scanner/scanner.py", line 125, in notify
observer.update(file_path, call_run=True)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/qark/scanner/plugin.py", line 239, in update
super(CoroutinePlugin, self).update(file_path)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/qark/scanner/plugin.py", line 185, in update
JavaASTPlugin.java_ast = javalang.parse.parse(self.file_contents)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/javalang/parse.py", line 52, in parse
parser = Parser(tokens)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/javalang/parser.py", line 95, in __init__
self.tokens = util.LookAheadListIterator(tokens)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/javalang/util.py", line 92, in __init__
self.list = list(iterable)
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/javalang/tokenizer.py", line 531, in tokenize
self.read_string()
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/javalang/tokenizer.py", line 201, in read_string
self.error('Unterminated character/string literal')
File "/Users/terence/Library/Python/2.7/lib/python/site-packages/javalang/tokenizer.py", line 572, in error
raise error
javalang.tokenizer.LexerError: Unterminated character/string literal at "'", line 23: /* varargs */ h(k k2, String string2, Object[] arrobject, int n2, List list, org.benf.cfr.reader.util.ConfusedCFRException: VARARGS method doesn't have an array as last arg!!
I also encountered the same error.
Running scans... Traceback (most recent call last): File "/Users/ione/Library/Python/2.7/bin/qark", line 10, in <module> sys.exit(cli()) File "/Users/ione/Library/Python/2.7/lib/python/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/Users/ione/Library/Python/2.7/lib/python/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/Users/ione/Library/Python/2.7/lib/python/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Users/ione/Library/Python/2.7/lib/python/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/Users/ione/Library/Python/2.7/lib/python/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/Users/ione/Library/Python/2.7/lib/python/site-packages/qark/qark.py", line 90, in cli scanner.run() File "/Users/ione/Library/Python/2.7/lib/python/site-packages/qark/scanner/scanner.py", line 64, in run self._run_checks(plugins) File "/Users/ione/Library/Python/2.7/lib/python/site-packages/qark/scanner/scanner.py", line 78, in _run_checks current_file_subject.notify(filepath) File "/Users/ione/Library/Python/2.7/lib/python/site-packages/qark/scanner/scanner.py", line 125, in notify observer.update(file_path, call_run=True) File "/Users/ione/Library/Python/2.7/lib/python/site-packages/qark/scanner/plugin.py", line 239, in update super(CoroutinePlugin, self).update(file_path) File "/Users/ione/Library/Python/2.7/lib/python/site-packages/qark/scanner/plugin.py", line 185, in update JavaASTPlugin.java_ast = javalang.parse.parse(self.file_contents) File "/Library/Python/2.7/site-packages/javalang/parse.py", line 52, in parse parser = Parser(tokens) File "/Library/Python/2.7/site-packages/javalang/parser.py", line 95, in __init__ self.tokens = util.LookAheadListIterator(tokens) File "/Library/Python/2.7/site-packages/javalang/util.py", line 92, in __init__ self.list = list(iterable) File "/Library/Python/2.7/site-packages/javalang/tokenizer.py", line 531, in tokenize self.read_string() File "/Library/Python/2.7/site-packages/javalang/tokenizer.py", line 201, in read_string self.error('Unterminated character/string literal') File "/Library/Python/2.7/site-packages/javalang/tokenizer.py", line 572, in error raise error javalang.tokenizer.LexerError: Unterminated character/string literal at "'", line 18: /* varargs */ n(l.d d2, String string2, Object[] arrobject, org.benf.cfr.reader.util.ConfusedCFRException: VARARGS method doesn't have an array as last arg!!
My project has Java 1.8 source compatibility (although, my code does not use those features). Not sure if it's related, but worth mentioning. :)
One can modify line 1386 of plugin.py to skip on LexerError: except (javalang.parser.JavaSyntaxError, javalang.tokenizer.LexerError, IndexError):
Hi, @fropert
Where is this file located? The only plugin.py file I found is 277 lines long. Thanks.
which java version is supported for this tool ?