Skip to content

[Vue.js + TS] Perform CodeQL Analysis fails when tuple is used as a type in a vue component #12734

Closed
@krystian-wolarek

Description

@krystian-wolarek

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

changed the title [-][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[/+] on Mar 31, 2023
MathiasVP

MathiasVP commented on Apr 3, 2023

@MathiasVP
Contributor

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 🤞.

self-assigned this
on Apr 3, 2023
erik-krogh

erik-krogh commented on Apr 3, 2023

@erik-krogh
Contributor

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

hmakholm commented on Apr 28, 2023

@hmakholm
Contributor

@erik-krogh, did this fix ever get merged?

erik-krogh

erik-krogh commented on Apr 28, 2023

@erik-krogh
Contributor

@erik-krogh, did this fix ever get merged?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @MathiasVP@krystian-wolarek@hmakholm@erik-krogh

    Issue actions

      [Vue.js + TS] Perform CodeQL Analysis fails when tuple is used as a type in a vue component · Issue #12734 · github/codeql