codeql icon indicating copy to clipboard operation
codeql copied to clipboard

Catastrophic error ("internal error: assertion failed at: "decls.c", line 21165 in mark_decl_after_first_in_comma_list") when compiling a CodeQL database from Chromium

Open flowerhack opened this issue 1 year ago • 2 comments

Hi hello,

I'm a committer for the Chromium project & we've been experimenting with building CodeQL databases of Chromium.

This bug is similar to the one I previously reported (in that it's a "catastrophic error" that occurs when building a CodeQL database of Chromium), but it seems to have a different root cause, and thus, I'm filing this bug + the reproducer for it separately.

Additionally, I think this bug might be a duplicate of this bug which was reported by someone else, which was left open with a request for a reproducing test case, which I happily provide here.

The Bug

Warning[extractor-c++]: In construct_text_message: "../../base/functional/function_ref.h", line 69: internal error: assertion failed at: "decls.c", line 21165 in mark_decl_after_first_in_comma_list

        std::convertible_to<internal::ExtractReturnType<RunType>, R> &&
                                                                  ^

Reproducing The Bug

I have created a standalone file which can be used to reproduce this bug, which is attached here as importer_list_ii.cc.txt (please remove the .txt extension; this was to make the Github attachment uploader happy).

Reproduction steps (assumes that importer_list_ii.cc is in /YOUR/ROOT/HERE; assumes Clang 19; assumes Linux):

(1) codeql database init --language=cpp --source-root=/YOUR/ROOT/HERE/SOME-EMPTY-SOURCE-DIR /YOUR/ROOT/HERE/repro-failure --overwrite

(2) codeql database trace-command /YOUR/ROOT/HERE/repro-failure --working-dir=/YOUR/ROOT/HERE -- clang -Wno-constant-conversion -Wno-shorten-64-to-32 -Wenum-compare-conditional '-Wno-c++11-narrowing-const-reference' -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare '-std=c++20' -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti '-nostdinc++' --sysroot=../../build/linux/debian_bullseye_amd64-sysroot -fvisibility-inlines-hidden -c ~/importer_list_ii.cc -o ~/importer_list.o

(3) codeql database finalize -j=-1 /YOUR/ROOT/HERE/repro-failure

At the conclusion of these steps there should be logs in build-tracer.log and logs/extractor indicating the failure.

In addition to (1) importer_list_ii.cc (the reproducer file), please find attached (2) the build-tracer.log and (3) the relevant extractor logfile (8f379.log) from running this on my own machine, which will hopefully be useful for debugging/triage.

I do have the logs for the entire Chromium build available upon request, but as you might imagine, those files are very large and may not be as useful to you as this standalone reproducer.

A fix for this bug (or, guidance on how we might be holding it wrong!) would be extremely helpful for us here in Chromium. Please let me know if you need any more information. Thank you!

importer_list_ii.cc.txt build-tracer.log 8f379.log

flowerhack avatar Jun 18 '24 23:06 flowerhack

Hi @flowerhack ,

As with the other issue, thanks for the report and the reproducer. I've filed an internal issue for this, and hopefully we can get to this fairly soon.

jketema avatar Jun 19 '24 11:06 jketema

Reported to our frontend provider.

jketema avatar Jun 20 '24 12:06 jketema

@jketema For this ticket and the other recent Chrome errors with CodeQL, we've gone ahead and uploaded a full log for you folks:

https://REMOVED.eu.r2.cloudflarestorage.com/public-logs/127-0-6533-41-build-tracer.log?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=REMOVED%2F20240717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20240717T171126Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=93c708cd5e92f773391c3a25fb8ad4808e31b97b5cf71577c6bc4aeca0c11596

Right now, CodeQL is unusable for Chromium due to these catastrophic errors. =(

Manouchehri avatar Jul 17 '24 17:07 Manouchehri

We've received a patch. This will be fixed in CodeQL 2.18.2.

jketema avatar Jul 22 '24 14:07 jketema

Wonderful news, thank you!

flowerhack avatar Jul 24 '24 01:07 flowerhack