Skip to content

Add KNOWBUG test for 5093 #5094

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

Merged

Conversation

yumibagge
Copy link
Contributor

@yumibagge yumibagge commented Sep 6, 2019

This PR is to add KNOWBUG for #5093

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • n/a Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • n/a My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

}

int main() {
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be left off as we pass --function to cbmc

typedef struct ST ST;
typedef struct ST {
int id;
ST *c[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would simply int c[] also trigger the error?


void testFunc(ST ** t) {
*t = malloc(sizeof(ST));
assert(sizeof(ST));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assert is probably unnecessary

@yumibagge yumibagge force-pushed the yb/cbmc-regression-knownbug-5093 branch from c8db083 to 7dca873 Compare September 6, 2019 11:04
@@ -0,0 +1,15 @@
#include <assert.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now unnecessary 🍑

#include <assert.h>
#include <stdlib.h>

typedef struct ST ST;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍑

// int id;
// ST *c[];
int c[];
} ST;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to compile this with gcc and it turns out structs with only a flexible array member are illegal. So this would need to contain int id; int c[];.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course! Thanks for checking ... I keep forgetting 😅


void testFunc(ST **t)
{
*t=malloc(sizeof(ST));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried the example and this line is also unnecessary to trigger the bug.

@yumibagge yumibagge force-pushed the yb/cbmc-regression-knownbug-5093 branch 3 times, most recently from 9d513da to a971446 Compare September 6, 2019 11:19
@@ -0,0 +1,11 @@
#include <stdlib.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍑

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: a971446).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/126216769

@yumibagge yumibagge force-pushed the yb/cbmc-regression-knownbug-5093 branch from a971446 to e202df8 Compare September 6, 2019 12:19
@codecov-io
Copy link

Codecov Report

Merging #5094 into develop will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5094      +/-   ##
===========================================
+ Coverage    69.66%   69.66%   +<.01%     
===========================================
  Files         1319     1319              
  Lines       109250   109234      -16     
===========================================
- Hits         76106    76102       -4     
+ Misses       33144    33132      -12
Impacted Files Coverage Δ
jbmc/src/java_bytecode/java_bytecode_language.h 72.72% <0%> (-4.2%) ⬇️
...bmc/src/java_bytecode/java_static_initializers.cpp 97.77% <0%> (-0.43%) ⬇️
jbmc/src/java_bytecode/java_static_initializers.h 100% <0%> (ø) ⬆️
jbmc/src/java_bytecode/java_bytecode_language.cpp 93.75% <0%> (+0.66%) ⬆️
src/util/symbol_table_base.h 92.3% <0%> (+3.84%) ⬆️
src/util/journalling_symbol_table.h 89.47% <0%> (+10.52%) ⬆️
src/util/symbol_table_builder.h 82.6% <0%> (+17.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78fc2b7...e202df8. Read the comment docs.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: e202df8).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/126227218

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, tbh the entire section that causes this particular issue should probably just be removed

@yumibagge yumibagge merged commit 5b3c82d into diffblue:develop Sep 6, 2019
@yumibagge yumibagge deleted the yb/cbmc-regression-knownbug-5093 branch September 6, 2019 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants