github / github/codeql

Unable to create database on latest Linux kernel

オープン
#20,978 コメント 11 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug C++ question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

**Description of the issue**

I'm attempting to analyze the Linux kernel using CodeQL, but I'm encountering errors during database creation.

**Steps to reproduce:**

1. Clone the latest Linux kernel repository
2. Run: `codeql database create db --language c`
3. CodeQL correctly detects it as a Linux kernel and starts the autobuild process
4. The build completes defconfig and compiles the kernel successfully

**Problem:**

The trace output contains numerous "identifier 'asm' is undefined" errors, such as:

```
[E 15:16:45 4019640] Warning[extractor-c++]: In construct_text_message: "./include/linux/sched/signal.h", line 278: error: identifier "asm" is undefined
WARN_ON(sig->flags & SIGNAL_GROUP_EXIT);
^

"./include/linux/mm_types.h", line 1362: error: identifier "asm" is undefined
set_mask_bits(bitmap, mask, bits);
^

"./arch/x86/include/asm/pgtable.h", line 741: error: identifier "asm" is undefined
WARN_ON_ONCE((pgprot_val(pgprot) & (_PAGE_DIRTY | _PAGE_RW)) ==
^
```

Additionally, the resulting database is highly incomplete and contains very little information, making it unusable for analysis.

**Environment tested:**

- Ubuntu 24.04 and Arch Linux
- Latest CodeQL and version from June 2024

I would greatly appreciate any guidance on what might be causing this issue. Thank you very much for your time!

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by reproducing `codeql database create db --language c` on the latest Linux kernel and inspect the extractor trace, especially the reported errors in `include/linux/sched/signal.h`, `include/linux/mm_types.h`, and `arch/x86/include/asm/pgtable.h`. Compare behavior on Ubuntu 24.04 and Arch Linux with the latest CodeQL versions; done means database creation completes without the `asm` errors and produces usable analysis data.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, linux
領域
devtools, operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
説明が足りない
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。