- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for your test case.
Inspector does not generate the error until the highest mi4 level is used for analysis. We believe we should report such cases right away at least on the highest level. On the intermediate levels the problem is reported if the uninitialized data affect correctness.
If you do not want to see such error reports on the mi4 level, use suppressions. In the Details view of the results, select 'Read' observation for this problem, mouse right-click, and choose 'Supress...' in the context menu. In the private suppression dialog create a filter with 'Uninitialized memory access' problem and 'Read' and/or 'Allocation site' description. For all other columns (module, function, etc.) set * (all).
Next time before launching analysis in the analysis type selection dialog choose 'Private Suppressions: Delete problems' in the drop-down menu. The error will not appear after analysis is completed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
char *foo = (char*)malloc(100);
char *bar = (char*)malloc(100);
memcpy(bar, foo, 100);
printf("%cn", bar[100]); // <<< added this line
free(bar);
free(foo);
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
char *foo = (char*)malloc(100);
char *bar = (char*)malloc(100);
memcpy(bar, foo, 100);
printf("%cn", bar[100]); // <<< added this line
free(bar);
free(foo);
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is not the Update1 build. Inspector 1.0 Update1 starts from 63628. Please, try the latest version form IRC.
#include
#include
int main() {
char *foo = (char*)malloc(100);
//printf("%cn", foo[10]);
char *bar = (char*)malloc(100);
memcpy(bar, foo, 100);
printf("zzz%cn", bar[10]);
free(bar);
free(foo);
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
printf("%cn", bar[100]); // <<< added this line
is a separate bug - Invalid memory access. And it will be reported on each level mi2-mi4
This is the intention to report error (not warning) on the level mi4. You can suppress them easily. What exactly is bad?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Let's summarize:
1. Suppression approach is time consuming - as I explained earlier it can be configured in a minute and reused in any further analysis.
2. Suppression easily leads to missing real bugs -we need a real example to prove that. If this is the case, we might change the approach.
3. Implementing a switch such that the inspector will behave like Valgrind/memcheck - at the moment Inspector behaves the same way on mi2-mi3 levels. For mi4 you need to switch 'Private Suppressions: Delete problems' on.
If there are more concerns, please share them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-----------------------------
#include
struct Foo {
double a;
char b;
double c;
};
int main() {
Foo f1;
f1.a = 0.0;
f1.b = 'b';
f1.c = 9.0;
Foo f2 = f1; // <<<<<<<<<<< mi4 reports error here
printf ("%f %c %fn", f2.a, f2.b, f2.c);
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-----------------------------
#include
struct Foo {
double a;
char b;
double c;
};
int main() {
Foo f1;
f1.a = 0.0;
f1.b = 'b';
f1.c = 9.0;
Foo f2 = f1; // <<<<<<<<<<< mi4 reports error here
printf ("%f %c %fn", f2.a, f2.b, f2.c);
return 0;
}
No errors reported. I needthe binaryand pdb to reproduce it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No errors reported. I needthe binaryand pdb to reproduce it.
Ok.received the project by e-mail. Looks like the different default compiler settings.
I see the problem now and I can't guarantee that we fix it soon as the approach in Inspector MCdiffers from the other tools. Will let you know the results of further invesigation.
Thanks a lot for raisng the problem.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page