Codeql database create fails when building mozilla
- Lenguaje dominante
- CodeQL
- Estrellas
- 10.1k
- Forks
- 2.1k
- Merge medio
- 2 d 15 h
- PR fusionados (30 d)
- 141
Descripción
I'm trying to build mozilla from [this repo](https://github.com/mozilla/gecko-dev) and create a cpp codeql database.
In order to that, I first run `./mach configure` and after it's done, I run the following command to create the database:
`~/codeql/codeql database create mozilla4 --language=c-cpp --command="./mach build"`
Which builds mozilla successfully, but it fails in the importing trap file stage. I have included the logs for [creating](https://drive.google.com/file/d/1Npi4LVb7fzHoALmQrlDPKofnpYheE8lg/view?usp=drive_link) the database and [importing](https://drive.google.com/file/d/15J_n7OoP4ifb9TTmXnkHBDpYpgVDI596/view?usp=sharing) dataset.
A glance of the errors is like:
```
[ERROR] 14135855_0.trap.br, 1: java.io.IOException: Brotli stream decoding failed
org.brotli.dec.BrotliInputStream.read(BrotliInputStream.java:167)
com.semmle.inmemory.trap.TrapInputStream.read(TrapInputStream.java:60)
com.semmle.inmemory.trap.TrapScanner.fill(TrapScanner.java:451)
com.semmle.inmemory.trap.TrapScanner.ensureNext(TrapScanner.java:428)
com.semmle.inmemory.trap.TrapScanner.nextToken(TrapScanner.java:61)
com.semmle.inmemory.trap.TRAPReader.scanTuplesAndLabels(TRAPReader.java:493)
com.semmle.inmemory.trap.TRAPLinker$TrapLinkDirectiveScanner.scanTuplesAndLabels(TRAPLinker.java:311)
com.semmle.inmemory.trap.TRAPReader.importTuples(TRAPReader.java:414)
com.semmle.inmemory.trap.TRAPReader.importTuples(TRAPReader.java:400)
com.semmle.inmemory.trap.TRAPLinker.lambda$getTasks$2(TRAPLinker.java:215)
com.semmle.util.concurrent.FutureUtils.lambda$mapAsync_$8(FutureUtils.java:161)
java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.base/java.lang.Thread.run(Unknown Source)
... caused by:
org.brotli.dec.BrotliRuntimeException: Corrupted Huffman code histogram
org.brotli.dec.Decode.readComplexHuffmanCode(Decode.java:591)
org.brotli.dec.Decode.readHuffmanCode(Decode.java:613)
org.brotli.dec.Decode.readMetablockPartition(Decode.java:783)
org.brotli.dec.Decode.readMetablockHuffmanCodesAndContextMaps(Decode.java:825)
org.brotli.dec.Decode.decompress(Decode.java:1110)
org.brotli.dec.BrotliInputStream.read(BrotliInputStream.java:162)
com.semmle.inmemory.trap.TrapInputStream.read(TrapInputStream.java:60)
com.semmle.inmemory.trap.TrapScanner.fill(TrapScanner.java:451)
com.semmle.inmemory.trap.TrapScanner.ensureNext(TrapScanner.java:428)
com.semmle.inmemory.trap.TrapScanner.nextToken(TrapScanner.java:61)
com.semmle.inmemory.trap.TRAPReader.scanTuplesAndLabels(TRAPReader.java:493)
com.semmle.inmemory.trap.TRAPLinker$TrapLinkDirectiveScanner.scanTuplesAndLabels(TRAPLinker.java:311)
com.semmle.inmemory.trap.TRAPReader.importTuples(TRAPReader.java:414)
com.semmle.inmemory.trap.TRAPReader.importTuples(TRAPReader.java:400)
com.semmle.inmemory.trap.TRAPLinker.lambda$getTasks$2(TRAPLinker.java:215)
com.semmle.util.concurrent.FutureUtils.lambda$mapAsync_$8(FutureUtils.java:161)
java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.base/java.lang.Thread.run(Unknown Source)
at (start of line)
```
I can build mozilla separately following similar steps, but when I try to create a database it fails. The database is created in the end, but some of the files are missing and are not added to the database.
Can someone please point me to the right direction on how to solve this issue?
Guía de contribución
Línea de trabajo
Start by reproducing the failure with ./mach configure followed by the CodeQL database create command using ./mach build. Review the linked creation and import logs, focusing on the corrupted .trap.br files and the trap importing stage; done means the database imports successfully without missing files.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp
- Área
- security, tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 30/100