Open anthonyalayo opened 1 year ago
Can you attach example of json file, and what kind of errors you get?
@aras-p thanks for the quick response, I'll be back at my computer in an hour and I'll get a dump for you.
@aras-p, came back home and tried a few things, and I realized this happens even with Clang 13.
❯ clang --version
Homebrew clang version 13.0.1
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /opt/homebrew/bin
❯ ninja --version
1.11.1
❯ cmake --version
cmake version 3.27.7
I added this to my library target (before the executable):
target_compile_options(${PROJECT_LIB_NAME} PRIVATE -ftime-trace)
Then I ran the following:
ClangBuildAnalyzer --all build output.bin
And I get this:
Processing all files and saving to 'output.bin'...
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error STRING_ERROR: Problem while parsing a string.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error STRING_ERROR: Problem while parsing a string.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error T_ATOM_ERROR: Problem while parsing an atom starting with the letter 't'.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error STRING_ERROR: Problem while parsing a string.
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error STRING_ERROR: Problem while parsing a string.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error STRING_ERROR: Problem while parsing a string.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error T_ATOM_ERROR: Problem while parsing an atom starting with the letter 't'.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error DEPTH_ERROR: The JSON document was too deep (too many nested objects and arrays).
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error STRING_ERROR: Problem while parsing a string.
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error UNESCAPED_CHARS: Within strings, some characters must be escaped, we found unescaped characters.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error NUMBER_ERROR: Problem while parsing a number.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc..
done in 3.6s. Run 'ClangBuildAnalyzer --analyze output.bin' to analyze it.
Am I perhaps doing something wrong? I noticed there is no top level JSON trace file.
Any idea what causes those @aras-p ?
I just tested locally with clang 14 and clang 16, and everything seems to work as expected. Hard to say what goes wrong without seeing at least some of the json files that would be produced next to object files under your build folder.
For the record, I get these too.
Processing all files and saving to 'buildAnalyze.bin'...
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure:
missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure:
missing or superfluous commas, braces, missing keys, etc..
WARN: JSON parse error F_ATOM_ERROR: Problem while parsing an atom starting with
the letter 'f'.
WARN: JSON parse error TAPE_ERROR: The JSON document has an improper structure:
missing or superfluous commas, braces, missing keys, etc..
done in 86.6s. Run 'ClangBuildAnalyzer --analyze buildAnalyze.bin' to analyze
it.
And again, without knowing what is in these json files, it's hard to say what's going on
So I updated to the latest code. It's because it's processing random json files part of my project that are not from clang :(
Is there a way to specify a pattern to match when it does things recursively? I think something like *.C.json
would work well for me.
nice find @e4lam , i think thats my problem too
There are a whole bunch of json files, that Xcode dumps out to the build directories. clang is on all platforms now, so you didn't really state what platform you were building on.
Hey there,
Is there support for Clang 14/15/16? I noticed your previous history of adding support for new Clang versions, and I'm noticing a lot of errors and a missing trace.json at the top level.