Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmd] Fix a crash with CodeChecker cmd diff --unique on #3816

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

Szelethus
Copy link
Collaborator

@Szelethus Szelethus commented Jan 13, 2023

Suppose we have a server with two non-empty, non-identical runs, Example1 and Example2. The following invocation:

CodeChecker cmd diff -o rows --url localhost/Default -n "Example2" -b "Example1" --new --uniqueing on

would have crashed at a thrift call level. If uniqueing wasn't on, the crash was abscent as well.

The root of the problem wasn't on the thrift level, however, but rather that a thrift function was invoked with None values, when said parameters mustn't have been None.

Specifically, these values were the file ID's of some reports. The file ID, column and row numbers of a report are None in the ReportData with uniqueing, but are proper values otherwise.

This makes some sense -- if 10 reports have the same report hash, by uniquing we obtain a report that describes 10 reports, so "some sense of identity being lost" would be an understandable approach to uniquing, but we can do better.

We can just take the arguably easier solution of picking a random report out of the 10 equivalent one, and say that this report stands in the place of the other 9.

On the implementation level, I simply querried the rest of the fields of the table, which in effect does just this.

Suppose we have a server with two non-identical runs, Example1 and
Example2. The following invocation:

CodeChecker cmd diff -o rows --url localhost/Default -n "Example2" -b "Example1" --new --uniqueing on

would have crashed at a thrift call level. If uniqueing wasn't on, the
crash was abscent as well.

The root of the problem wasn't on the thrift level, however, but rather
that a thrift function was invoked with None values, when said
parameters mustn't have been None.

Specifically, these values were the file ID's of some reports. The file
ID, column and row numbers of a report are None in the ReportData with
uniqueing, but are proper values otherwise.

This makes some sense -- if 10 reports have the same report hash, by
uniquing we obtain a report that describes 10 reports, so "some sense of
identity being lost" would be an understandable approach to uniquing,
but we can do better.

We can just take the arguably easier solution of picking a random report
out of the 10 equivalent one, and say that this report stands in the
place of the other 9.

On the implementation level, I simply querried the rest of the fields of
the table, which in effect does just this.
@Szelethus Szelethus added bug 🐛 CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands server 🖥️ labels Jan 13, 2023
@Szelethus Szelethus added this to the release 6.22.0 milestone Jan 13, 2023
@bruntib bruntib merged commit 1ed457e into Ericsson:master Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands server 🖥️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants