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

[server] Fix suppressing bug on the server #3563

Merged
merged 1 commit into from
Jan 12, 2022

Conversation

csordasmarton
Copy link
Contributor

It is possible that the start line and end line of a bug reported by the analyzer are different.

Example:

int main()
{
  // codechecker_suppress [all] This will not be suppressed because of a bug.
  int x = 1 /
    0;
  return x;
}

In the above example the bug start line is where x variable is declared and the end line is in the next line.

On the server we stored the start line as the line where the report can be found but for suppression we checked whether there is a source code comment above the end line. So if someone inserted a source code comment above the start line the server hasn't suppressed that report.

With this patch we will solve this problem and we will check the source code comment above the start line and not the end line.

@bruntib
Copy link
Contributor

bruntib commented Jan 4, 2022

This change seems reasonable for me, but I can't reproduce the issue. The report is suppressed for me even before this change.

@csordasmarton
Copy link
Contributor Author

Make sure two things:

  • the server you are running is not built from this PR.
  • after analysis check the plist files and see whether it contains a range where the start and end lines are different and you inserted the suppress commend above the start line.

image

Also check the example in the modified test case.

It is possible that the start line and end line of a bug reported by the
analyzer are different.

Example:
```cpp
int main()
{
  // codechecker_suppress [all] This will not be suppressed because of a bug.
  int x = 1 /
    0;
  return x;
}
```

In the above example the bug start line is where `x` variable is declared and
the end line is in the next line.

On the server we stored the start line as the line where the report can be
found but for suppression we checked whether there is a source code comment
above the end line. So if someone inserted a source code comment above the
start line the server hasn't suppressed that report.

With this patch we will solve this problem and we will check the source code
comment above the start line and not the end line.
@csordasmarton csordasmarton force-pushed the fix_suppression_in_server branch from e4d4adf to 362e6a8 Compare January 12, 2022 10:01
@csordasmarton
Copy link
Contributor Author

Please use older client/server than 6.18.0. >=6.18.0 releases contained another bug (#3576) which hided this problem.

@bruntib bruntib merged commit 45ca6cc into Ericsson:master Jan 12, 2022
@csordasmarton csordasmarton deleted the fix_suppression_in_server branch January 28, 2022 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants