Conversation
jbj
left a comment
There was a problem hiding this comment.
How is performance on the snapshots that recently made this query act up?
| MyPointer13 myPointer2(myBuffer); | ||
| MyPointer13 myPointer3(new char[100]); | ||
|
|
||
| delete myPointer2.getPointer(); // GOOD |
There was a problem hiding this comment.
I must be missing something here. I'd expect myPointer2.getPointer() to return pointer from myPointer2, which is set in the constructor call myPointer2(myBuffer), and myBuffer uses malloc. So why is this // GOOD?
There was a problem hiding this comment.
The test was supposed to delete myPointer3, sorry (the point being that the query can't tell the difference, so has to be conservative in this case). Updated.
|
Do you think this bug is new in 1.20? |
I just ran the three queries that use It's likely that with a warmed up cache these queries perform well. In the long run we might replace the remaining SSA in this library with dataflow, which I'd expect to improve performance.
I don't think so, though we have made some changes to the query lately. It's certainly plausible that the particular FP in the ticket above didn't show up until recently 1.20. |
|
I'm not worried about performance on a cold cache. The data flow library has to be computed at some point in the suite anyway, so the suite won't get slower just because this query uses it. If the second and third queries take 21s and 12s, that means |
|
Yep I agree. |
See https://discuss.lgtm.com/t/malloc-delete-mismatch-false-positive/1914.
The issue was that the call to
tmp.data()was being misrecognized as an allocation call, due to over-enthusiastic data-flow tracking. The fix is to only use local data flow for the purposes of identifyingmalloc-like functions (whereas global flow is still used to track between themallocandfree).Diff query: https://lgtm.com/query/3658696700719411428/