Closed
Description
I've tested that Perform CodeQL Analysis
step fails with error bellow when tuple is used to declare field type. No .matter if i use class style ( vue2 ) or setup script ( vue3). Also the exception says nothing for me even when debug is enabled.
Example code that fails:
Vue3
<template>
<div>asd</div>
</template>
<script lang='ts' setup>
const smth: Promise<[number, number[]]> = Promise.resolve([1, [2, 3, 4]]);
</script>
Vue2
<template>
<div>asd</div>
</template>
<script lang='ts'>
import { Component, Vue } from 'vue-property-decorator';
@Component
export class CwTest extends Vue {
public smth: Promise<[number, number[]]> = Promise.resolve([1, [2,3,4]]);
}
</script>
Error that is shown:
[2023-03-31 13:11:31] [build-stdout] Extracting /home/runner/work/_temp/codeql_databases/javascript/working/src/components/CwTest.vue.ts
[2023-03-31 13:11:31] [build-stderr] Exception while extracting /home/runner/work/_temp/codeql_databases/javascript/working/src/components/CwTest.vue.ts.
[2023-03-31 13:11:31] [build-stderr] java.lang.NullPointerException: Null file
[2023-03-31 13:11:31] [build-stderr] at com.semmle.util.diagnostics.AutoValue_DiagnosticLocation$Builder.setFile(AutoValue_DiagnosticLocation.java:111)
[2023-03-31 13:11:31] [build-stderr] at com.semmle.js.extractor.AutoBuild.doExtract(AutoBuild.java:1247)
[2023-03-31 13:11:31] [build-stderr] at com.semmle.js.extractor.AutoBuild.extract(AutoBuild.java:1220)
[2023-03-31 13:11:31] [build-stderr] at com.semmle.js.extractor.AutoBuild.extractTypeScriptFiles(AutoBuild.java:1173)
[2023-03-31 13:11:31] [build-stderr] at com.semmle.js.extractor.AutoBuild.extractTypeScript(AutoBuild.java:1051)
[2023-03-31 13:11:31] [build-stderr] at com.semmle.js.extractor.AutoBuild.extractSource(AutoBuild.java:752)
[2023-03-31 13:11:31] [build-stderr] at com.semmle.js.extractor.AutoBuild.run(AutoBuild.java:459)
[2023-03-31 13:11:31] [build-stderr] at com.semmle.js.extractor.AutoBuild.main(AutoBuild.java:1330)
Error: 3-31 13:11:32] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/opt/hostedtoolcache/CodeQL/2.12.5-20230317/x64/codeql/javascript/tools/autobuild.sh])
A fatal error occurred: Exit status 1 from command: [/opt/hostedtoolcache/CodeQL/2.12.5-20230317/x64/codeql/javascript/tools/autobuild.sh]
Error: A fatal error occurred.
Activity
[-][Vue.js + TS] Perform CodeQL Analysis fails when tuple is used as a type in a component[/-][+][Vue.js + TS] Perform CodeQL Analysis fails when tuple is used as a type in a vue component[/+]MathiasVP commentedon Apr 3, 2023
Hi @krystian-wolarek,
Thank you for raising this issue. I've forwarded it to the relevant CodeQL team, and I expect that they'll have a response to this very soon 🤞.
erik-krogh commentedon Apr 3, 2023
Thanks for the report, and especially thanks for including a nice stack-trace, that was just what I needed to identify the issue 🙇
It seems to be a straight-forward null-pointer in some new code of ours.
I got some code that I think fixes it here: #12742.
After that is merged it might still take a few weeks for the fix to land on your workflows.
hmakholm commentedon Apr 28, 2023
@erik-krogh, did this fix ever get merged?
erik-krogh commentedon Apr 28, 2023
Yes. Although in a new PR: #12743
The code has since been rewritten even more: #12895
I'm not sure when that lands in codeql-action.